OLD | NEW |
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_WEBUI_OPTIONS2_BROWSER_OPTIONS_HANDLER2_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_BROWSER_OPTIONS_HANDLER2_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_BROWSER_OPTIONS_HANDLER2_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_BROWSER_OPTIONS_HANDLER2_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" | 12 #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" |
| 13 #include "chrome/browser/prefs/pref_change_registrar.h" |
13 #include "chrome/browser/prefs/pref_member.h" | 14 #include "chrome/browser/prefs/pref_member.h" |
14 #include "chrome/browser/search_engines/template_url_service_observer.h" | 15 #include "chrome/browser/search_engines/template_url_service_observer.h" |
15 #include "chrome/browser/shell_integration.h" | 16 #include "chrome/browser/shell_integration.h" |
16 #include "chrome/browser/sync/profile_sync_service_observer.h" | 17 #include "chrome/browser/sync/profile_sync_service_observer.h" |
17 #include "chrome/browser/ui/webui/options2/options_ui2.h" | 18 #include "chrome/browser/ui/webui/options2/options_ui2.h" |
18 #include "ui/base/models/table_model_observer.h" | 19 #include "ui/base/models/table_model_observer.h" |
19 | 20 |
20 class AutocompleteController; | 21 class AutocompleteController; |
21 class CustomHomePagesTableModel; | 22 class CustomHomePagesTableModel; |
22 class TemplateURLService; | 23 class TemplateURLService; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // Returns the string ID for the given default browser state. | 96 // Returns the string ID for the given default browser state. |
96 int StatusStringIdForState(ShellIntegration::DefaultWebClientState state); | 97 int StatusStringIdForState(ShellIntegration::DefaultWebClientState state); |
97 | 98 |
98 // Gets the current default browser state, and asynchronously reports it to | 99 // Gets the current default browser state, and asynchronously reports it to |
99 // the WebUI page. | 100 // the WebUI page. |
100 void UpdateDefaultBrowserState(); | 101 void UpdateDefaultBrowserState(); |
101 | 102 |
102 // Updates the UI with the given state for the default browser. | 103 // Updates the UI with the given state for the default browser. |
103 void SetDefaultBrowserUIString(int status_string_id); | 104 void SetDefaultBrowserUIString(int status_string_id); |
104 | 105 |
| 106 // Updates the label of the 'Show Home page'. |
| 107 void UpdateHomePageLabel() const; |
| 108 |
105 // Loads the possible default search engine list and reports it to the WebUI. | 109 // Loads the possible default search engine list and reports it to the WebUI. |
106 void UpdateSearchEngines(); | 110 void UpdateSearchEngines(); |
107 | 111 |
108 // Sends an array of Profile objects to javascript. | 112 // Sends an array of Profile objects to javascript. |
109 // Each object is of the form: | 113 // Each object is of the form: |
110 // profileInfo = { | 114 // profileInfo = { |
111 // name: "Profile Name", | 115 // name: "Profile Name", |
112 // iconURL: "chrome://path/to/icon/image", | 116 // iconURL: "chrome://path/to/icon/image", |
113 // filePath: "/path/to/profile/data/on/disk", | 117 // filePath: "/path/to/profile/data/on/disk", |
114 // isCurrentProfile: false | 118 // isCurrentProfile: false |
(...skipping 18 matching lines...) Expand all Loading... |
133 void IncreaseScreenBrightnessCallback(const base::ListValue* args); | 137 void IncreaseScreenBrightnessCallback(const base::ListValue* args); |
134 | 138 |
135 void UpdateAccountPicture(); | 139 void UpdateAccountPicture(); |
136 #endif | 140 #endif |
137 | 141 |
138 scoped_refptr<ShellIntegration::DefaultBrowserWorker> default_browser_worker_; | 142 scoped_refptr<ShellIntegration::DefaultBrowserWorker> default_browser_worker_; |
139 | 143 |
140 StringPrefMember homepage_; | 144 StringPrefMember homepage_; |
141 BooleanPrefMember default_browser_policy_; | 145 BooleanPrefMember default_browser_policy_; |
142 | 146 |
| 147 // Used to observe updates to the preference of the list of URLs to load |
| 148 // on startup, which can be updated via sync. |
| 149 PrefChangeRegistrar pref_change_registrar_; |
| 150 |
143 TemplateURLService* template_url_service_; // Weak. | 151 TemplateURLService* template_url_service_; // Weak. |
144 | 152 |
145 scoped_ptr<AutocompleteController> autocomplete_controller_; | 153 scoped_ptr<AutocompleteController> autocomplete_controller_; |
146 | 154 |
147 // Used to get |weak_ptr_| to self for use on the File thread. | 155 // Used to get |weak_ptr_| to self for use on the File thread. |
148 base::WeakPtrFactory<BrowserOptionsHandler> weak_ptr_factory_for_file_; | 156 base::WeakPtrFactory<BrowserOptionsHandler> weak_ptr_factory_for_file_; |
149 // Used to post update tasks to the UI thread. | 157 // Used to post update tasks to the UI thread. |
150 base::WeakPtrFactory<BrowserOptionsHandler> weak_ptr_factory_for_ui_; | 158 base::WeakPtrFactory<BrowserOptionsHandler> weak_ptr_factory_for_ui_; |
151 | 159 |
152 // True if the multiprofiles switch is enabled. | 160 // True if the multiprofiles switch is enabled. |
153 bool multiprofile_; | 161 bool multiprofile_; |
154 | 162 |
155 DISALLOW_COPY_AND_ASSIGN(BrowserOptionsHandler); | 163 DISALLOW_COPY_AND_ASSIGN(BrowserOptionsHandler); |
156 }; | 164 }; |
157 | 165 |
158 } // namespace options2 | 166 } // namespace options2 |
159 | 167 |
160 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_BROWSER_OPTIONS_HANDLER2_H_ | 168 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_BROWSER_OPTIONS_HANDLER2_H_ |
OLD | NEW |