OLD | NEW |
---|---|
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 | |
6 #include "chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h" | 5 #include "chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h" |
7 | 6 |
7 #include "chrome/browser/browser_process.h" | |
8 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 8 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
9 #include "chrome/browser/favicon/favicon_tab_helper.h" | 9 #include "chrome/browser/favicon/favicon_tab_helper.h" |
10 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | |
10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 12 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
13 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" | |
12 #include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h" | 14 #include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h" |
13 #include "chrome/common/chrome_version_info.h" | 15 #include "chrome/common/chrome_version_info.h" |
16 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | |
14 #include "components/pdf/browser/pdf_web_contents_helper.h" | 17 #include "components/pdf/browser/pdf_web_contents_helper.h" |
15 #include "components/renderer_context_menu/context_menu_delegate.h" | 18 #include "components/renderer_context_menu/context_menu_delegate.h" |
16 #include "extensions/browser/api/web_request/web_request_api.h" | 19 #include "extensions/browser/api/web_request/web_request_api.h" |
17 #include "extensions/browser/guest_view/web_view/web_view_constants.h" | 20 #include "extensions/browser/guest_view/web_view/web_view_constants.h" |
18 | 21 |
19 #if defined(ENABLE_PRINTING) | 22 #if defined(ENABLE_PRINTING) |
20 #if defined(ENABLE_PRINT_PREVIEW) | 23 #if defined(ENABLE_PRINT_PREVIEW) |
21 #include "chrome/browser/printing/print_preview_message_handler.h" | 24 #include "chrome/browser/printing/print_preview_message_handler.h" |
22 #include "chrome/browser/printing/print_view_manager.h" | 25 #include "chrome/browser/printing/print_view_manager.h" |
23 #else | 26 #else |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 printing::PrintViewManager::CreateForWebContents(contents); | 72 printing::PrintViewManager::CreateForWebContents(contents); |
70 printing::PrintPreviewMessageHandler::CreateForWebContents(contents); | 73 printing::PrintPreviewMessageHandler::CreateForWebContents(contents); |
71 #else | 74 #else |
72 printing::PrintViewManagerBasic::CreateForWebContents(contents); | 75 printing::PrintViewManagerBasic::CreateForWebContents(contents); |
73 #endif // defined(ENABLE_PRINT_PREVIEW) | 76 #endif // defined(ENABLE_PRINT_PREVIEW) |
74 #endif // defined(ENABLE_PRINTING) | 77 #endif // defined(ENABLE_PRINTING) |
75 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( | 78 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( |
76 contents, | 79 contents, |
77 scoped_ptr<pdf::PDFWebContentsHelperClient>( | 80 scoped_ptr<pdf::PDFWebContentsHelperClient>( |
78 new ChromePDFWebContentsHelperClient())); | 81 new ChromePDFWebContentsHelperClient())); |
82 | |
83 // <webview> outside of Chrome Apps does not handle autofill. | |
Fady Samuel
2015/02/12 19:16:26
This should say that <webview> in Chrome Apps and
noms (inactive)
2015/02/12 19:55:28
Done.
| |
84 if (web_view_guest_->in_extension()) | |
85 return; | |
86 | |
87 autofill::ChromeAutofillClient::CreateForWebContents(contents); | |
88 ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient( | |
89 contents, | |
90 autofill::ChromeAutofillClient::FromWebContents(contents)); | |
91 autofill::ContentAutofillDriverFactory::CreateForWebContentsAndDelegate( | |
92 contents, | |
93 autofill::ChromeAutofillClient::FromWebContents(contents), | |
94 g_browser_process->GetApplicationLocale(), | |
95 autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER); | |
79 } | 96 } |
80 | 97 |
81 void ChromeWebViewGuestDelegate::OnDidCommitProvisionalLoadForFrame( | 98 void ChromeWebViewGuestDelegate::OnDidCommitProvisionalLoadForFrame( |
82 bool is_main_frame) { | 99 bool is_main_frame) { |
83 if (is_main_frame) | 100 if (is_main_frame) |
84 chromevox_injected_ = false; | 101 chromevox_injected_ = false; |
85 } | 102 } |
86 | 103 |
87 void ChromeWebViewGuestDelegate::OnDidInitialize() { | 104 void ChromeWebViewGuestDelegate::OnDidInitialize() { |
88 #if defined(OS_CHROMEOS) | 105 #if defined(OS_CHROMEOS) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { | 184 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { |
168 if (details.enabled) | 185 if (details.enabled) |
169 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); | 186 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); |
170 else | 187 else |
171 chromevox_injected_ = false; | 188 chromevox_injected_ = false; |
172 } | 189 } |
173 } | 190 } |
174 #endif | 191 #endif |
175 | 192 |
176 } // namespace extensions | 193 } // namespace extensions |
OLD | NEW |