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

Side by Side Diff: chrome/browser/autocomplete/shortcuts_backend_factory.cc

Issue 2787713002: Remove deprecated extension notification from shortcuts_extensions_manager.h/cc (Closed)
Patch Set: review Created 3 years, 8 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
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/autocomplete/shortcuts_extensions_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" 5 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "chrome/browser/autocomplete/shortcuts_extensions_manager.h"
11 #include "chrome/browser/history/history_service_factory.h" 10 #include "chrome/browser/history/history_service_factory.h"
12 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/search_engines/template_url_service_factory.h" 12 #include "chrome/browser/search_engines/template_url_service_factory.h"
14 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" 13 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
15 #include "components/keyed_service/content/browser_context_dependency_manager.h" 14 #include "components/keyed_service/content/browser_context_dependency_manager.h"
16 #include "components/omnibox/browser/shortcuts_backend.h" 15 #include "components/omnibox/browser/shortcuts_backend.h"
17 #include "components/omnibox/browser/shortcuts_constants.h" 16 #include "components/omnibox/browser/shortcuts_constants.h"
18 #include "components/prefs/pref_service.h" 17 #include "components/prefs/pref_service.h"
19 #include "content/public/browser/browser_thread.h" 18 #include "content/public/browser/browser_thread.h"
20 #include "extensions/features/features.h" 19 #include "extensions/features/features.h"
21 20
21 #if BUILDFLAG(ENABLE_EXTENSIONS)
22 #include "chrome/browser/autocomplete/shortcuts_extensions_manager.h"
23
22 namespace { 24 namespace {
23 #if BUILDFLAG(ENABLE_EXTENSIONS)
24 const char kShortcutsExtensionsManagerKey[] = "ShortcutsExtensionsManager"; 25 const char kShortcutsExtensionsManagerKey[] = "ShortcutsExtensionsManager";
26 }
25 #endif 27 #endif
26 }
27 28
28 // static 29 // static
29 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfile( 30 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfile(
30 Profile* profile) { 31 Profile* profile) {
31 return static_cast<ShortcutsBackend*>( 32 return static_cast<ShortcutsBackend*>(
32 GetInstance()->GetServiceForBrowserContext(profile, true).get()); 33 GetInstance()->GetServiceForBrowserContext(profile, true).get());
33 } 34 }
34 35
35 // static 36 // static
36 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfileIfExists( 37 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfileIfExists(
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 content::BrowserThread::GetTaskRunnerForThread( 100 content::BrowserThread::GetTaskRunnerForThread(
100 content::BrowserThread::DB), 101 content::BrowserThread::DB),
101 profile->GetPath().Append(kShortcutsDatabaseName), suppress_db)); 102 profile->GetPath().Append(kShortcutsDatabaseName), suppress_db));
102 #if BUILDFLAG(ENABLE_EXTENSIONS) 103 #if BUILDFLAG(ENABLE_EXTENSIONS)
103 ShortcutsExtensionsManager* extensions_manager = 104 ShortcutsExtensionsManager* extensions_manager =
104 new ShortcutsExtensionsManager(profile); 105 new ShortcutsExtensionsManager(profile);
105 profile->SetUserData(kShortcutsExtensionsManagerKey, extensions_manager); 106 profile->SetUserData(kShortcutsExtensionsManagerKey, extensions_manager);
106 #endif 107 #endif
107 return backend->Init() ? backend : nullptr; 108 return backend->Init() ? backend : nullptr;
108 } 109 }
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/autocomplete/shortcuts_extensions_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698