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 ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ |
6 #define ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ | 6 #define ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "content/public/browser/content_browser_client.h" | 14 #include "content/public/browser/content_browser_client.h" |
15 | 15 |
16 namespace android_webview { | 16 namespace android_webview { |
17 | 17 |
18 class AwBrowserContext; | 18 class AwBrowserContext; |
19 class JniDependencyFactory; | |
20 | 19 |
21 class AwContentBrowserClient : public content::ContentBrowserClient { | 20 class AwContentBrowserClient : public content::ContentBrowserClient { |
22 public: | 21 public: |
23 // This is what AwContentBrowserClient::GetAcceptLangs uses. | 22 // This is what AwContentBrowserClient::GetAcceptLangs uses. |
24 static std::string GetAcceptLangsImpl(); | 23 static std::string GetAcceptLangsImpl(); |
25 | 24 |
26 // Deprecated: use AwBrowserContext::GetDefault() instead. | 25 // Deprecated: use AwBrowserContext::GetDefault() instead. |
27 static AwBrowserContext* GetAwBrowserContext(); | 26 static AwBrowserContext* GetAwBrowserContext(); |
28 | 27 |
29 AwContentBrowserClient(JniDependencyFactory* native_factory); | 28 explicit AwContentBrowserClient(); |
30 ~AwContentBrowserClient() override; | 29 ~AwContentBrowserClient() override; |
31 | 30 |
32 // Allows AwBrowserMainParts to initialize a BrowserContext at the right | 31 // Allows AwBrowserMainParts to initialize a BrowserContext at the right |
33 // moment during startup. AwContentBrowserClient owns the result. | 32 // moment during startup. AwContentBrowserClient owns the result. |
34 AwBrowserContext* InitBrowserContext(); | 33 AwBrowserContext* InitBrowserContext(); |
35 | 34 |
36 content::BrowserMainParts* CreateBrowserMainParts( | 35 content::BrowserMainParts* CreateBrowserMainParts( |
37 const content::MainFunctionParams& parameters) override; | 36 const content::MainFunctionParams& parameters) override; |
38 content::WebContentsViewDelegate* GetWebContentsViewDelegate( | 37 content::WebContentsViewDelegate* GetWebContentsViewDelegate( |
39 content::WebContents* web_contents) override; | 38 content::WebContents* web_contents) override; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 base::StringPiece name) override; | 132 base::StringPiece name) override; |
134 void ExposeInterfacesToFrame( | 133 void ExposeInterfacesToFrame( |
135 service_manager::BinderRegistry* registry, | 134 service_manager::BinderRegistry* registry, |
136 content::RenderFrameHost* render_frame_host) override; | 135 content::RenderFrameHost* render_frame_host) override; |
137 | 136 |
138 private: | 137 private: |
139 // Android WebView currently has a single global (non-off-the-record) browser | 138 // Android WebView currently has a single global (non-off-the-record) browser |
140 // context. | 139 // context. |
141 std::unique_ptr<AwBrowserContext> browser_context_; | 140 std::unique_ptr<AwBrowserContext> browser_context_; |
142 | 141 |
143 JniDependencyFactory* native_factory_; | |
144 | |
145 DISALLOW_COPY_AND_ASSIGN(AwContentBrowserClient); | 142 DISALLOW_COPY_AND_ASSIGN(AwContentBrowserClient); |
146 }; | 143 }; |
147 | 144 |
148 } // namespace android_webview | 145 } // namespace android_webview |
149 | 146 |
150 #endif // ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ | 147 #endif // ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |