| 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/extensions/api/web_navigation/web_navigation_api_consta
nts.h" | 10 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api_consta
nts.h" |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 void WebNavigationAPI::Shutdown() { | 761 void WebNavigationAPI::Shutdown() { |
| 762 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 762 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
| 763 } | 763 } |
| 764 | 764 |
| 765 void WebNavigationAPI::OnListenerAdded( | 765 void WebNavigationAPI::OnListenerAdded( |
| 766 const extensions::EventListenerInfo& details) { | 766 const extensions::EventListenerInfo& details) { |
| 767 web_navigation_event_router_.reset(new WebNavigationEventRouter(profile_)); | 767 web_navigation_event_router_.reset(new WebNavigationEventRouter(profile_)); |
| 768 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 768 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
| 769 } | 769 } |
| 770 | 770 |
| 771 static base::LazyInstance<ProfileKeyedAPIFactory<WebNavigationAPI> > |
| 772 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 773 |
| 774 template <> |
| 775 ProfileKeyedAPIFactory<WebNavigationAPI>* |
| 776 ProfileKeyedAPIFactory<WebNavigationAPI>::GetInstance() { |
| 777 return &g_factory.Get(); |
| 778 } |
| 779 |
| 771 } // namespace extensions | 780 } // namespace extensions |
| OLD | NEW |