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 da1f2d4ee7d44d9f80080e17ac6f1bb8d53af153..2afc78d855e09d2d578bc91b7ed36a7da3e41d38 100644 |
--- a/chrome/browser/ui/window_sizer/window_sizer.cc |
+++ b/chrome/browser/ui/window_sizer/window_sizer.cc |
@@ -11,9 +11,10 @@ |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ui/ash/ash_init.h" |
#include "chrome/browser/ui/browser.h" |
-#include "chrome/browser/ui/browser_list.h" |
+#include "chrome/browser/ui/browser_list_impl.h" |
#include "chrome/browser/ui/browser_window.h" |
#include "chrome/browser/ui/browser_window_state.h" |
+#include "chrome/browser/ui/host_desktop.h" |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/pref_names.h" |
#include "ui/gfx/screen.h" |
@@ -112,9 +113,16 @@ class DefaultStateProvider : public WindowSizer::StateProvider { |
if (browser_ && browser_->window() && !browser_->window()->IsPanel()) { |
window = browser_->window(); |
} else { |
- BrowserList::const_reverse_iterator it = BrowserList::begin_last_active(); |
- BrowserList::const_reverse_iterator end = BrowserList::end_last_active(); |
- for (; (it != end); ++it) { |
+ // This code is only ran on the native desktop (on the ash desktop, |
+ // GetBoundsOverrideAsh should take over below before this is reached). |
+ // TODO(gab): This code should go in a native desktop specific window |
+ // sizer as part of fixing crbug.com/175812. |
+ const chrome::BrowserListImpl* native_browser_list = |
+ chrome::BrowserListImpl::GetInstance( |
+ chrome::HOST_DESKTOP_TYPE_NATIVE); |
+ for (chrome::BrowserListImpl::const_reverse_iterator it = |
+ native_browser_list->begin_last_active(); |
+ it != native_browser_list->end_last_active(); ++it) { |
Browser* last_active = *it; |
if (last_active && last_active->is_type_tabbed()) { |
window = last_active->window(); |