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_BROWSER_AW_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_CONTENT_BROWSER_CLIENT_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_AW_CONTENT_BROWSER_CLIENT_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_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 | 19 |
20 class AwContentBrowserClient : public content::ContentBrowserClient { | 20 class AwContentBrowserClient : public content::ContentBrowserClient { |
21 public: | 21 public: |
22 // This is what AwContentBrowserClient::GetAcceptLangs uses. | 22 // This is what AwContentBrowserClient::GetAcceptLangs uses. |
23 static std::string GetAcceptLangsImpl(); | 23 static std::string GetAcceptLangsImpl(); |
24 | 24 |
25 // Deprecated: use AwBrowserContext::GetDefault() instead. | 25 // Deprecated: use AwBrowserContext::GetDefault() instead. |
26 static AwBrowserContext* GetAwBrowserContext(); | 26 static AwBrowserContext* GetAwBrowserContext(); |
27 | 27 |
28 explicit AwContentBrowserClient(); | 28 AwContentBrowserClient(); |
29 ~AwContentBrowserClient() override; | 29 ~AwContentBrowserClient() override; |
30 | 30 |
31 // Allows AwBrowserMainParts to initialize a BrowserContext at the right | 31 // Allows AwBrowserMainParts to initialize a BrowserContext at the right |
32 // moment during startup. AwContentBrowserClient owns the result. | 32 // moment during startup. AwContentBrowserClient owns the result. |
33 AwBrowserContext* InitBrowserContext(); | 33 AwBrowserContext* InitBrowserContext(); |
34 | 34 |
35 content::BrowserMainParts* CreateBrowserMainParts( | 35 content::BrowserMainParts* CreateBrowserMainParts( |
36 const content::MainFunctionParams& parameters) override; | 36 const content::MainFunctionParams& parameters) override; |
37 content::WebContentsViewDelegate* GetWebContentsViewDelegate( | 37 content::WebContentsViewDelegate* GetWebContentsViewDelegate( |
38 content::WebContents* web_contents) override; | 38 content::WebContents* web_contents) override; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // Android WebView currently has a single global (non-off-the-record) browser | 136 // Android WebView currently has a single global (non-off-the-record) browser |
137 // context. | 137 // context. |
138 std::unique_ptr<AwBrowserContext> browser_context_; | 138 std::unique_ptr<AwBrowserContext> browser_context_; |
139 | 139 |
140 DISALLOW_COPY_AND_ASSIGN(AwContentBrowserClient); | 140 DISALLOW_COPY_AND_ASSIGN(AwContentBrowserClient); |
141 }; | 141 }; |
142 | 142 |
143 } // namespace android_webview | 143 } // namespace android_webview |
144 | 144 |
145 #endif // ANDROID_WEBVIEW_BROWSER_AW_CONTENT_BROWSER_CLIENT_H_ | 145 #endif // ANDROID_WEBVIEW_BROWSER_AW_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |