| 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 // Implements the Chrome Extensions WebNavigation API. | 5 // Implements the Chrome Extensions WebNavigation API. |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | 7 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 void WebNavigationAPI::Shutdown() { | 826 void WebNavigationAPI::Shutdown() { |
| 827 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 827 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
| 828 } | 828 } |
| 829 | 829 |
| 830 static base::LazyInstance<ProfileKeyedAPIFactory<WebNavigationAPI> > | 830 static base::LazyInstance<ProfileKeyedAPIFactory<WebNavigationAPI> > |
| 831 g_factory = LAZY_INSTANCE_INITIALIZER; | 831 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 832 | 832 |
| 833 // static | 833 // static |
| 834 ProfileKeyedAPIFactory<WebNavigationAPI>* | 834 ProfileKeyedAPIFactory<WebNavigationAPI>* |
| 835 WebNavigationAPI::GetFactoryInstance() { | 835 WebNavigationAPI::GetFactoryInstance() { |
| 836 return &g_factory.Get(); | 836 return g_factory.Pointer(); |
| 837 } | 837 } |
| 838 | 838 |
| 839 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) { | 839 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 840 web_navigation_event_router_.reset(new WebNavigationEventRouter(profile_)); | 840 web_navigation_event_router_.reset(new WebNavigationEventRouter(profile_)); |
| 841 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 841 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
| 842 } | 842 } |
| 843 | 843 |
| 844 #endif // OS_ANDROID | 844 #endif // OS_ANDROID |
| 845 | 845 |
| 846 } // namespace extensions | 846 } // namespace extensions |
| OLD | NEW |