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

Side by Side Diff: chrome/browser/ui/search_engines/keyword_editor_controller.cc

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Fix Clang build and fix bug shown by trybots. Created 7 years, 10 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
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/ui/search_engines/keyword_editor_controller.h" 5 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/prefs/pref_registry_simple.h"
8 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
Mattias Nissler (ping if slow) 2013/01/31 14:50:45 required?
Jói 2013/01/31 16:23:37 Done.
9 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/search_engines/template_url.h" 11 #include "chrome/browser/search_engines/template_url.h"
11 #include "chrome/browser/search_engines/template_url_service.h" 12 #include "chrome/browser/search_engines/template_url_service.h"
12 #include "chrome/browser/search_engines/template_url_service_factory.h" 13 #include "chrome/browser/search_engines/template_url_service_factory.h"
13 #include "chrome/browser/ui/search_engines/template_url_table_model.h" 14 #include "chrome/browser/ui/search_engines/template_url_table_model.h"
14 #include "chrome/common/pref_names.h" 15 #include "chrome/common/pref_names.h"
15 #include "content/public/browser/user_metrics.h" 16 #include "content/public/browser/user_metrics.h"
16 17
17 using content::UserMetricsAction; 18 using content::UserMetricsAction;
18 19
19 KeywordEditorController::KeywordEditorController(Profile* profile) 20 KeywordEditorController::KeywordEditorController(Profile* profile)
20 : profile_(profile) { 21 : profile_(profile) {
21 table_model_.reset(new TemplateURLTableModel( 22 table_model_.reset(new TemplateURLTableModel(
22 TemplateURLServiceFactory::GetForProfile(profile))); 23 TemplateURLServiceFactory::GetForProfile(profile)));
23 } 24 }
24 25
25 KeywordEditorController::~KeywordEditorController() { 26 KeywordEditorController::~KeywordEditorController() {
26 } 27 }
27 28
28 // static 29 // static
29 // TODO(rsesek): Other platforms besides Mac should remember window 30 // TODO(rsesek): Other platforms besides Mac should remember window
30 // placement. http://crbug.com/22269 31 // placement. http://crbug.com/22269
31 void KeywordEditorController::RegisterPrefs(PrefServiceSimple* prefs) { 32 void KeywordEditorController::RegisterPrefs(PrefRegistrySimple* registry) {
32 prefs->RegisterDictionaryPref(prefs::kKeywordEditorWindowPlacement); 33 registry->RegisterDictionaryPref(prefs::kKeywordEditorWindowPlacement);
33 } 34 }
34 35
35 int KeywordEditorController::AddTemplateURL(const string16& title, 36 int KeywordEditorController::AddTemplateURL(const string16& title,
36 const string16& keyword, 37 const string16& keyword,
37 const std::string& url) { 38 const std::string& url) {
38 DCHECK(!url.empty()); 39 DCHECK(!url.empty());
39 40
40 content::RecordAction(UserMetricsAction("KeywordEditor_AddKeyword")); 41 content::RecordAction(UserMetricsAction("KeywordEditor_AddKeyword"));
41 42
42 // There's a bug (1090726) in TableView with groups enabled such that newly 43 // There's a bug (1090726) in TableView with groups enabled such that newly
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return url_model()->loaded(); 99 return url_model()->loaded();
99 } 100 }
100 101
101 TemplateURL* KeywordEditorController::GetTemplateURL(int index) { 102 TemplateURL* KeywordEditorController::GetTemplateURL(int index) {
102 return table_model_->GetTemplateURL(index); 103 return table_model_->GetTemplateURL(index);
103 } 104 }
104 105
105 TemplateURLService* KeywordEditorController::url_model() const { 106 TemplateURLService* KeywordEditorController::url_model() const {
106 return table_model_->template_url_service(); 107 return table_model_->template_url_service();
107 } 108 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698