| 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_PUBLIC_BROWSER_WEB_UI_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_UI_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "content/public/common/page_transition_types.h" | 14 #include "content/public/common/page_transition_types.h" |
| 15 #include "ui/base/layout.h" | |
| 16 | 15 |
| 17 class GURL; | 16 class GURL; |
| 18 | 17 |
| 19 namespace base { | 18 namespace base { |
| 20 class ListValue; | 19 class ListValue; |
| 21 class Value; | 20 class Value; |
| 22 } | 21 } |
| 23 | 22 |
| 24 namespace content { | 23 namespace content { |
| 25 | 24 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 48 virtual ~WebUI() {} | 47 virtual ~WebUI() {} |
| 49 | 48 |
| 50 virtual WebContents* GetWebContents() const = 0; | 49 virtual WebContents* GetWebContents() const = 0; |
| 51 | 50 |
| 52 virtual WebUIController* GetController() const = 0; | 51 virtual WebUIController* GetController() const = 0; |
| 53 virtual void SetController(WebUIController* controller) = 0; | 52 virtual void SetController(WebUIController* controller) = 0; |
| 54 | 53 |
| 55 // Returns the device scale factor of the monitor that the renderer is on. | 54 // Returns the device scale factor of the monitor that the renderer is on. |
| 56 // Whenever possible, WebUI should push resources with this scale factor to | 55 // Whenever possible, WebUI should push resources with this scale factor to |
| 57 // Javascript. | 56 // Javascript. |
| 58 virtual ui::ScaleFactor GetDeviceScaleFactor() const = 0; | 57 virtual float GetDeviceScaleFactor() const = 0; |
| 59 | 58 |
| 60 // Gets a custom tab title provided by the Web UI. If there is no title | 59 // Gets a custom tab title provided by the Web UI. If there is no title |
| 61 // override, the string will be empty which should trigger the default title | 60 // override, the string will be empty which should trigger the default title |
| 62 // behavior for the tab. | 61 // behavior for the tab. |
| 63 virtual const base::string16& GetOverriddenTitle() const = 0; | 62 virtual const base::string16& GetOverriddenTitle() const = 0; |
| 64 virtual void OverrideTitle(const base::string16& title) = 0; | 63 virtual void OverrideTitle(const base::string16& title) = 0; |
| 65 | 64 |
| 66 // Returns the transition type that should be used for link clicks on this | 65 // Returns the transition type that should be used for link clicks on this |
| 67 // Web UI. This will default to LINK but may be overridden. | 66 // Web UI. This will default to LINK but may be overridden. |
| 68 virtual PageTransition GetLinkTransitionType() const = 0; | 67 virtual PageTransition GetLinkTransitionType() const = 0; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 const base::Value& arg3, | 115 const base::Value& arg3, |
| 117 const base::Value& arg4) = 0; | 116 const base::Value& arg4) = 0; |
| 118 virtual void CallJavascriptFunction( | 117 virtual void CallJavascriptFunction( |
| 119 const std::string& function_name, | 118 const std::string& function_name, |
| 120 const std::vector<const base::Value*>& args) = 0; | 119 const std::vector<const base::Value*>& args) = 0; |
| 121 }; | 120 }; |
| 122 | 121 |
| 123 } // namespace content | 122 } // namespace content |
| 124 | 123 |
| 125 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_H_ | 124 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_H_ |
| OLD | NEW |