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 CONTENT_BROWSER_WEBUI_WEB_UI_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEBUI_WEB_UI_IMPL_H_ |
6 #define CONTENT_BROWSER_WEBUI_WEB_UI_IMPL_H_ | 6 #define CONTENT_BROWSER_WEBUI_WEB_UI_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 const base::ListValue& args); | 89 const base::ListValue& args); |
90 | 90 |
91 // Execute a string of raw JavaScript on the page. | 91 // Execute a string of raw JavaScript on the page. |
92 void ExecuteJavascript(const base::string16& javascript); | 92 void ExecuteJavascript(const base::string16& javascript); |
93 | 93 |
94 // Finds the frame in which to execute JavaScript based on |frame_name_|. If | 94 // Finds the frame in which to execute JavaScript based on |frame_name_|. If |
95 // |frame_name_| is empty, the main frame is returned. May return NULL if no | 95 // |frame_name_| is empty, the main frame is returned. May return NULL if no |
96 // frame of the specified name exists in the page. | 96 // frame of the specified name exists in the page. |
97 RenderFrameHost* TargetFrame(); | 97 RenderFrameHost* TargetFrame(); |
98 | 98 |
99 // A helper function for TargetFrame; adds a frame to the specified set if its | |
100 // name matches |frame_name_|. | |
101 void AddToSetIfFrameNameMatches(std::set<RenderFrameHost*>* frame_set, | |
102 RenderFrameHost* host); | |
103 | |
104 // Called internally and by the owned MainFrameNavigationObserver. | 99 // Called internally and by the owned MainFrameNavigationObserver. |
105 void DisallowJavascriptOnAllHandlers(); | 100 void DisallowJavascriptOnAllHandlers(); |
106 | 101 |
107 // A map of message name -> message handling callback. | 102 // A map of message name -> message handling callback. |
108 typedef std::map<std::string, MessageCallback> MessageCallbackMap; | 103 typedef std::map<std::string, MessageCallback> MessageCallbackMap; |
109 MessageCallbackMap message_callbacks_; | 104 MessageCallbackMap message_callbacks_; |
110 | 105 |
111 // Options that may be overridden by individual Web UI implementations. The | 106 // Options that may be overridden by individual Web UI implementations. The |
112 // bool options default to false. See the public getters for more information. | 107 // bool options default to false. See the public getters for more information. |
113 base::string16 overridden_title_; // Defaults to empty string. | 108 base::string16 overridden_title_; // Defaults to empty string. |
(...skipping 14 matching lines...) Expand all Loading... |
128 const std::string frame_name_; | 123 const std::string frame_name_; |
129 | 124 |
130 std::unique_ptr<WebUIController> controller_; | 125 std::unique_ptr<WebUIController> controller_; |
131 | 126 |
132 DISALLOW_COPY_AND_ASSIGN(WebUIImpl); | 127 DISALLOW_COPY_AND_ASSIGN(WebUIImpl); |
133 }; | 128 }; |
134 | 129 |
135 } // namespace content | 130 } // namespace content |
136 | 131 |
137 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_IMPL_H_ | 132 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_IMPL_H_ |
OLD | NEW |