OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "chrome/browser/ui/browser_list.h" | 26 #include "chrome/browser/ui/browser_list.h" |
27 #include "chrome/browser/ui/browser_navigator.h" | 27 #include "chrome/browser/ui/browser_navigator.h" |
28 #include "chrome/browser/ui/browser_window.h" | 28 #include "chrome/browser/ui/browser_window.h" |
29 #include "chrome/common/chrome_notification_types.h" | 29 #include "chrome/common/chrome_notification_types.h" |
30 #include "content/browser/renderer_host/render_widget_host.h" | 30 #include "content/browser/renderer_host/render_widget_host.h" |
31 #include "content/browser/renderer_host/render_widget_host_view.h" | 31 #include "content/browser/renderer_host/render_widget_host_view.h" |
32 #include "content/browser/tab_contents/navigation_controller.h" | 32 #include "content/browser/tab_contents/navigation_controller.h" |
33 #include "content/browser/tab_contents/tab_contents.h" | 33 #include "content/browser/tab_contents/tab_contents.h" |
34 #include "content/browser/tab_contents/tab_contents_view.h" | 34 #include "content/browser/tab_contents/tab_contents_view.h" |
35 #include "content/public/browser/notification_registrar.h" | 35 #include "content/public/browser/notification_registrar.h" |
36 #include "content/common/notification_service.h" | 36 #include "content/public/browser/notification_service.h" |
37 #include "net/base/network_change_notifier.h" | 37 #include "net/base/network_change_notifier.h" |
38 | 38 |
39 #if defined(OS_CHROMEOS) | 39 #if defined(OS_CHROMEOS) |
40 #include "chrome/browser/chromeos/boot_times_loader.h" | 40 #include "chrome/browser/chromeos/boot_times_loader.h" |
41 #endif | 41 #endif |
42 | 42 |
43 // Are we in the process of restoring? | 43 // Are we in the process of restoring? |
44 static bool restoring = false; | 44 static bool restoring = false; |
45 | 45 |
46 namespace { | 46 namespace { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 tabs_loading_.end()); | 177 tabs_loading_.end()); |
178 tabs_loading_.insert(controller); | 178 tabs_loading_.insert(controller); |
179 RenderWidgetHost* render_widget_host = GetRenderWidgetHost(controller); | 179 RenderWidgetHost* render_widget_host = GetRenderWidgetHost(controller); |
180 DCHECK(render_widget_host); | 180 DCHECK(render_widget_host); |
181 render_widget_hosts_loading_.insert(render_widget_host); | 181 render_widget_hosts_loading_.insert(render_widget_host); |
182 RegisterForNotifications(controller); | 182 RegisterForNotifications(controller); |
183 } | 183 } |
184 | 184 |
185 void TabLoader::StartLoading() { | 185 void TabLoader::StartLoading() { |
186 registrar_.Add(this, content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT, | 186 registrar_.Add(this, content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT, |
187 NotificationService::AllSources()); | 187 content::NotificationService::AllSources()); |
188 #if defined(OS_CHROMEOS) | 188 #if defined(OS_CHROMEOS) |
189 if (!net::NetworkChangeNotifier::IsOffline()) { | 189 if (!net::NetworkChangeNotifier::IsOffline()) { |
190 loading_ = true; | 190 loading_ = true; |
191 LoadNextTab(); | 191 LoadNextTab(); |
192 } else { | 192 } else { |
193 net::NetworkChangeNotifier::AddOnlineStateObserver(this); | 193 net::NetworkChangeNotifier::AddOnlineStateObserver(this); |
194 } | 194 } |
195 #else | 195 #else |
196 loading_ = true; | 196 loading_ = true; |
197 LoadNextTab(); | 197 LoadNextTab(); |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 std::vector<GURL> gurls; | 860 std::vector<GURL> gurls; |
861 SessionRestoreImpl restorer(profile, | 861 SessionRestoreImpl restorer(profile, |
862 static_cast<Browser*>(NULL), true, false, true, gurls); | 862 static_cast<Browser*>(NULL), true, false, true, gurls); |
863 restorer.RestoreForeignTab(tab); | 863 restorer.RestoreForeignTab(tab); |
864 } | 864 } |
865 | 865 |
866 // static | 866 // static |
867 bool SessionRestore::IsRestoring() { | 867 bool SessionRestore::IsRestoring() { |
868 return restoring; | 868 return restoring; |
869 } | 869 } |
OLD | NEW |