Chromium Code Reviews| Index: chrome/browser/after_startup_task_utils.cc |
| diff --git a/chrome/browser/after_startup_task_utils.cc b/chrome/browser/after_startup_task_utils.cc |
| index d1e7fd5f790ca84627a768c92c1b65301442cd94..5e043e143edb1bada74c994c8275e412988afc08 100644 |
| --- a/chrome/browser/after_startup_task_utils.cc |
| +++ b/chrome/browser/after_startup_task_utils.cc |
| @@ -17,7 +17,7 @@ |
| #include "base/tracked_objects.h" |
| #include "build/build_config.h" |
| #include "chrome/browser/ui/browser.h" |
| -#include "chrome/browser/ui/browser_iterator.h" |
| +#include "chrome/browser/ui/browser_list.h" |
| #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/render_frame_host.h" |
| @@ -162,8 +162,8 @@ void StartupObserver::Start() { |
| #if !defined(OS_ANDROID) |
| WebContents* contents = nullptr; |
| - for (chrome::BrowserIterator iter; !iter.done(); iter.Next()) { |
| - contents = (*iter)->tab_strip_model()->GetActiveWebContents(); |
| + for (auto& browser : *BrowserList::GetInstance()) { |
|
sky
2016/01/28 03:04:05
Does this work? BrowserList::GerInstance() returns
scottmg
2016/01/28 03:09:23
It's a BrowserList& here. The * is needed in a ran
|
| + contents = browser->tab_strip_model()->GetActiveWebContents(); |
| if (contents && contents->GetMainFrame() && |
| contents->GetMainFrame()->GetVisibilityState() == |
| blink::WebPageVisibilityStateVisible) { |