| 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 CONTENT_BROWSER_WEBUI_WEB_UI_H_ | 5 #ifndef CONTENT_BROWSER_WEBUI_WEB_UI_H_ |
| 6 #define CONTENT_BROWSER_WEBUI_WEB_UI_H_ | 6 #define CONTENT_BROWSER_WEBUI_WEB_UI_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/callback_old.h" | 14 #include "base/callback_old.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/string16.h" | 16 #include "base/string16.h" |
| 17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 18 #include "content/common/page_transition_types.h" | 18 #include "content/public/common/page_transition_types.h" |
| 19 #include "ipc/ipc_channel.h" | 19 #include "ipc/ipc_channel.h" |
| 20 | 20 |
| 21 class GURL; | 21 class GURL; |
| 22 class RenderViewHost; | 22 class RenderViewHost; |
| 23 class TabContents; | 23 class TabContents; |
| 24 class WebUIMessageHandler; | 24 class WebUIMessageHandler; |
| 25 | 25 |
| 26 namespace base { | 26 namespace base { |
| 27 class DictionaryValue; | 27 class DictionaryValue; |
| 28 class ListValue; | 28 class ListValue; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 // Gets a custom tab title provided by the Web UI. If there is no title | 99 // Gets a custom tab title provided by the Web UI. If there is no title |
| 100 // override, the string will be empty which should trigger the default title | 100 // override, the string will be empty which should trigger the default title |
| 101 // behavior for the tab. | 101 // behavior for the tab. |
| 102 const string16& overridden_title() const { | 102 const string16& overridden_title() const { |
| 103 return overridden_title_; | 103 return overridden_title_; |
| 104 } | 104 } |
| 105 | 105 |
| 106 // Returns the transition type that should be used for link clicks on this | 106 // Returns the transition type that should be used for link clicks on this |
| 107 // Web UI. This will default to LINK but may be overridden. | 107 // Web UI. This will default to LINK but may be overridden. |
| 108 PageTransition::Type link_transition_type() const { | 108 content::PageTransition link_transition_type() const { |
| 109 return link_transition_type_; | 109 return link_transition_type_; |
| 110 } | 110 } |
| 111 | 111 |
| 112 int bindings() const { | 112 int bindings() const { |
| 113 return bindings_; | 113 return bindings_; |
| 114 } | 114 } |
| 115 | 115 |
| 116 // Indicates whether RegisterMessageCallback() will overwrite an existing | 116 // Indicates whether RegisterMessageCallback() will overwrite an existing |
| 117 // message callback mapping. Serves as the hook for test mocks. | 117 // message callback mapping. Serves as the hook for test mocks. |
| 118 bool register_callback_overwrites() const { | 118 bool register_callback_overwrites() const { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // Execute a string of raw Javascript on the page. Overridable for | 174 // Execute a string of raw Javascript on the page. Overridable for |
| 175 // testing purposes. | 175 // testing purposes. |
| 176 virtual void ExecuteJavascript(const string16& javascript); | 176 virtual void ExecuteJavascript(const string16& javascript); |
| 177 | 177 |
| 178 // Options that may be overridden by individual Web UI implementations. The | 178 // Options that may be overridden by individual Web UI implementations. The |
| 179 // bool options default to false. See the public getters for more information. | 179 // bool options default to false. See the public getters for more information. |
| 180 bool hide_favicon_; | 180 bool hide_favicon_; |
| 181 bool focus_location_bar_by_default_; | 181 bool focus_location_bar_by_default_; |
| 182 bool should_hide_url_; | 182 bool should_hide_url_; |
| 183 string16 overridden_title_; // Defaults to empty string. | 183 string16 overridden_title_; // Defaults to empty string. |
| 184 PageTransition::Type link_transition_type_; // Defaults to LINK. | 184 content::PageTransition link_transition_type_; // Defaults to LINK. |
| 185 int bindings_; // The bindings from BindingsPolicy that should be enabled for | 185 int bindings_; // The bindings from BindingsPolicy that should be enabled for |
| 186 // this page. | 186 // this page. |
| 187 | 187 |
| 188 // Used by test mocks. See the public getters for more information. | 188 // Used by test mocks. See the public getters for more information. |
| 189 bool register_callback_overwrites_; // Defaults to false. | 189 bool register_callback_overwrites_; // Defaults to false. |
| 190 | 190 |
| 191 // The WebUIMessageHandlers we own. | 191 // The WebUIMessageHandlers we own. |
| 192 std::vector<WebUIMessageHandler*> handlers_; | 192 std::vector<WebUIMessageHandler*> handlers_; |
| 193 | 193 |
| 194 // Non-owning pointer to the TabContents this WebUI is associated with. | 194 // Non-owning pointer to the TabContents this WebUI is associated with. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 // Returns the attached WebUI for this handler. | 242 // Returns the attached WebUI for this handler. |
| 243 WebUI* web_ui() const { return web_ui_; } | 243 WebUI* web_ui() const { return web_ui_; } |
| 244 | 244 |
| 245 WebUI* web_ui_; // TODO(wyck): Make private after merge conflicts go away. | 245 WebUI* web_ui_; // TODO(wyck): Make private after merge conflicts go away. |
| 246 | 246 |
| 247 private: | 247 private: |
| 248 DISALLOW_COPY_AND_ASSIGN(WebUIMessageHandler); | 248 DISALLOW_COPY_AND_ASSIGN(WebUIMessageHandler); |
| 249 }; | 249 }; |
| 250 | 250 |
| 251 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_H_ | 251 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_H_ |
| OLD | NEW |