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

Unified Diff: chrome/browser/ui/window_sizer/window_sizer.cc

Issue 23567007: More cleanup in window_sizer/window_sizer_ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/window_sizer/window_sizer.cc
diff --git a/chrome/browser/ui/window_sizer/window_sizer.cc b/chrome/browser/ui/window_sizer/window_sizer.cc
index a2c6635bb89ea2a7cb36bcbbd8e6569934ab5346..80f5fd0ca269bfba27187f5b4817c66ca88e94a4 100644
--- a/chrome/browser/ui/window_sizer/window_sizer.cc
+++ b/chrome/browser/ui/window_sizer/window_sizer.cc
@@ -193,11 +193,13 @@ void WindowSizer::DetermineWindowBoundsAndShowState(
if (bounds->IsEmpty()) {
#if defined(USE_ASH)
// See if ash should decide the window placement.
- // TODO(beng): insufficient but currently necessary.
- // http://crbug.com/133312
- if (chrome::ShouldOpenAshOnStartup() &&
- GetBoundsOverrideAsh(bounds, show_state))
+ if (IsTabbedBrowserInAsh()) {
+ GetBoundsOverrideAsh(bounds, show_state);
return;
+ } else if (browser_ && browser_->host_desktop_type() ==
+ chrome::HOST_DESKTOP_TYPE_ASH) {
oshima 2013/08/31 00:54:56 This may look odd, but WindowSizerAsh::TestShowSta
sky 2013/09/03 15:58:36 Not sure either.
oshima 2013/09/03 18:15:27 I'll keep this to make sure the logic stays the sa
+ GetSavedWindowBounds(bounds, show_state);
+ }
#endif
// See if there's last active window's placement information.
if (GetLastWindowBounds(bounds, show_state))
@@ -213,9 +215,7 @@ void WindowSizer::DetermineWindowBoundsAndShowState(
// In case of a popup with an 'unspecified' location in ash, we are
// looking for a good screen location. We are interpreting (0,0) as an
// unspecified location.
- if (chrome::ShouldOpenAshOnStartup() &&
- browser_ && browser_->is_type_popup() &&
- bounds->x() == 0 && bounds->y() == 0) {
+ if (IsPopupBrowserInAsh() && bounds->origin().IsOrigin()) {
*bounds = ChromeShellDelegate::instance()->window_positioner()->
GetPopupPosition(*bounds);
return;
@@ -399,3 +399,19 @@ ui::WindowShowState WindowSizer::GetWindowDefaultShowState() const {
// Otherwise we use the default which can be overridden later on.
return ui::SHOW_STATE_DEFAULT;
}
+
+bool WindowSizer::IsTabbedBrowserInAsh() const {
+ // TODO(beng): insufficient but currently necessary. http://crbug.com/133312
+ return chrome::ShouldOpenAshOnStartup() &&
sky 2013/09/03 15:58:36 Why is this and the next checking ShouldOpenAshOnS
oshima 2013/09/03 18:15:27 My understanding is that this is necessary for win
Mr4D (OOO till 08-26) 2013/09/03 18:21:28 I might be mistaken - but you should not get here
oshima 2013/09/03 18:36:56 Sorry, I didn't get it. What do you mean?
sky 2013/09/03 20:47:31 Isn't the host_desktop_type enough?
+ browser_ &&
+ browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH &&
+ browser_->is_type_tabbed();
+}
+
+bool WindowSizer::IsPopupBrowserInAsh() const {
+ // TODO(beng): insufficient but currently necessary. http://crbug.com/133312
+ return chrome::ShouldOpenAshOnStartup() &&
+ browser_ &&
+ browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH &&
+ browser_->is_type_popup();
+}

Powered by Google App Engine
This is Rietveld 408576698