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

Unified Diff: chrome/browser/win/jumplist_factory.cc

Issue 2323603002: Convert JumpList to a KeyedService. (Closed)
Patch Set: Remove notification observer and force destruction on UI thread Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/win/jumplist_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/win/jumplist_factory.cc
diff --git a/chrome/browser/win/jumplist_factory.cc b/chrome/browser/win/jumplist_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..33190603c9cd79b1d60e09e8df34603d51c4920b
--- /dev/null
+++ b/chrome/browser/win/jumplist_factory.cc
@@ -0,0 +1,30 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/win/jumplist_factory.h"
sky 2016/09/08 23:48:08 Style guide says this should be your first include
Ilya Kulshin 2016/09/13 00:01:00 Done.
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+// static
+scoped_refptr<JumpList> JumpListFactory::GetForProfile(Profile* profile) {
+ return static_cast<JumpList*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true).get());
+}
+
+// static
+JumpListFactory* JumpListFactory::GetInstance() {
+ return base::Singleton<JumpListFactory>::get();
+}
+
+JumpListFactory::JumpListFactory()
+ : RefcountedBrowserContextKeyedServiceFactory(
+ "JumpList",
+ BrowserContextDependencyManager::GetInstance()) {}
+
+JumpListFactory::~JumpListFactory() = default;
+
+scoped_refptr<RefcountedKeyedService> JumpListFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ return new JumpList(static_cast<Profile*>(context));
+}
« no previous file with comments | « chrome/browser/win/jumplist_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698