OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/frame/browser_frame_ashwin.h" | 5 #include "chrome/browser/ui/views/frame/browser_frame_ashwin.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "chrome/browser/browser_shutdown.h" | 9 #include "chrome/browser/browser_shutdown.h" |
10 #include "chrome/browser/metro_utils/metro_chrome_win.h" | 10 #include "chrome/browser/metro_utils/metro_chrome_win.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 BrowserFrameAsh::OnWindowFocused(gained_focus, lost_focus); | 23 BrowserFrameAsh::OnWindowFocused(gained_focus, lost_focus); |
24 if (GetNativeWindow() != gained_focus) | 24 if (GetNativeWindow() != gained_focus) |
25 return; | 25 return; |
26 | 26 |
27 // TODO(shrikant): We need better way to handle chrome activation. | 27 // TODO(shrikant): We need better way to handle chrome activation. |
28 // There may be cases where focus events do not follow a user | 28 // There may be cases where focus events do not follow a user |
29 // action to create or focus a window | 29 // action to create or focus a window |
30 | 30 |
31 // If the activated window is in Metro mode, and the viewer process window is | 31 // If the activated window is in Metro mode, and the viewer process window is |
32 // not in the foreground, activate Metro Chrome. | 32 // not in the foreground, activate Metro Chrome. |
33 if (!aura::RemoteRootWindowHostWin::Instance()->IsForegroundWindow() && | 33 if (!aura::RemoteWindowTreeHostWin::Instance()->IsForegroundWindow() && |
34 !browser_shutdown::IsTryingToQuit()) { | 34 !browser_shutdown::IsTryingToQuit()) { |
35 // PostTask because ActivateMetroChrome can not be called nested in another | 35 // PostTask because ActivateMetroChrome can not be called nested in another |
36 // ::SendMessage(). | 36 // ::SendMessage(). |
37 base::MessageLoop::current()->PostTask( | 37 base::MessageLoop::current()->PostTask( |
38 FROM_HERE, | 38 FROM_HERE, |
39 base::Bind(base::IgnoreResult(chrome::ActivateMetroChrome))); | 39 base::Bind(base::IgnoreResult(chrome::ActivateMetroChrome))); |
40 } | 40 } |
41 } | 41 } |
OLD | NEW |