Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc

Issue 866523002: [Abandoned] Add Autofill to the <webview> chrome://chrome-signin page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add dcheck for the chrome signin page Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/chrome_autofill_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/common/url_constants.h"
17 #include "components/autofill/content/browser/content_autofill_driver_factory.h"
14 #include "components/pdf/browser/pdf_web_contents_helper.h" 18 #include "components/pdf/browser/pdf_web_contents_helper.h"
15 #include "components/renderer_context_menu/context_menu_delegate.h" 19 #include "components/renderer_context_menu/context_menu_delegate.h"
16 #include "extensions/browser/api/web_request/web_request_api.h" 20 #include "extensions/browser/api/web_request/web_request_api.h"
17 #include "extensions/browser/guest_view/web_view/web_view_constants.h" 21 #include "extensions/browser/guest_view/web_view/web_view_constants.h"
18 22
19 #if defined(ENABLE_PRINTING) 23 #if defined(ENABLE_PRINTING)
20 #if defined(ENABLE_PRINT_PREVIEW) 24 #if defined(ENABLE_PRINT_PREVIEW)
21 #include "chrome/browser/printing/print_preview_message_handler.h" 25 #include "chrome/browser/printing/print_preview_message_handler.h"
22 #include "chrome/browser/printing/print_view_manager.h" 26 #include "chrome/browser/printing/print_view_manager.h"
23 #else 27 #else
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 printing::PrintViewManager::CreateForWebContents(contents); 73 printing::PrintViewManager::CreateForWebContents(contents);
70 printing::PrintPreviewMessageHandler::CreateForWebContents(contents); 74 printing::PrintPreviewMessageHandler::CreateForWebContents(contents);
71 #else 75 #else
72 printing::PrintViewManagerBasic::CreateForWebContents(contents); 76 printing::PrintViewManagerBasic::CreateForWebContents(contents);
73 #endif // defined(ENABLE_PRINT_PREVIEW) 77 #endif // defined(ENABLE_PRINT_PREVIEW)
74 #endif // defined(ENABLE_PRINTING) 78 #endif // defined(ENABLE_PRINTING)
75 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( 79 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(
76 contents, 80 contents,
77 scoped_ptr<pdf::PDFWebContentsHelperClient>( 81 scoped_ptr<pdf::PDFWebContentsHelperClient>(
78 new ChromePDFWebContentsHelperClient())); 82 new ChromePDFWebContentsHelperClient()));
83
84 // <webview> in Chrome Apps and Extensions does not handle autofill.
85 if (web_view_guest_->in_extension())
86 return;
87
88 // Currently the Chrome sign in page is the only page that uses <webview>.
89 // If this changes in the future, revisit the use of autofill.
90 DCHECK(web_view_guest_->GetOwnerSiteURL().GetOrigin().spec() ==
engedy 2015/02/18 13:34:27 @Joel, given that there is security implications o
Fady Samuel 2015/02/18 14:08:20 I have another maybe insignificant concern: this i
noms (inactive) 2015/02/18 18:33:12 I've made it a hard return (this was my original s
jww 2015/02/18 20:08:45 I think engedy is right, it should be a CHECK(), n
noms (inactive) 2015/02/18 21:04:03 I don't think I understand how this is a security
91 chrome::kChromeUIChromeSigninURL);
92
93 autofill::ChromeAutofillClient::CreateForWebContents(contents);
94 ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient(
engedy 2015/02/18 13:34:27 Could you please add a TODO that this will need to
engedy 2015/02/18 13:35:28 ... does not support ...
noms (inactive) 2015/02/18 18:33:12 Done.
95 contents,
96 autofill::ChromeAutofillClient::FromWebContents(contents));
97 autofill::ContentAutofillDriverFactory::CreateForWebContentsAndDelegate(
98 contents,
99 autofill::ChromeAutofillClient::FromWebContents(contents),
100 g_browser_process->GetApplicationLocale(),
101 autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER);
79 } 102 }
80 103
81 void ChromeWebViewGuestDelegate::OnDidCommitProvisionalLoadForFrame( 104 void ChromeWebViewGuestDelegate::OnDidCommitProvisionalLoadForFrame(
82 bool is_main_frame) { 105 bool is_main_frame) {
83 if (is_main_frame) 106 if (is_main_frame)
84 chromevox_injected_ = false; 107 chromevox_injected_ = false;
85 } 108 }
86 109
87 void ChromeWebViewGuestDelegate::OnDidInitialize() { 110 void ChromeWebViewGuestDelegate::OnDidInitialize() {
88 #if defined(OS_CHROMEOS) 111 #if defined(OS_CHROMEOS)
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { 190 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) {
168 if (details.enabled) 191 if (details.enabled)
169 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); 192 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost());
170 else 193 else
171 chromevox_injected_ = false; 194 chromevox_injected_ = false;
172 } 195 }
173 } 196 }
174 #endif 197 #endif
175 198
176 } // namespace extensions 199 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/chrome_autofill_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698