| 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 <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // RenderFrameHostManager will reuse RenderView instances. | 30 // RenderFrameHostManager will reuse RenderView instances. |
| 31 void RenderViewCreated(RenderViewHost* render_view_host); | 31 void RenderViewCreated(RenderViewHost* render_view_host); |
| 32 | 32 |
| 33 // WebUI implementation: | 33 // WebUI implementation: |
| 34 virtual WebContents* GetWebContents() const OVERRIDE; | 34 virtual WebContents* GetWebContents() const OVERRIDE; |
| 35 virtual WebUIController* GetController() const OVERRIDE; | 35 virtual WebUIController* GetController() const OVERRIDE; |
| 36 virtual void SetController(WebUIController* controller) OVERRIDE; | 36 virtual void SetController(WebUIController* controller) OVERRIDE; |
| 37 virtual float GetDeviceScaleFactor() const OVERRIDE; | 37 virtual float GetDeviceScaleFactor() const OVERRIDE; |
| 38 virtual const base::string16& GetOverriddenTitle() const OVERRIDE; | 38 virtual const base::string16& GetOverriddenTitle() const OVERRIDE; |
| 39 virtual void OverrideTitle(const base::string16& title) OVERRIDE; | 39 virtual void OverrideTitle(const base::string16& title) OVERRIDE; |
| 40 virtual PageTransition GetLinkTransitionType() const OVERRIDE; | 40 virtual ui::PageTransition GetLinkTransitionType() const OVERRIDE; |
| 41 virtual void SetLinkTransitionType(PageTransition type) OVERRIDE; | 41 virtual void SetLinkTransitionType(ui::PageTransition type) OVERRIDE; |
| 42 virtual int GetBindings() const OVERRIDE; | 42 virtual int GetBindings() const OVERRIDE; |
| 43 virtual void SetBindings(int bindings) OVERRIDE; | 43 virtual void SetBindings(int bindings) OVERRIDE; |
| 44 virtual void OverrideJavaScriptFrame(const std::string& frame_name) OVERRIDE; | 44 virtual void OverrideJavaScriptFrame(const std::string& frame_name) OVERRIDE; |
| 45 virtual void AddMessageHandler(WebUIMessageHandler* handler) OVERRIDE; | 45 virtual void AddMessageHandler(WebUIMessageHandler* handler) OVERRIDE; |
| 46 typedef base::Callback<void(const base::ListValue*)> MessageCallback; | 46 typedef base::Callback<void(const base::ListValue*)> MessageCallback; |
| 47 virtual void RegisterMessageCallback( | 47 virtual void RegisterMessageCallback( |
| 48 const std::string& message, | 48 const std::string& message, |
| 49 const MessageCallback& callback) OVERRIDE; | 49 const MessageCallback& callback) OVERRIDE; |
| 50 virtual void ProcessWebUIMessage(const GURL& source_url, | 50 virtual void ProcessWebUIMessage(const GURL& source_url, |
| 51 const std::string& message, | 51 const std::string& message, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void AddToSetIfFrameNameMatches(std::set<RenderFrameHost*>* frame_set, | 92 void AddToSetIfFrameNameMatches(std::set<RenderFrameHost*>* frame_set, |
| 93 RenderFrameHost* host); | 93 RenderFrameHost* host); |
| 94 | 94 |
| 95 // A map of message name -> message handling callback. | 95 // A map of message name -> message handling callback. |
| 96 typedef std::map<std::string, MessageCallback> MessageCallbackMap; | 96 typedef std::map<std::string, MessageCallback> MessageCallbackMap; |
| 97 MessageCallbackMap message_callbacks_; | 97 MessageCallbackMap message_callbacks_; |
| 98 | 98 |
| 99 // Options that may be overridden by individual Web UI implementations. The | 99 // Options that may be overridden by individual Web UI implementations. The |
| 100 // bool options default to false. See the public getters for more information. | 100 // bool options default to false. See the public getters for more information. |
| 101 base::string16 overridden_title_; // Defaults to empty string. | 101 base::string16 overridden_title_; // Defaults to empty string. |
| 102 PageTransition link_transition_type_; // Defaults to LINK. | 102 ui::PageTransition link_transition_type_; // Defaults to LINK. |
| 103 int bindings_; // The bindings from BindingsPolicy that should be enabled for | 103 int bindings_; // The bindings from BindingsPolicy that should be enabled for |
| 104 // this page. | 104 // this page. |
| 105 | 105 |
| 106 // The WebUIMessageHandlers we own. | 106 // The WebUIMessageHandlers we own. |
| 107 ScopedVector<WebUIMessageHandler> handlers_; | 107 ScopedVector<WebUIMessageHandler> handlers_; |
| 108 | 108 |
| 109 // Non-owning pointer to the WebContents this WebUI is associated with. | 109 // Non-owning pointer to the WebContents this WebUI is associated with. |
| 110 WebContents* web_contents_; | 110 WebContents* web_contents_; |
| 111 | 111 |
| 112 // The name of the iframe this WebUI is embedded in (empty if not explicitly | 112 // The name of the iframe this WebUI is embedded in (empty if not explicitly |
| 113 // overridden with OverrideJavaScriptFrame). | 113 // overridden with OverrideJavaScriptFrame). |
| 114 std::string frame_name_; | 114 std::string frame_name_; |
| 115 | 115 |
| 116 scoped_ptr<WebUIController> controller_; | 116 scoped_ptr<WebUIController> controller_; |
| 117 | 117 |
| 118 DISALLOW_COPY_AND_ASSIGN(WebUIImpl); | 118 DISALLOW_COPY_AND_ASSIGN(WebUIImpl); |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 } // namespace content | 121 } // namespace content |
| 122 | 122 |
| 123 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_IMPL_H_ | 123 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_IMPL_H_ |
| OLD | NEW |