OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_BROWSER_OPTIONS_HANDLER_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 "chrome/browser/autocomplete/autocomplete_controller_delegate.h" | 12 #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" |
12 #include "chrome/browser/prefs/pref_change_registrar.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/ui/webui/options/options_ui.h" | 17 #include "chrome/browser/ui/webui/options/options_ui.h" |
17 #include "ui/base/models/table_model_observer.h" | 18 #include "ui/base/models/table_model_observer.h" |
18 | 19 |
19 class AutocompleteController; | 20 class AutocompleteController; |
20 class CustomHomePagesTableModel; | 21 class CustomHomePagesTableModel; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 void DragDropStartupPage(const ListValue* args); | 83 void DragDropStartupPage(const ListValue* args); |
83 | 84 |
84 // Gets autocomplete suggestions asychronously for the given string. | 85 // Gets autocomplete suggestions asychronously for the given string. |
85 // Called from WebUI. | 86 // Called from WebUI. |
86 void RequestAutocompleteSuggestions(const ListValue* args); | 87 void RequestAutocompleteSuggestions(const ListValue* args); |
87 | 88 |
88 // Enables/disables Instant. | 89 // Enables/disables Instant. |
89 void EnableInstant(const ListValue* args); | 90 void EnableInstant(const ListValue* args); |
90 void DisableInstant(const ListValue* args); | 91 void DisableInstant(const ListValue* args); |
91 | 92 |
93 // Enables/disables auto-launching of Chrome on computer startup. | |
94 void ToggleAutoLaunch(const ListValue* args); | |
95 | |
96 // Checks (on the file thread) whether the user is in the auto-launch trial | |
97 // and whether Chrome is set to auto-launch at login. Gets a reply on the UI | |
98 // thread (see CheckAutoLaunchCallback). | |
99 void CheckAutoLaunch(base::WeakPtr<BrowserOptionsHandler> weak_this); | |
Jói
2011/12/14 16:44:13
I would add a comment saying a weak pointer to thi
| |
100 // Sets up (on the UI thread) the necessary bindings for toggling auto-launch | |
Jói
2011/12/14 16:44:13
Suggest a blank line before this.
| |
101 // (if the user is part of the auto-launch and makes sure the HTML UI knows | |
102 // whether Chrome will auto-launch at login. | |
103 void CheckAutoLaunchCallback(bool is_in_auto_launch_group, | |
104 bool will_launch_at_login); | |
105 | |
92 // Called to request information about the Instant field trial. | 106 // Called to request information about the Instant field trial. |
93 void GetInstantFieldTrialStatus(const ListValue* args); | 107 void GetInstantFieldTrialStatus(const ListValue* args); |
94 | 108 |
95 // Returns the string ID for the given default browser state. | 109 // Returns the string ID for the given default browser state. |
96 int StatusStringIdForState(ShellIntegration::DefaultWebClientState state); | 110 int StatusStringIdForState(ShellIntegration::DefaultWebClientState state); |
97 | 111 |
98 // Gets the current default browser state, and asynchronously reports it to | 112 // Gets the current default browser state, and asynchronously reports it to |
99 // the WebUI page. | 113 // the WebUI page. |
100 void UpdateDefaultBrowserState(); | 114 void UpdateDefaultBrowserState(); |
101 | 115 |
(...skipping 21 matching lines...) Expand all Loading... | |
123 | 137 |
124 TemplateURLService* template_url_service_; // Weak. | 138 TemplateURLService* template_url_service_; // Weak. |
125 | 139 |
126 // TODO(stuartmorgan): Once there are no other clients of | 140 // TODO(stuartmorgan): Once there are no other clients of |
127 // CustomHomePagesTableModel, consider changing it to something more like | 141 // CustomHomePagesTableModel, consider changing it to something more like |
128 // TemplateURLService. | 142 // TemplateURLService. |
129 scoped_ptr<CustomHomePagesTableModel> startup_custom_pages_table_model_; | 143 scoped_ptr<CustomHomePagesTableModel> startup_custom_pages_table_model_; |
130 | 144 |
131 scoped_ptr<AutocompleteController> autocomplete_controller_; | 145 scoped_ptr<AutocompleteController> autocomplete_controller_; |
132 | 146 |
147 // Used to get |weak_ptr_| to self on the File thread. | |
Jói
2011/12/14 16:44:13
to self on the File thread -> to self for use on t
| |
148 base::WeakPtrFactory<BrowserOptionsHandler> weak_ptr_factory_for_file_; | |
149 // Used to post update tasks to the UI thread. | |
150 base::WeakPtrFactory<BrowserOptionsHandler> weak_ptr_factory_for_ui_; | |
151 | |
133 DISALLOW_COPY_AND_ASSIGN(BrowserOptionsHandler); | 152 DISALLOW_COPY_AND_ASSIGN(BrowserOptionsHandler); |
134 }; | 153 }; |
135 | 154 |
136 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ | 155 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ |
OLD | NEW |