| 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_ABOUT_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_ABOUT_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_ABOUT_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_ABOUT_UI_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 12 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 13 #include "content/browser/webui/web_ui.h" | |
| 14 #include "content/public/browser/web_ui_controller.h" | 13 #include "content/public/browser/web_ui_controller.h" |
| 15 | 14 |
| 16 class Profile; | 15 class Profile; |
| 17 class TabContents; | |
| 18 | 16 |
| 19 // We expose this class because the OOBE flow may need to explicitly add the | 17 // We expose this class because the OOBE flow may need to explicitly add the |
| 20 // chrome://terms source outside of the normal flow. | 18 // chrome://terms source outside of the normal flow. |
| 21 class AboutUIHTMLSource : public ChromeURLDataManager::DataSource { | 19 class AboutUIHTMLSource : public ChromeURLDataManager::DataSource { |
| 22 public: | 20 public: |
| 23 // Construct a data source for the specified |source_name|. | 21 // Construct a data source for the specified |source_name|. |
| 24 AboutUIHTMLSource(const std::string& source_name, Profile* profile); | 22 AboutUIHTMLSource(const std::string& source_name, Profile* profile); |
| 25 | 23 |
| 26 // Called when the network layer has requested a resource underneath | 24 // Called when the network layer has requested a resource underneath |
| 27 // the path we registered. | 25 // the path we registered. |
| 28 virtual void StartDataRequest(const std::string& path, | 26 virtual void StartDataRequest(const std::string& path, |
| 29 bool is_incognito, | 27 bool is_incognito, |
| 30 int request_id) OVERRIDE; | 28 int request_id) OVERRIDE; |
| 31 | 29 |
| 32 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; | 30 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; |
| 33 | 31 |
| 34 // Send the response data. | 32 // Send the response data. |
| 35 void FinishDataRequest(const std::string& html, int request_id); | 33 void FinishDataRequest(const std::string& html, int request_id); |
| 36 | 34 |
| 37 Profile* profile() { return profile_; } | 35 Profile* profile() { return profile_; } |
| 38 | 36 |
| 39 private: | 37 private: |
| 40 virtual ~AboutUIHTMLSource(); | 38 virtual ~AboutUIHTMLSource(); |
| 41 | 39 |
| 42 Profile* profile_; | 40 Profile* profile_; |
| 43 | 41 |
| 44 DISALLOW_COPY_AND_ASSIGN(AboutUIHTMLSource); | 42 DISALLOW_COPY_AND_ASSIGN(AboutUIHTMLSource); |
| 45 }; | 43 }; |
| 46 | 44 |
| 47 class AboutUI : public WebUI, public content::WebUIController { | 45 class AboutUI : public content::WebUIController { |
| 48 public: | 46 public: |
| 49 explicit AboutUI(content::WebContents* contents, const std::string& host); | 47 explicit AboutUI(WebUI* web_ui, const std::string& host); |
| 50 virtual ~AboutUI() {} | 48 virtual ~AboutUI() {} |
| 51 | 49 |
| 52 private: | 50 private: |
| 53 DISALLOW_COPY_AND_ASSIGN(AboutUI); | 51 DISALLOW_COPY_AND_ASSIGN(AboutUI); |
| 54 }; | 52 }; |
| 55 | 53 |
| 56 #endif // CHROME_BROWSER_UI_WEBUI_ABOUT_UI_H_ | 54 #endif // CHROME_BROWSER_UI_WEBUI_ABOUT_UI_H_ |
| OLD | NEW |