Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(829)

Side by Side Diff: ios/web_view/internal/web_view_web_client.h

Issue 2791403005: Remove CWV class and move setting User Agent to CWVWebViewConfiguration. (Closed)
Patch Set: Remove cwv.h import from Framework header. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_VIEW_INTERNAL_WEB_VIEW_WEB_CLIENT_H_ 5 #ifndef IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_CLIENT_H_
6 #define IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_CLIENT_H_ 6 #define IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_CLIENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #import "ios/web/public/web_client.h" 11 #import "ios/web/public/web_client.h"
12 12
13 namespace ios_web_view { 13 namespace ios_web_view {
14 class WebViewBrowserState; 14 class WebViewBrowserState;
15 class WebViewWebMainParts; 15 class WebViewWebMainParts;
16 16
17 // WebView implementation of WebClient. 17 // WebView implementation of WebClient.
18 class WebViewWebClient : public web::WebClient { 18 class WebViewWebClient : public web::WebClient {
19 public: 19 public:
20 explicit WebViewWebClient(const std::string& user_agent_product); 20 WebViewWebClient();
21 ~WebViewWebClient() override; 21 ~WebViewWebClient() override;
22 22
23 // WebClient implementation. 23 // WebClient implementation.
24 web::WebMainParts* CreateWebMainParts() override; 24 web::WebMainParts* CreateWebMainParts() override;
25 std::string GetProduct() const override; 25 std::string GetProduct() const override;
26 std::string GetUserAgent(web::UserAgentType type) const override; 26 std::string GetUserAgent(web::UserAgentType type) const override;
27 NSString* GetEarlyPageScript(web::BrowserState* browser_state) const override; 27 NSString* GetEarlyPageScript(web::BrowserState* browser_state) const override;
28 28
29 // Setter to modify the User Agent product.
30 void SetProduct(const std::string& user_agent_product);
31
29 // Normal browser state associated with the receiver. 32 // Normal browser state associated with the receiver.
30 WebViewBrowserState* browser_state() const; 33 WebViewBrowserState* browser_state() const;
31 // Off the record browser state associated with the receiver. 34 // Off the record browser state associated with the receiver.
32 WebViewBrowserState* off_the_record_browser_state() const; 35 WebViewBrowserState* off_the_record_browser_state() const;
33 36
34 private: 37 private:
35 // The name of the product to be used in the User Agent string. 38 // The name of the product to be used in the User Agent string.
36 std::string user_agent_product_; 39 std::string user_agent_product_;
37 40
38 // The WebMainParts created by |CreateWebMainParts()|. 41 // The WebMainParts created by |CreateWebMainParts()|.
39 WebViewWebMainParts* web_main_parts_; 42 WebViewWebMainParts* web_main_parts_;
40 43
41 DISALLOW_COPY_AND_ASSIGN(WebViewWebClient); 44 DISALLOW_COPY_AND_ASSIGN(WebViewWebClient);
42 }; 45 };
43 46
44 } // namespace ios_web_view 47 } // namespace ios_web_view
45 48
46 #endif // IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_CLIENT_H_ 49 #endif // IOS_WEB_VIEW_INTERNAL_WEB_VIEW_WEB_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698