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_OPTIONS_OPTIONS_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_OPTIONS_UI_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_OPTIONS_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_OPTIONS_UI_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <string> | 11 #include <string> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/callback_list.h" | 14 #include "base/callback_list.h" |
14 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
15 #include "base/macros.h" | 16 #include "base/macros.h" |
16 #include "base/memory/scoped_ptr.h" | |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
20 #include "content/public/browser/web_contents_observer.h" | 20 #include "content/public/browser/web_contents_observer.h" |
21 #include "content/public/browser/web_ui_controller.h" | 21 #include "content/public/browser/web_ui_controller.h" |
22 #include "content/public/browser/web_ui_message_handler.h" | 22 #include "content/public/browser/web_ui_message_handler.h" |
23 #include "ui/base/layout.h" | 23 #include "ui/base/layout.h" |
24 | 24 |
25 class AutocompleteResult; | 25 class AutocompleteResult; |
26 | 26 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 public content::WebContentsObserver, | 117 public content::WebContentsObserver, |
118 public OptionsPageUIHandlerHost { | 118 public OptionsPageUIHandlerHost { |
119 public: | 119 public: |
120 typedef base::CallbackList<void()> OnFinishedLoadingCallbackList; | 120 typedef base::CallbackList<void()> OnFinishedLoadingCallbackList; |
121 | 121 |
122 explicit OptionsUI(content::WebUI* web_ui); | 122 explicit OptionsUI(content::WebUI* web_ui); |
123 ~OptionsUI() override; | 123 ~OptionsUI() override; |
124 | 124 |
125 // Registers a callback to be called once the settings frame has finished | 125 // Registers a callback to be called once the settings frame has finished |
126 // loading on the HTML/JS side. | 126 // loading on the HTML/JS side. |
127 scoped_ptr<OnFinishedLoadingCallbackList::Subscription> | 127 std::unique_ptr<OnFinishedLoadingCallbackList::Subscription> |
128 RegisterOnFinishedLoadingCallback(const base::Closure& callback); | 128 RegisterOnFinishedLoadingCallback(const base::Closure& callback); |
129 | 129 |
130 // Takes the suggestions from |result| and adds them to |suggestions| so that | 130 // Takes the suggestions from |result| and adds them to |suggestions| so that |
131 // they can be passed to a JavaScript function. | 131 // they can be passed to a JavaScript function. |
132 static void ProcessAutocompleteSuggestions( | 132 static void ProcessAutocompleteSuggestions( |
133 const AutocompleteResult& result, | 133 const AutocompleteResult& result, |
134 base::ListValue* const suggestions); | 134 base::ListValue* const suggestions); |
135 | 135 |
136 static base::RefCountedMemory* GetFaviconResourceBytes( | 136 static base::RefCountedMemory* GetFaviconResourceBytes( |
137 ui::ScaleFactor scale_factor); | 137 ui::ScaleFactor scale_factor); |
138 | 138 |
(...skipping 15 matching lines...) Expand all Loading... |
154 // Adds OptionsPageUiHandler to the handlers list if handler is enabled. | 154 // Adds OptionsPageUiHandler to the handlers list if handler is enabled. |
155 void AddOptionsPageUIHandler(base::DictionaryValue* localized_strings, | 155 void AddOptionsPageUIHandler(base::DictionaryValue* localized_strings, |
156 OptionsPageUIHandler* handler); | 156 OptionsPageUIHandler* handler); |
157 | 157 |
158 bool initialized_handlers_; | 158 bool initialized_handlers_; |
159 | 159 |
160 std::vector<OptionsPageUIHandler*> handlers_; | 160 std::vector<OptionsPageUIHandler*> handlers_; |
161 OnFinishedLoadingCallbackList on_finished_loading_callbacks_; | 161 OnFinishedLoadingCallbackList on_finished_loading_callbacks_; |
162 | 162 |
163 #if defined(OS_CHROMEOS) | 163 #if defined(OS_CHROMEOS) |
164 scoped_ptr<chromeos::system::PointerDeviceObserver> | 164 std::unique_ptr<chromeos::system::PointerDeviceObserver> |
165 pointer_device_observer_; | 165 pointer_device_observer_; |
166 #endif | 166 #endif |
167 | 167 |
168 base::Time load_start_time_; | 168 base::Time load_start_time_; |
169 | 169 |
170 DISALLOW_COPY_AND_ASSIGN(OptionsUI); | 170 DISALLOW_COPY_AND_ASSIGN(OptionsUI); |
171 }; | 171 }; |
172 | 172 |
173 } // namespace options | 173 } // namespace options |
174 | 174 |
175 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_OPTIONS_UI_H_ | 175 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_OPTIONS_UI_H_ |
OLD | NEW |