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

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

Issue 2816383002: Remove non-const version of GetDefaultSearchProvider() and make all callers call the const version (Closed)
Patch Set: Fix unit test (the model was already loaded) 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
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 #ifndef CHROME_BROWSER_UI_SEARCH_ENGINES_KEYWORD_EDITOR_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_SEARCH_ENGINES_KEYWORD_EDITOR_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_SEARCH_ENGINES_KEYWORD_EDITOR_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_SEARCH_ENGINES_KEYWORD_EDITOR_CONTROLLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 30 matching lines...) Expand all
41 // Return true if the given |url| can be made the default. 41 // Return true if the given |url| can be made the default.
42 bool CanMakeDefault(const TemplateURL* url) const; 42 bool CanMakeDefault(const TemplateURL* url) const;
43 43
44 // Return true if the given |url| can be removed. 44 // Return true if the given |url| can be removed.
45 bool CanRemove(const TemplateURL* url) const; 45 bool CanRemove(const TemplateURL* url) const;
46 46
47 // Remove the TemplateURL at the specified index in the TableModel. 47 // Remove the TemplateURL at the specified index in the TableModel.
48 void RemoveTemplateURL(int index); 48 void RemoveTemplateURL(int index);
49 49
50 // Returns the default search provider. 50 // Returns the default search provider.
51 TemplateURL* GetDefaultSearchProvider(); 51 const TemplateURL* GetDefaultSearchProvider();
52 52
53 // Make the TemplateURL at the specified index (into the TableModel) the 53 // Make the TemplateURL at the specified index (into the TableModel) the
54 // default search provider. Return the new index, or -1 if nothing was done. 54 // default search provider. Return the new index, or -1 if nothing was done.
55 int MakeDefaultTemplateURL(int index); 55 int MakeDefaultTemplateURL(int index);
56 56
57 // Return true if the |url_model_| data is loaded. 57 // Return true if the |url_model_| data is loaded.
58 bool loaded() const; 58 bool loaded() const;
59 59
60 // Return the TemplateURL corresponding to the |index| in the model. 60 // Return the TemplateURL corresponding to the |index| in the model.
61 TemplateURL* GetTemplateURL(int index); 61 TemplateURL* GetTemplateURL(int index);
62 62
63 TemplateURLTableModel* table_model() { 63 TemplateURLTableModel* table_model() {
64 return table_model_.get(); 64 return table_model_.get();
65 } 65 }
66 66
67 private: 67 private:
68 TemplateURLService* url_model_; 68 TemplateURLService* url_model_;
69 69
70 // Model for the TableView. 70 // Model for the TableView.
71 std::unique_ptr<TemplateURLTableModel> table_model_; 71 std::unique_ptr<TemplateURLTableModel> table_model_;
72 72
73 DISALLOW_COPY_AND_ASSIGN(KeywordEditorController); 73 DISALLOW_COPY_AND_ASSIGN(KeywordEditorController);
74 }; 74 };
75 75
76 #endif // CHROME_BROWSER_UI_SEARCH_ENGINES_KEYWORD_EDITOR_CONTROLLER_H_ 76 #endif // CHROME_BROWSER_UI_SEARCH_ENGINES_KEYWORD_EDITOR_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698