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

Side by Side Diff: chrome/browser/search_engines/default_search_manager.h

Issue 340553005: Stop depending on TemplateURLService from DefaultSearchManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/search_engines/default_search_manager.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_
6 #define CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ 6 #define CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 ~DefaultSearchManager(); 74 ~DefaultSearchManager();
75 75
76 // Register prefs needed for tracking the default search provider. 76 // Register prefs needed for tracking the default search provider.
77 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 77 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
78 78
79 // Save default search provider pref values into the map provided. 79 // Save default search provider pref values into the map provided.
80 static void AddPrefValueToMap(base::DictionaryValue* value, 80 static void AddPrefValueToMap(base::DictionaryValue* value,
81 PrefValueMap* pref_value_map); 81 PrefValueMap* pref_value_map);
82 82
83 // Testing code can call this with |disabled| set to true to cause
84 // GetDefaultSearchEngine() to return NULL instead of
85 // |fallback_default_search_| in cases where the DSE source is FROM_FALLBACK.
86 static void SetFallbackSearchEnginesDisabledForTesting(bool disabled);
87
83 // Gets a pointer to the current Default Search Engine. If NULL, indicates 88 // Gets a pointer to the current Default Search Engine. If NULL, indicates
84 // that Default Search is explicitly disabled. |source|, if not NULL, will be 89 // that Default Search is explicitly disabled. |source|, if not NULL, will be
85 // filled in with the source of the result. 90 // filled in with the source of the result.
86 TemplateURLData* GetDefaultSearchEngine(Source* source) const; 91 TemplateURLData* GetDefaultSearchEngine(Source* source) const;
87 92
88 // Gets the source of the current Default Search Engine value. 93 // Gets the source of the current Default Search Engine value.
89 Source GetDefaultSearchEngineSource() const; 94 Source GetDefaultSearchEngineSource() const;
90 95
91 // Write default search provider data to |pref_service_|. 96 // Write default search provider data to |pref_service_|.
92 void SetUserSelectedDefaultSearchEngine(const TemplateURLData& data); 97 void SetUserSelectedDefaultSearchEngine(const TemplateURLData& data);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // default search engines. 155 // default search engines.
151 scoped_ptr<TemplateURLData> prefs_default_search_; 156 scoped_ptr<TemplateURLData> prefs_default_search_;
152 157
153 // True if the default search is currently enforced by policy. 158 // True if the default search is currently enforced by policy.
154 bool default_search_controlled_by_policy_; 159 bool default_search_controlled_by_policy_;
155 160
156 DISALLOW_COPY_AND_ASSIGN(DefaultSearchManager); 161 DISALLOW_COPY_AND_ASSIGN(DefaultSearchManager);
157 }; 162 };
158 163
159 #endif // CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ 164 #endif // CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/search_engines/default_search_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698