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

Side by Side Diff: chrome/browser/ui/browser_win.cc

Issue 11411286: Decouple IsMetroProcess() calls, introducing IsSingleWindowMetroMode(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge up to r170746 Created 8 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "base/win/metro.h" 8 #include "base/win/metro.h"
cpu_(ooo_6.6-7.5) 2012/12/03 20:56:26 do we need metro.h here?
gab 2012/12/04 00:19:06 Yes, remaining base::win::GetMetroModule() below.
9 #include "chrome/browser/bookmarks/bookmark_utils.h" 9 #include "chrome/browser/bookmarks/bookmark_utils.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/browser_commands.h" 11 #include "chrome/browser/ui/browser_commands.h"
12 #include "chrome/browser/ui/browser_finder.h" 12 #include "chrome/browser/ui/browser_finder.h"
13 #include "chrome/browser/ui/browser_tabstrip.h" 13 #include "chrome/browser/ui/browser_tabstrip.h"
14 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" 14 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
15 #include "chrome/browser/ui/tab_contents/tab_contents.h" 15 #include "chrome/browser/ui/tab_contents/tab_contents.h"
16 #include "win8/util/win8_util.h"
16 17
17 namespace { 18 namespace {
18 19
19 void NewMetroWindow(Browser* source_browser, Profile* profile) { 20 void NewMetroWindow(Browser* source_browser, Profile* profile) {
20 typedef void (*FlipFrameWindows)(); 21 typedef void (*FlipFrameWindows)();
21 22
22 static FlipFrameWindows flip_window_fn = reinterpret_cast<FlipFrameWindows>( 23 static FlipFrameWindows flip_window_fn = reinterpret_cast<FlipFrameWindows>(
23 ::GetProcAddress(base::win::GetMetroModule(), "FlipFrameWindows")); 24 ::GetProcAddress(base::win::GetMetroModule(), "FlipFrameWindows"));
24 DCHECK(flip_window_fn); 25 DCHECK(flip_window_fn);
25 26
(...skipping 14 matching lines...) Expand all
40 // browser window to be hidden and the next window to be shown. 41 // browser window to be hidden and the next window to be shown.
41 flip_window_fn(); 42 flip_window_fn();
42 } 43 }
43 } 44 }
44 45
45 } // namespace 46 } // namespace
46 47
47 namespace chrome { 48 namespace chrome {
48 49
49 void NewWindow(Browser* browser) { 50 void NewWindow(Browser* browser) {
50 #if !defined(USE_AURA) 51 if (win8::IsSingleWindowMetroMode()) {
51 if (base::win::IsMetroProcess()) {
52 NewMetroWindow(browser, browser->profile()->GetOriginalProfile()); 52 NewMetroWindow(browser, browser->profile()->GetOriginalProfile());
53 return; 53 return;
54 } 54 }
55 #endif
56 NewEmptyWindow(browser->profile()->GetOriginalProfile(), 55 NewEmptyWindow(browser->profile()->GetOriginalProfile(),
57 browser->host_desktop_type()); 56 browser->host_desktop_type());
58 } 57 }
59 58
60 void NewIncognitoWindow(Browser* browser) { 59 void NewIncognitoWindow(Browser* browser) {
61 #if !defined(USE_AURA) 60 if (win8::IsSingleWindowMetroMode()) {
62 if (base::win::IsMetroProcess()) {
63 NewMetroWindow(browser, browser->profile()->GetOffTheRecordProfile()); 61 NewMetroWindow(browser, browser->profile()->GetOffTheRecordProfile());
64 return; 62 return;
65 } 63 }
66 #endif
67 NewEmptyWindow(browser->profile()->GetOffTheRecordProfile(), 64 NewEmptyWindow(browser->profile()->GetOffTheRecordProfile(),
68 browser->host_desktop_type()); 65 browser->host_desktop_type());
69 } 66 }
70 67
cpu_(ooo_6.6-7.5) 2012/12/03 20:56:26 these two functions should call a single local fun
gab 2012/12/04 00:19:06 Sure, but I don't feel this is related to this cha
cpu_(ooo_6.6-7.5) 2012/12/04 01:00:51 It is related. You are adding code that can be de-
gab 2012/12/04 18:47:42 Ok, done.
71 } // namespace chrome 68 } // namespace chrome
72 69
73 void Browser::SetMetroSnapMode(bool enable) { 70 void Browser::SetMetroSnapMode(bool enable) {
74 fullscreen_controller_->SetMetroSnapMode(enable); 71 fullscreen_controller_->SetMetroSnapMode(enable);
75 } 72 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698