| 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_OPTIONS_UI2_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_OPTIONS_UI2_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_OPTIONS_UI2_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_OPTIONS_UI2_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/values.h" | |
| 15 #include "chrome/browser/autocomplete/autocomplete.h" | |
| 16 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 14 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 17 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
| 19 #include "content/public/browser/notification_types.h" | 17 #include "content/public/browser/notification_types.h" |
| 20 #include "content/public/browser/web_ui_controller.h" | 18 #include "content/public/browser/web_ui_controller.h" |
| 21 #include "content/public/browser/web_ui_message_handler.h" | 19 #include "content/public/browser/web_ui_message_handler.h" |
| 22 | 20 |
| 21 class AutocompleteResult; |
| 22 |
| 23 namespace base { |
| 24 class DictionaryValue; |
| 25 class ListValue; |
| 26 } |
| 27 |
| 23 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
| 24 namespace chromeos { | 29 namespace chromeos { |
| 25 namespace system { | 30 namespace system { |
| 26 class PointerDeviceObserver; | 31 class PointerDeviceObserver; |
| 27 } // namespace system | 32 } // namespace system |
| 28 } // namespace chromeos | 33 } // namespace chromeos |
| 29 #endif | 34 #endif |
| 30 | 35 |
| 31 namespace options2 { | 36 namespace options2 { |
| 32 | 37 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 virtual ~OptionsPageUIHandlerHost() {} | 102 virtual ~OptionsPageUIHandlerHost() {} |
| 98 }; | 103 }; |
| 99 | 104 |
| 100 // The WebUI for chrome:settings-frame. | 105 // The WebUI for chrome:settings-frame. |
| 101 class OptionsUI : public content::WebUIController, | 106 class OptionsUI : public content::WebUIController, |
| 102 public OptionsPageUIHandlerHost { | 107 public OptionsPageUIHandlerHost { |
| 103 public: | 108 public: |
| 104 explicit OptionsUI(content::WebUI* web_ui); | 109 explicit OptionsUI(content::WebUI* web_ui); |
| 105 virtual ~OptionsUI(); | 110 virtual ~OptionsUI(); |
| 106 | 111 |
| 107 // Takes the suggestions from |autocompleteResult| and adds them to | 112 // Takes the suggestions from |result| and adds them to |suggestions| so that |
| 108 // |suggestions| so that they can be passed to a JavaScript function. | 113 // they can be passed to a JavaScript function. |
| 109 static void ProcessAutocompleteSuggestions( | 114 static void ProcessAutocompleteSuggestions( |
| 110 const AutocompleteResult& autocompleteResult, | 115 const AutocompleteResult& result, |
| 111 base::ListValue * const suggestions); | 116 base::ListValue* const suggestions); |
| 112 | 117 |
| 113 static base::RefCountedMemory* GetFaviconResourceBytes(); | 118 static base::RefCountedMemory* GetFaviconResourceBytes(); |
| 114 | 119 |
| 115 // Overridden from OptionsPageUIHandlerHost: | 120 // Overridden from OptionsPageUIHandlerHost: |
| 116 virtual void InitializeHandlers() OVERRIDE; | 121 virtual void InitializeHandlers() OVERRIDE; |
| 117 | 122 |
| 118 private: | 123 private: |
| 119 // Adds OptionsPageUiHandler to the handlers list if handler is enabled. | 124 // Adds OptionsPageUiHandler to the handlers list if handler is enabled. |
| 120 void AddOptionsPageUIHandler(base::DictionaryValue* localized_strings, | 125 void AddOptionsPageUIHandler(base::DictionaryValue* localized_strings, |
| 121 OptionsPageUIHandler* handler); | 126 OptionsPageUIHandler* handler); |
| 122 | 127 |
| 123 bool initialized_handlers_; | 128 bool initialized_handlers_; |
| 124 | 129 |
| 125 std::vector<OptionsPageUIHandler*> handlers_; | 130 std::vector<OptionsPageUIHandler*> handlers_; |
| 126 | 131 |
| 127 #if defined(OS_CHROMEOS) | 132 #if defined(OS_CHROMEOS) |
| 128 scoped_ptr<chromeos::system::PointerDeviceObserver> | 133 scoped_ptr<chromeos::system::PointerDeviceObserver> |
| 129 pointer_device_observer_; | 134 pointer_device_observer_; |
| 130 #endif | 135 #endif |
| 131 | 136 |
| 132 DISALLOW_COPY_AND_ASSIGN(OptionsUI); | 137 DISALLOW_COPY_AND_ASSIGN(OptionsUI); |
| 133 }; | 138 }; |
| 134 | 139 |
| 135 } // namespace options2 | 140 } // namespace options2 |
| 136 | 141 |
| 137 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_OPTIONS_UI2_H_ | 142 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_OPTIONS_UI2_H_ |
| OLD | NEW |