| 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/sessions/session_restore.h" | 5 #include "chrome/browser/sessions/session_restore.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <malloc.h> | 8 #include <malloc.h> |
| 9 #else | 9 #else |
| 10 #include <alloca.h> | 10 #include <alloca.h> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "chrome/browser/sessions/session_service.h" | 31 #include "chrome/browser/sessions/session_service.h" |
| 32 #include "chrome/browser/sessions/session_service_factory.h" | 32 #include "chrome/browser/sessions/session_service_factory.h" |
| 33 #include "chrome/browser/sessions/session_types.h" | 33 #include "chrome/browser/sessions/session_types.h" |
| 34 #include "chrome/browser/tabs/tab_strip_model.h" | 34 #include "chrome/browser/tabs/tab_strip_model.h" |
| 35 #include "chrome/browser/ui/browser.h" | 35 #include "chrome/browser/ui/browser.h" |
| 36 #include "chrome/browser/ui/browser_list.h" | 36 #include "chrome/browser/ui/browser_list.h" |
| 37 #include "chrome/browser/ui/browser_navigator.h" | 37 #include "chrome/browser/ui/browser_navigator.h" |
| 38 #include "chrome/browser/ui/browser_window.h" | 38 #include "chrome/browser/ui/browser_window.h" |
| 39 #include "chrome/common/chrome_notification_types.h" | 39 #include "chrome/common/chrome_notification_types.h" |
| 40 #include "content/browser/renderer_host/render_widget_host.h" | 40 #include "content/browser/renderer_host/render_widget_host.h" |
| 41 #include "content/browser/renderer_host/render_widget_host_view.h" | |
| 42 #include "content/public/browser/child_process_security_policy.h" | 41 #include "content/public/browser/child_process_security_policy.h" |
| 43 #include "content/public/browser/navigation_controller.h" | 42 #include "content/public/browser/navigation_controller.h" |
| 44 #include "content/public/browser/notification_registrar.h" | 43 #include "content/public/browser/notification_registrar.h" |
| 45 #include "content/public/browser/notification_service.h" | 44 #include "content/public/browser/notification_service.h" |
| 46 #include "content/public/browser/render_process_host.h" | 45 #include "content/public/browser/render_process_host.h" |
| 46 #include "content/public/browser/render_widget_host_view.h" |
| 47 #include "content/public/browser/web_contents.h" | 47 #include "content/public/browser/web_contents.h" |
| 48 #include "content/public/browser/web_contents_view.h" | 48 #include "content/public/browser/web_contents_view.h" |
| 49 #include "net/base/network_change_notifier.h" | 49 #include "net/base/network_change_notifier.h" |
| 50 #include "webkit/glue/glue_serialize.h" | 50 #include "webkit/glue/glue_serialize.h" |
| 51 | 51 |
| 52 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
| 53 #include "chrome/browser/chromeos/boot_times_loader.h" | 53 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 using content::NavigationController; | 56 using content::NavigationController; |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 } | 360 } |
| 361 | 361 |
| 362 void TabLoader::ForceLoadTimerFired() { | 362 void TabLoader::ForceLoadTimerFired() { |
| 363 force_load_delay_ *= 2; | 363 force_load_delay_ *= 2; |
| 364 LoadNextTab(); | 364 LoadNextTab(); |
| 365 } | 365 } |
| 366 | 366 |
| 367 RenderWidgetHost* TabLoader::GetRenderWidgetHost(NavigationController* tab) { | 367 RenderWidgetHost* TabLoader::GetRenderWidgetHost(NavigationController* tab) { |
| 368 WebContents* web_contents = tab->GetWebContents(); | 368 WebContents* web_contents = tab->GetWebContents(); |
| 369 if (web_contents) { | 369 if (web_contents) { |
| 370 RenderWidgetHostView* render_widget_host_view = | 370 content::RenderWidgetHostView* render_widget_host_view = |
| 371 web_contents->GetRenderWidgetHostView(); | 371 web_contents->GetRenderWidgetHostView(); |
| 372 if (render_widget_host_view) | 372 if (render_widget_host_view) |
| 373 return render_widget_host_view->GetRenderWidgetHost(); | 373 return render_widget_host_view->GetRenderWidgetHost(); |
| 374 } | 374 } |
| 375 return NULL; | 375 return NULL; |
| 376 } | 376 } |
| 377 | 377 |
| 378 void TabLoader::RegisterForNotifications(NavigationController* controller) { | 378 void TabLoader::RegisterForNotifications(NavigationController* controller) { |
| 379 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 379 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 380 content::Source<WebContents>(controller->GetWebContents())); | 380 content::Source<WebContents>(controller->GetWebContents())); |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 if (active_session_restorers == NULL) | 976 if (active_session_restorers == NULL) |
| 977 return false; | 977 return false; |
| 978 for (std::set<SessionRestoreImpl*>::const_iterator it = | 978 for (std::set<SessionRestoreImpl*>::const_iterator it = |
| 979 active_session_restorers->begin(); | 979 active_session_restorers->begin(); |
| 980 it != active_session_restorers->end(); ++it) { | 980 it != active_session_restorers->end(); ++it) { |
| 981 if ((*it)->profile() == profile) | 981 if ((*it)->profile() == profile) |
| 982 return true; | 982 return true; |
| 983 } | 983 } |
| 984 return false; | 984 return false; |
| 985 } | 985 } |
| OLD | NEW |