| 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 #include "android_webview/browser/aw_content_browser_client.h" | 5 #include "android_webview/browser/aw_content_browser_client.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/aw_browser_main_parts.h" | 7 #include "android_webview/browser/aw_browser_main_parts.h" |
| 8 #include "android_webview/browser/aw_cookie_access_policy.h" | 8 #include "android_webview/browser/aw_cookie_access_policy.h" |
| 9 #include "android_webview/browser/aw_quota_permission_context.h" | 9 #include "android_webview/browser/aw_quota_permission_context.h" |
| 10 #include "android_webview/browser/net_disk_cache_remover.h" | 10 #include "android_webview/browser/net_disk_cache_remover.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 virtual void SaveAccessToken( | 35 virtual void SaveAccessToken( |
| 36 const GURL& server_url, const string16& access_token) OVERRIDE { } | 36 const GURL& server_url, const string16& access_token) OVERRIDE { } |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(DummyAccessTokenStore); | 38 DISALLOW_COPY_AND_ASSIGN(DummyAccessTokenStore); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } | 41 } |
| 42 | 42 |
| 43 namespace android_webview { | 43 namespace android_webview { |
| 44 | 44 |
| 45 AwContentBrowserClient::AwContentBrowserClient() { | 45 AwContentBrowserClient::AwContentBrowserClient( |
| 46 ViewDelegateFactory* view_delegate_factory) |
| 47 : view_delegate_factory_(view_delegate_factory) { |
| 46 FilePath user_data_dir; | 48 FilePath user_data_dir; |
| 47 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &user_data_dir)) { | 49 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &user_data_dir)) { |
| 48 NOTREACHED() << "Failed to get app data directory for Android WebView"; | 50 NOTREACHED() << "Failed to get app data directory for Android WebView"; |
| 49 } | 51 } |
| 50 browser_context_.reset(new AwBrowserContext(user_data_dir)); | 52 browser_context_.reset(new AwBrowserContext(user_data_dir)); |
| 51 } | 53 } |
| 52 | 54 |
| 53 AwContentBrowserClient::~AwContentBrowserClient() { | 55 AwContentBrowserClient::~AwContentBrowserClient() { |
| 54 } | 56 } |
| 55 | 57 |
| 56 AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() { | 58 AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() { |
| 57 return browser_context_.get(); | 59 return browser_context_.get(); |
| 58 } | 60 } |
| 59 | 61 |
| 60 content::BrowserMainParts* AwContentBrowserClient::CreateBrowserMainParts( | 62 content::BrowserMainParts* AwContentBrowserClient::CreateBrowserMainParts( |
| 61 const content::MainFunctionParams& parameters) { | 63 const content::MainFunctionParams& parameters) { |
| 62 return new AwBrowserMainParts(browser_context_.get()); | 64 return new AwBrowserMainParts(browser_context_.get()); |
| 63 } | 65 } |
| 64 | 66 |
| 67 content::WebContentsViewDelegate* |
| 68 AwContentBrowserClient::GetWebContentsViewDelegate( |
| 69 content::WebContents* web_contents) { |
| 70 return NULL; //(*view_delegate_factory_)(web_contents); |
| 71 } |
| 72 |
| 65 void AwContentBrowserClient::RenderProcessHostCreated( | 73 void AwContentBrowserClient::RenderProcessHostCreated( |
| 66 content::RenderProcessHost* host) { | 74 content::RenderProcessHost* host) { |
| 67 // If WebView becomes multi-process capable, this may be insecure. | 75 // If WebView becomes multi-process capable, this may be insecure. |
| 68 // More benefit can be derived from the ChildProcessSecurotyPolicy by | 76 // More benefit can be derived from the ChildProcessSecurotyPolicy by |
| 69 // deferring the GrantScheme calls until we know that a given child process | 77 // deferring the GrantScheme calls until we know that a given child process |
| 70 // really does need that priviledge. Check here to ensure we rethink this | 78 // really does need that priviledge. Check here to ensure we rethink this |
| 71 // when the time comes. See crbug.com/156062. | 79 // when the time comes. See crbug.com/156062. |
| 72 CHECK(content::RenderProcessHost::run_renderer_in_process()); | 80 CHECK(content::RenderProcessHost::run_renderer_in_process()); |
| 73 | 81 |
| 74 // Grant content: and file: scheme to the whole process, since we impose | 82 // Grant content: and file: scheme to the whole process, since we impose |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 330 |
| 323 bool AwContentBrowserClient::AllowPepperSocketAPI( | 331 bool AwContentBrowserClient::AllowPepperSocketAPI( |
| 324 content::BrowserContext* browser_context, | 332 content::BrowserContext* browser_context, |
| 325 const GURL& url, | 333 const GURL& url, |
| 326 const content::SocketPermissionRequest& params) { | 334 const content::SocketPermissionRequest& params) { |
| 327 NOTREACHED() << "Android WebView does not support plugins"; | 335 NOTREACHED() << "Android WebView does not support plugins"; |
| 328 return false; | 336 return false; |
| 329 } | 337 } |
| 330 | 338 |
| 331 } // namespace android_webview | 339 } // namespace android_webview |
| OLD | NEW |