OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/offline/offline_load_service.h" | 5 #include "chrome/browser/chromeos/offline/offline_load_service.h" |
6 | 6 |
| 7 #include "base/ref_counted.h" |
7 #include "base/singleton.h" | 8 #include "base/singleton.h" |
8 #include "base/ref_counted.h" | |
9 #include "chrome/common/notification_service.h" | |
10 #include "chrome/browser/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
| 10 #include "chrome/browser/tab_contents/navigation_controller.h" |
11 #include "chrome/browser/tab_contents/tab_contents.h" | 11 #include "chrome/browser/tab_contents/tab_contents.h" |
12 #include "chrome/browser/tab_contents/tab_util.h" | 12 #include "chrome/browser/tab_contents/tab_util.h" |
13 #include "chrome/browser/tab_contents/navigation_controller.h" | 13 #include "chrome/common/notification_service.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
17 // A utility class that serves a singleton instance of OfflineLoadService. | 17 // A utility class that serves a singleton instance of OfflineLoadService. |
18 // OfflineLoadSerivce itself cannot be a singleton as it implements | 18 // OfflineLoadSerivce itself cannot be a singleton as it implements |
19 // RefCount interface. | 19 // RefCount interface. |
20 class OfflineLoadServiceSingleton { | 20 class OfflineLoadServiceSingleton { |
21 public: | 21 public: |
22 chromeos::OfflineLoadService* offline_load_service() { | 22 chromeos::OfflineLoadService* offline_load_service() { |
23 return offline_load_service_.get(); | 23 return offline_load_service_.get(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 void OfflineLoadService::RegisterNotification( | 96 void OfflineLoadService::RegisterNotification( |
97 NavigationController* navigation_controller) { | 97 NavigationController* navigation_controller) { |
98 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 98 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); |
99 registrar_.Add(this, NotificationType::TAB_CLOSED, | 99 registrar_.Add(this, NotificationType::TAB_CLOSED, |
100 Source<NavigationController>( | 100 Source<NavigationController>( |
101 navigation_controller)); | 101 navigation_controller)); |
102 } | 102 } |
103 | 103 |
104 } // namespace chromeos | 104 } // namespace chromeos |
OLD | NEW |