| OLD | NEW |
| 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/chromeos/boot_times_recorder.h" | 5 #include "chrome/browser/chromeos/boot_times_recorder.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
| 25 #include "base/strings/stringprintf.h" | 25 #include "base/strings/stringprintf.h" |
| 26 #include "base/sys_info.h" | 26 #include "base/sys_info.h" |
| 27 #include "base/thread_task_runner_handle.h" | 27 #include "base/thread_task_runner_handle.h" |
| 28 #include "base/threading/thread.h" | 28 #include "base/threading/thread.h" |
| 29 #include "base/threading/thread_restrictions.h" | 29 #include "base/threading/thread_restrictions.h" |
| 30 #include "base/time/time.h" | 30 #include "base/time/time.h" |
| 31 #include "chrome/browser/browser_process.h" | 31 #include "chrome/browser/browser_process.h" |
| 32 #include "chrome/browser/chrome_notification_types.h" | 32 #include "chrome/browser/chrome_notification_types.h" |
| 33 #include "chrome/browser/ui/browser.h" | 33 #include "chrome/browser/ui/browser.h" |
| 34 #include "chrome/browser/ui/browser_iterator.h" | |
| 35 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 34 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 36 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
| 37 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
| 38 #include "components/user_manager/user_manager.h" | 37 #include "components/user_manager/user_manager.h" |
| 39 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
| 40 #include "content/public/browser/navigation_controller.h" | 39 #include "content/public/browser/navigation_controller.h" |
| 41 #include "content/public/browser/notification_service.h" | 40 #include "content/public/browser/notification_service.h" |
| 42 #include "content/public/browser/render_widget_host_view.h" | 41 #include "content/public/browser/render_widget_host_view.h" |
| 43 #include "content/public/browser/web_contents.h" | 42 #include "content/public/browser/web_contents.h" |
| 44 | 43 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 59 RenderWidgetHostView* render_widget_host_view = | 58 RenderWidgetHostView* render_widget_host_view = |
| 60 web_contents->GetRenderWidgetHostView(); | 59 web_contents->GetRenderWidgetHostView(); |
| 61 if (render_widget_host_view) | 60 if (render_widget_host_view) |
| 62 return render_widget_host_view->GetRenderWidgetHost(); | 61 return render_widget_host_view->GetRenderWidgetHost(); |
| 63 } | 62 } |
| 64 return NULL; | 63 return NULL; |
| 65 } | 64 } |
| 66 | 65 |
| 67 const std::string GetTabUrl(RenderWidgetHost* rwh) { | 66 const std::string GetTabUrl(RenderWidgetHost* rwh) { |
| 68 RenderWidgetHostView* rwhv = rwh->GetView(); | 67 RenderWidgetHostView* rwhv = rwh->GetView(); |
| 69 for (chrome::BrowserIterator it; !it.done(); it.Next()) { | 68 for (auto& browser : *BrowserList::GetInstance()) { |
| 70 Browser* browser = *it; | |
| 71 for (int i = 0, tab_count = browser->tab_strip_model()->count(); | 69 for (int i = 0, tab_count = browser->tab_strip_model()->count(); |
| 72 i < tab_count; | 70 i < tab_count; |
| 73 ++i) { | 71 ++i) { |
| 74 WebContents* tab = browser->tab_strip_model()->GetWebContentsAt(i); | 72 WebContents* tab = browser->tab_strip_model()->GetWebContentsAt(i); |
| 75 if (tab->GetRenderWidgetHostView() == rwhv) { | 73 if (tab->GetRenderWidgetHostView() == rwhv) { |
| 76 return tab->GetLastCommittedURL().spec(); | 74 return tab->GetLastCommittedURL().spec(); |
| 77 } | 75 } |
| 78 } | 76 } |
| 79 } | 77 } |
| 80 return std::string(); | 78 return std::string(); |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 GetRenderWidgetHost(&web_contents->GetController()); | 523 GetRenderWidgetHost(&web_contents->GetController()); |
| 526 render_widget_hosts_loading_.erase(render_widget_host); | 524 render_widget_hosts_loading_.erase(render_widget_host); |
| 527 break; | 525 break; |
| 528 } | 526 } |
| 529 default: | 527 default: |
| 530 break; | 528 break; |
| 531 } | 529 } |
| 532 } | 530 } |
| 533 | 531 |
| 534 } // namespace chromeos | 532 } // namespace chromeos |
| OLD | NEW |