Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Side by Side Diff: chrome/browser/extensions/api/web_navigation/web_navigation_api.cc

Issue 11719004: Remove Profile-keyed factory boilerplate: cookies, managed_mode & web_navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698