| 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_loader.h" | 5 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 16 #include "base/message_loop_proxy.h" | 16 #include "base/message_loop_proxy.h" |
| 17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
| 18 #include "base/process_util.h" | 18 #include "base/process_util.h" |
| 19 #include "base/string_number_conversions.h" | 19 #include "base/string_number_conversions.h" |
| 20 #include "base/string_util.h" | 20 #include "base/string_util.h" |
| 21 #include "base/stringprintf.h" | 21 #include "base/stringprintf.h" |
| 22 #include "base/threading/thread.h" | 22 #include "base/threading/thread.h" |
| 23 #include "base/threading/thread_restrictions.h" | 23 #include "base/threading/thread_restrictions.h" |
| 24 #include "base/time.h" | 24 #include "base/time.h" |
| 25 #include "chrome/browser/browser_process.h" | 25 #include "chrome/browser/browser_process.h" |
| 26 #include "chrome/browser/chromeos/login/authentication_notification_details.h" | 26 #include "chrome/browser/chromeos/login/authentication_notification_details.h" |
| 27 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
| 28 #include "chrome/browser/ui/browser_list.h" | 28 #include "chrome/browser/ui/browser_iterator.h" |
| 29 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 29 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 30 #include "chrome/common/chrome_notification_types.h" | 30 #include "chrome/common/chrome_notification_types.h" |
| 31 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
| 32 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
| 33 #include "content/public/browser/navigation_controller.h" | 33 #include "content/public/browser/navigation_controller.h" |
| 34 #include "content/public/browser/notification_service.h" | 34 #include "content/public/browser/notification_service.h" |
| 35 #include "content/public/browser/render_widget_host_view.h" | 35 #include "content/public/browser/render_widget_host_view.h" |
| 36 #include "content/public/browser/web_contents.h" | 36 #include "content/public/browser/web_contents.h" |
| 37 | 37 |
| 38 using content::BrowserThread; | 38 using content::BrowserThread; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 49 RenderWidgetHostView* render_widget_host_view = | 49 RenderWidgetHostView* render_widget_host_view = |
| 50 web_contents->GetRenderWidgetHostView(); | 50 web_contents->GetRenderWidgetHostView(); |
| 51 if (render_widget_host_view) | 51 if (render_widget_host_view) |
| 52 return render_widget_host_view->GetRenderWidgetHost(); | 52 return render_widget_host_view->GetRenderWidgetHost(); |
| 53 } | 53 } |
| 54 return NULL; | 54 return NULL; |
| 55 } | 55 } |
| 56 | 56 |
| 57 const std::string GetTabUrl(RenderWidgetHost* rwh) { | 57 const std::string GetTabUrl(RenderWidgetHost* rwh) { |
| 58 RenderWidgetHostView* rwhv = rwh->GetView(); | 58 RenderWidgetHostView* rwhv = rwh->GetView(); |
| 59 for (BrowserList::const_iterator it = BrowserList::begin(); | 59 for (chrome::BrowserIterator it; !it.done(); it.Next()) { |
| 60 it != BrowserList::end(); | |
| 61 ++it) { | |
| 62 Browser* browser = *it; | 60 Browser* browser = *it; |
| 63 for (int i = 0, tab_count = browser->tab_strip_model()->count(); | 61 for (int i = 0, tab_count = browser->tab_strip_model()->count(); |
| 64 i < tab_count; | 62 i < tab_count; |
| 65 ++i) { | 63 ++i) { |
| 66 WebContents* tab = browser->tab_strip_model()->GetWebContentsAt(i); | 64 WebContents* tab = browser->tab_strip_model()->GetWebContentsAt(i); |
| 67 if (tab->GetRenderWidgetHostView() == rwhv) { | 65 if (tab->GetRenderWidgetHostView() == rwhv) { |
| 68 return tab->GetURL().spec(); | 66 return tab->GetURL().spec(); |
| 69 } | 67 } |
| 70 } | 68 } |
| 71 } | 69 } |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 GetRenderWidgetHost(&web_contents->GetController()); | 533 GetRenderWidgetHost(&web_contents->GetController()); |
| 536 render_widget_hosts_loading_.erase(render_widget_host); | 534 render_widget_hosts_loading_.erase(render_widget_host); |
| 537 break; | 535 break; |
| 538 } | 536 } |
| 539 default: | 537 default: |
| 540 break; | 538 break; |
| 541 } | 539 } |
| 542 } | 540 } |
| 543 | 541 |
| 544 } // namespace chromeos | 542 } // namespace chromeos |
| OLD | NEW |