Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: chrome/browser/ui/views/frame/browser_frame_ashwin.cc

Issue 1581473002: Remove base/win/metro.{cc|h} and some associated code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/views/frame/browser_frame_ashwin.h"
6
7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h"
9 #include "chrome/browser/browser_shutdown.h"
10 #include "chrome/browser/metro_utils/metro_chrome_win.h"
11 #include "ui/aura/remote_window_tree_host_win.h"
12
13 BrowserFrameAshWin::BrowserFrameAshWin(BrowserFrame* browser_frame,
14 BrowserView* browser_view)
15 : BrowserFrameAsh(browser_frame, browser_view) {
16 }
17
18 BrowserFrameAshWin::~BrowserFrameAshWin() {
19 }
20
21 void BrowserFrameAshWin::OnWindowFocused(aura::Window* gained_focus,
22 aura::Window* lost_focus) {
23 BrowserFrameAsh::OnWindowFocused(gained_focus, lost_focus);
24 if (GetNativeWindow() != gained_focus)
25 return;
26
27 // TODO(shrikant): We need better way to handle chrome activation.
28 // There may be cases where focus events do not follow a user
29 // action to create or focus a window
30
31 // If the activated window is in Metro mode, and the viewer process window is
32 // not in the foreground, activate Metro Chrome.
33 if (aura::RemoteWindowTreeHostWin::IsValid() &&
34 !aura::RemoteWindowTreeHostWin::Instance()->IsForegroundWindow() &&
35 !browser_shutdown::IsTryingToQuit()) {
36 // PostTask because ActivateMetroChrome can not be called nested in another
37 // ::SendMessage().
38 base::MessageLoop::current()->PostTask(
39 FROM_HERE,
40 base::Bind(base::IgnoreResult(chrome::ActivateMetroChrome)));
41 }
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698