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

Side by Side Diff: ios/web/public/web_client.h

Issue 2647943004: Return unique_ptr from WebClient::CreateWebMainParts() (Closed)
Patch Set: Created 3 years, 11 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_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/app/web_main_parts.h"
Eugene But (OOO till 7-30) 2017/01/20 22:11:41 There is no need for include. Having predeclaratio
michaeldo 2017/01/23 17:30:54 Done.
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
25 @class UIWebView; 26 @class UIWebView;
26 @class NSString; 27 @class NSString;
27 28
28 namespace net { 29 namespace net {
29 class SSLInfo; 30 class SSLInfo;
30 } 31 }
31 32
32 namespace web { 33 namespace web {
33 34
34 class BrowserState; 35 class BrowserState;
35 class BrowserURLRewriter; 36 class BrowserURLRewriter;
36 class WebClient; 37 class WebClient;
37 class WebMainParts;
38 class WebState; 38 class WebState;
39 39
40 // Setter and getter for the client. The client should be set early, before any 40 // Setter and getter for the client. The client should be set early, before any
41 // web code is called. 41 // web code is called.
42 void SetWebClient(WebClient* client); 42 void SetWebClient(WebClient* client);
43 WebClient* GetWebClient(); 43 WebClient* GetWebClient();
44 44
45 // Interface that the embedder of the web layer implements. 45 // Interface that the embedder of the web layer implements.
46 class WebClient { 46 class WebClient {
47 public: 47 public:
48 WebClient(); 48 WebClient();
49 virtual ~WebClient(); 49 virtual ~WebClient();
50 50
51 // Allows the embedder to set a custom WebMainParts implementation for the 51 // Allows the embedder to set a custom WebMainParts implementation for the
52 // browser startup code. 52 // browser startup code.
53 virtual WebMainParts* CreateWebMainParts(); 53 virtual std::unique_ptr<WebMainParts> CreateWebMainParts();
54 54
55 // Gives the embedder a chance to perform tasks before a web view is created. 55 // Gives the embedder a chance to perform tasks before a web view is created.
56 virtual void PreWebViewCreation() const {} 56 virtual void PreWebViewCreation() const {}
57 57
58 // Gives the embedder a chance to register its own standard and saveable url 58 // Gives the embedder a chance to register its own standard and saveable url
59 // schemes early on in the startup sequence. 59 // schemes early on in the startup sequence.
60 virtual void AddAdditionalSchemes( 60 virtual void AddAdditionalSchemes(
61 std::vector<url::SchemeWithType>* additional_standard_schemes) const {} 61 std::vector<url::SchemeWithType>* additional_standard_schemes) const {}
62 62
63 // Returns the languages used in the Accept-Languages HTTP header. 63 // Returns the languages used in the Accept-Languages HTTP header.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* 137 base::TaskScheduler::WorkerPoolIndexForTraitsCallback*
138 index_to_traits_callback) {} 138 index_to_traits_callback) {}
139 139
140 // Performs any necessary PostTask API redirection to the task scheduler. 140 // Performs any necessary PostTask API redirection to the task scheduler.
141 virtual void PerformExperimentalTaskSchedulerRedirections() {} 141 virtual void PerformExperimentalTaskSchedulerRedirections() {}
142 }; 142 };
143 143
144 } // namespace web 144 } // namespace web
145 145
146 #endif // IOS_WEB_PUBLIC_WEB_CLIENT_H_ 146 #endif // IOS_WEB_PUBLIC_WEB_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698