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

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

Issue 12262019: Replace static/native-desktop-only BrowserList::const_reverse_iterator by desktop specific ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: chrome_launcher_controller_per_app_unittest should be creating browsers on the ash desktop Created 7 years, 10 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
« no previous file with comments | « chrome/browser/ui/browser_list.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « chrome/browser/ui/browser_list.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698