Chromium Code Reviews| 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/lib/main/webview_main_delegate.h" | 5 #include "android_webview/lib/main/webview_main_delegate.h" |
| 6 | 6 |
| 7 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" | 7 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" |
| 8 #include "android_webview/lib/aw_content_browser_client.h" | 8 #include "android_webview/lib/aw_content_browser_client.h" |
| 9 #include "android_webview/renderer/aw_render_view_ext.h" | |
| 9 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 11 #include "base/logging.h" |
| 11 #include "chrome/common/chrome_paths.h" | 12 #include "chrome/common/chrome_paths.h" |
| 12 #include "chrome/renderer/chrome_content_renderer_client.h" | 13 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 13 #include "content/public/browser/browser_main_runner.h" | 14 #include "content/public/browser/browser_main_runner.h" |
| 14 #include "content/public/common/content_client.h" | 15 #include "content/public/common/content_client.h" |
| 15 | 16 |
| 16 namespace android_webview { | 17 namespace android_webview { |
| 17 | 18 |
| 19 namespace { | |
| 20 | |
| 21 // TODO(joth): Remove chrome/ dependency; move into android_webview/renderer | |
| 22 class AwRendererClient : public chrome::ChromeContentRendererClient { | |
|
Torne
2012/08/29 10:34:29
AwContentRendererClient for consistency
joth
2012/08/29 22:28:05
Yeah. We do have AwMainDelegate (no Content) now,
| |
| 23 public: | |
| 24 virtual void RenderViewCreated(content::RenderView* render_view) { | |
| 25 chrome::ChromeContentRendererClient::RenderViewCreated(render_view); | |
| 26 new AwRenderViewExt(render_view); | |
| 27 } | |
| 28 }; | |
| 29 | |
| 30 } | |
| 31 | |
| 18 base::LazyInstance<AwContentBrowserClient> | 32 base::LazyInstance<AwContentBrowserClient> |
| 19 g_webview_content_browser_client = LAZY_INSTANCE_INITIALIZER; | 33 g_webview_content_browser_client = LAZY_INSTANCE_INITIALIZER; |
| 20 base::LazyInstance<chrome::ChromeContentRendererClient> | 34 base::LazyInstance<AwRendererClient> |
| 21 g_webview_content_renderer_client = LAZY_INSTANCE_INITIALIZER; | 35 g_webview_content_renderer_client = LAZY_INSTANCE_INITIALIZER; |
| 22 | 36 |
| 23 WebViewMainDelegate::WebViewMainDelegate() { | 37 WebViewMainDelegate::WebViewMainDelegate() { |
| 24 } | 38 } |
| 25 | 39 |
| 26 WebViewMainDelegate::~WebViewMainDelegate() { | 40 WebViewMainDelegate::~WebViewMainDelegate() { |
| 27 } | 41 } |
| 28 | 42 |
| 29 bool WebViewMainDelegate::BasicStartupComplete(int* exit_code) { | 43 bool WebViewMainDelegate::BasicStartupComplete(int* exit_code) { |
| 30 content::SetContentClient(&chrome_content_client_); | 44 content::SetContentClient(&chrome_content_client_); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 WebViewMainDelegate::CreateContentBrowserClient() { | 85 WebViewMainDelegate::CreateContentBrowserClient() { |
| 72 return &g_webview_content_browser_client.Get(); | 86 return &g_webview_content_browser_client.Get(); |
| 73 } | 87 } |
| 74 | 88 |
| 75 content::ContentRendererClient* | 89 content::ContentRendererClient* |
| 76 WebViewMainDelegate::CreateContentRendererClient() { | 90 WebViewMainDelegate::CreateContentRendererClient() { |
| 77 return &g_webview_content_renderer_client.Get(); | 91 return &g_webview_content_renderer_client.Get(); |
| 78 } | 92 } |
| 79 | 93 |
| 80 } // namespace android_webview | 94 } // namespace android_webview |
| OLD | NEW |