| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_DOM_UI_OPTIONS_OPTIONS_UI_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_UI_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_UI_H_ | 6 #define CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_UI_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 12 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
| 13 #include "chrome/browser/dom_ui/dom_ui.h" | 13 #include "chrome/browser/dom_ui/dom_ui.h" |
| 14 #include "chrome/common/notification_observer.h" | 14 #include "chrome/common/notification_observer.h" |
| 15 #include "chrome/common/notification_registrar.h" | 15 #include "chrome/common/notification_registrar.h" |
| 16 #include "chrome/common/notification_type.h" | 16 #include "chrome/common/notification_type.h" |
| 17 | 17 |
| 18 class GURL; | 18 class GURL; |
| 19 class PrefService; | 19 class PrefService; |
| 20 struct UserMetricsAction; | 20 struct UserMetricsAction; |
| 21 | 21 |
| 22 class OptionsUIHTMLSource : public ChromeURLDataManager::DataSource { | 22 class OptionsUIHTMLSource : public ChromeURLDataManager::DataSource { |
| 23 public: | 23 public: |
| 24 // The constructor takes over ownership of |localized_strings|. | 24 // The constructor takes over ownership of |localized_strings|. |
| 25 explicit OptionsUIHTMLSource(DictionaryValue* localized_strings); | 25 explicit OptionsUIHTMLSource(DictionaryValue* localized_strings); |
| 26 virtual ~OptionsUIHTMLSource() {} | 26 virtual ~OptionsUIHTMLSource(); |
| 27 | 27 |
| 28 // Called when the network layer has requested a resource underneath | 28 // Called when the network layer has requested a resource underneath |
| 29 // the path we registered. | 29 // the path we registered. |
| 30 virtual void StartDataRequest(const std::string& path, | 30 virtual void StartDataRequest(const std::string& path, |
| 31 bool is_off_the_record, | 31 bool is_off_the_record, |
| 32 int request_id); | 32 int request_id); |
| 33 virtual std::string GetMimeType(const std::string&) const { | 33 virtual std::string GetMimeType(const std::string&) const; |
| 34 return "text/html"; | |
| 35 } | |
| 36 | 34 |
| 37 private: | 35 private: |
| 38 // Localized strings collection. | 36 // Localized strings collection. |
| 39 scoped_ptr<DictionaryValue> localized_strings_; | 37 scoped_ptr<DictionaryValue> localized_strings_; |
| 40 | 38 |
| 41 DISALLOW_COPY_AND_ASSIGN(OptionsUIHTMLSource); | 39 DISALLOW_COPY_AND_ASSIGN(OptionsUIHTMLSource); |
| 42 }; | 40 }; |
| 43 | 41 |
| 44 // The base class handler of Javascript messages of options pages. | 42 // The base class handler of Javascript messages of options pages. |
| 45 class OptionsPageUIHandler : public DOMMessageHandler, | 43 class OptionsPageUIHandler : public DOMMessageHandler, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 87 |
| 90 private: | 88 private: |
| 91 // Adds OptionsPageUiHandler to the handlers list if handler is enabled. | 89 // Adds OptionsPageUiHandler to the handlers list if handler is enabled. |
| 92 void AddOptionsPageUIHandler(DictionaryValue* localized_strings, | 90 void AddOptionsPageUIHandler(DictionaryValue* localized_strings, |
| 93 OptionsPageUIHandler* handler); | 91 OptionsPageUIHandler* handler); |
| 94 | 92 |
| 95 DISALLOW_COPY_AND_ASSIGN(OptionsUI); | 93 DISALLOW_COPY_AND_ASSIGN(OptionsUI); |
| 96 }; | 94 }; |
| 97 | 95 |
| 98 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_UI_H_ | 96 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_UI_H_ |
| OLD | NEW |