OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 IOS_WEB_PUBLIC_WEB_CLIENT_H_ | 5 #ifndef IOS_WEB_PUBLIC_WEB_CLIENT_H_ |
6 #define IOS_WEB_PUBLIC_WEB_CLIENT_H_ | 6 #define IOS_WEB_PUBLIC_WEB_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "base/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" |
14 #include "base/task_scheduler/task_scheduler.h" | 14 #include "base/task_scheduler/task_scheduler.h" |
| 15 #include "ios/web/public/user_agent.h" |
15 #include "ui/base/layout.h" | 16 #include "ui/base/layout.h" |
16 #include "url/url_util.h" | 17 #include "url/url_util.h" |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 class RefCountedMemory; | 20 class RefCountedMemory; |
20 class SchedulerWorkerPoolParams; | 21 class SchedulerWorkerPoolParams; |
21 } | 22 } |
22 | 23 |
23 class GURL; | 24 class GURL; |
24 | 25 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // browser would return true for "chrome://about" URL. | 73 // browser would return true for "chrome://about" URL. |
73 virtual bool IsAppSpecificURL(const GURL& url) const; | 74 virtual bool IsAppSpecificURL(const GURL& url) const; |
74 | 75 |
75 // Returns text to be displayed for an unsupported plugin. | 76 // Returns text to be displayed for an unsupported plugin. |
76 virtual base::string16 GetPluginNotSupportedText() const; | 77 virtual base::string16 GetPluginNotSupportedText() const; |
77 | 78 |
78 // Returns a string describing the embedder product name and version, of the | 79 // Returns a string describing the embedder product name and version, of the |
79 // form "productname/version". Used as part of the user agent string. | 80 // form "productname/version". Used as part of the user agent string. |
80 virtual std::string GetProduct() const; | 81 virtual std::string GetProduct() const; |
81 | 82 |
82 // Returns the user agent. |desktop_user_agent| is true if desktop user agent | 83 // Returns the user agent string for the specified type. |
83 // is requested. | 84 virtual std::string GetUserAgent(UserAgentType type) const; |
84 virtual std::string GetUserAgent(bool desktop_user_agent) const; | |
85 | 85 |
86 // Returns a string resource given its id. | 86 // Returns a string resource given its id. |
87 virtual base::string16 GetLocalizedString(int message_id) const; | 87 virtual base::string16 GetLocalizedString(int message_id) const; |
88 | 88 |
89 // Returns the contents of a resource in a StringPiece given the resource id. | 89 // Returns the contents of a resource in a StringPiece given the resource id. |
90 virtual base::StringPiece GetDataResource(int resource_id, | 90 virtual base::StringPiece GetDataResource(int resource_id, |
91 ui::ScaleFactor scale_factor) const; | 91 ui::ScaleFactor scale_factor) const; |
92 | 92 |
93 // Returns the raw bytes of a scale independent data resource. | 93 // Returns the raw bytes of a scale independent data resource. |
94 virtual base::RefCountedMemory* GetDataResourceBytes(int resource_id) const; | 94 virtual base::RefCountedMemory* GetDataResourceBytes(int resource_id) const; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* | 129 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* |
130 index_to_traits_callback) {} | 130 index_to_traits_callback) {} |
131 | 131 |
132 // Performs any necessary PostTask API redirection to the task scheduler. | 132 // Performs any necessary PostTask API redirection to the task scheduler. |
133 virtual void PerformExperimentalTaskSchedulerRedirections() {} | 133 virtual void PerformExperimentalTaskSchedulerRedirections() {} |
134 }; | 134 }; |
135 | 135 |
136 } // namespace web | 136 } // namespace web |
137 | 137 |
138 #endif // IOS_WEB_PUBLIC_WEB_CLIENT_H_ | 138 #endif // IOS_WEB_PUBLIC_WEB_CLIENT_H_ |
OLD | NEW |