This source file includes following definitions.
- OnWindowFocused
#include "chrome/browser/ui/views/frame/browser_frame_ashwin.h"
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/metro_utils/metro_chrome_win.h"
#include "ui/aura/remote_window_tree_host_win.h"
BrowserFrameAshWin::BrowserFrameAshWin(BrowserFrame* browser_frame,
BrowserView* browser_view)
: BrowserFrameAsh(browser_frame, browser_view) {
}
BrowserFrameAshWin::~BrowserFrameAshWin() {
}
void BrowserFrameAshWin::OnWindowFocused(aura::Window* gained_focus,
aura::Window* lost_focus) {
BrowserFrameAsh::OnWindowFocused(gained_focus, lost_focus);
if (GetNativeWindow() != gained_focus)
return;
if (aura::RemoteWindowTreeHostWin::IsValid() &&
!aura::RemoteWindowTreeHostWin::Instance()->IsForegroundWindow() &&
!browser_shutdown::IsTryingToQuit()) {
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(base::IgnoreResult(chrome::ActivateMetroChrome)));
}
}