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

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

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 12 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
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/window_sizer/window_sizer.h" 5 #include "chrome/browser/ui/window_sizer/window_sizer.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // ASH. This ensures that the display gets the correct workarea, etc. 150 // ASH. This ensures that the display gets the correct workarea, etc.
151 // If the ASH shell does not exist then the current behavior is to open 151 // If the ASH shell does not exist then the current behavior is to open
152 // browser windows if any on the desktop. Preserve that for now. 152 // browser windows if any on the desktop. Preserve that for now.
153 // TODO(ananta). 153 // TODO(ananta).
154 // This effectively means that the running browser process is in a split 154 // This effectively means that the running browser process is in a split
155 // personality mode, part of it running in ASH and the other running in 155 // personality mode, part of it running in ASH and the other running in
156 // desktop. This may cause apps and other widgets to not work correctly. 156 // desktop. This may cause apps and other widgets to not work correctly.
157 // Revisit and address. 157 // Revisit and address.
158 #if defined(OS_WIN) 158 #if defined(OS_WIN)
159 force_ash = ash::Shell::HasInstance() && 159 force_ash = ash::Shell::HasInstance() &&
160 CommandLine::ForCurrentProcess()->HasSwitch(switches::kViewerConnect); 160 base::CommandLine::ForCurrentProcess()->HasSwitch(
161 switches::kViewerConnect);
161 #endif 162 #endif
162 // Use the target display on ash. 163 // Use the target display on ash.
163 if (chrome::ShouldOpenAshOnStartup() || force_ash) { 164 if (chrome::ShouldOpenAshOnStartup() || force_ash) {
164 aura::Window* target = ash::Shell::GetTargetRootWindow(); 165 aura::Window* target = ash::Shell::GetTargetRootWindow();
165 return screen->GetDisplayNearestWindow(target); 166 return screen->GetDisplayNearestWindow(target);
166 } 167 }
167 #endif 168 #endif
168 // Find the size of the work area of the monitor that intersects the bounds 169 // Find the size of the work area of the monitor that intersects the bounds
169 // of the anchor window. 170 // of the anchor window.
170 return screen->GetDisplayMatching(bounds); 171 return screen->GetDisplayMatching(bounds);
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 bool show_state = !browser_->is_type_tabbed() && !browser_->is_devtools(); 425 bool show_state = !browser_->is_type_tabbed() && !browser_->is_devtools();
425 426
426 #if defined(USE_AURA) 427 #if defined(USE_AURA)
427 // We use the apps save state on aura. 428 // We use the apps save state on aura.
428 show_state &= !browser_->is_app(); 429 show_state &= !browser_->is_app();
429 #endif 430 #endif
430 431
431 if (show_state) 432 if (show_state)
432 return browser_->initial_show_state(); 433 return browser_->initial_show_state();
433 434
434 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kStartMaximized)) 435 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
436 switches::kStartMaximized))
435 return ui::SHOW_STATE_MAXIMIZED; 437 return ui::SHOW_STATE_MAXIMIZED;
436 438
437 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT) 439 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT)
438 return browser_->initial_show_state(); 440 return browser_->initial_show_state();
439 441
440 // Otherwise we use the default which can be overridden later on. 442 // Otherwise we use the default which can be overridden later on.
441 return ui::SHOW_STATE_DEFAULT; 443 return ui::SHOW_STATE_DEFAULT;
442 } 444 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/version_ui.cc ('k') | chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698