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

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

Issue 944513002: Revert of Add Autofill to the <webview> chrome://chrome-signin page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
5 #include "chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h" 6 #include "chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h"
6 7
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"
11 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" 11 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
13 #include "chrome/browser/ui/autofill/chrome_autofill_client.h"
14 #include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h" 12 #include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h"
15 #include "chrome/common/chrome_version_info.h" 13 #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"
18 #include "components/pdf/browser/pdf_web_contents_helper.h" 14 #include "components/pdf/browser/pdf_web_contents_helper.h"
19 #include "components/renderer_context_menu/context_menu_delegate.h" 15 #include "components/renderer_context_menu/context_menu_delegate.h"
20 #include "extensions/browser/api/web_request/web_request_api.h" 16 #include "extensions/browser/api/web_request/web_request_api.h"
21 #include "extensions/browser/guest_view/web_view/web_view_constants.h" 17 #include "extensions/browser/guest_view/web_view/web_view_constants.h"
22 18
23 #if defined(ENABLE_PRINTING) 19 #if defined(ENABLE_PRINTING)
24 #if defined(ENABLE_PRINT_PREVIEW) 20 #if defined(ENABLE_PRINT_PREVIEW)
25 #include "chrome/browser/printing/print_preview_message_handler.h" 21 #include "chrome/browser/printing/print_preview_message_handler.h"
26 #include "chrome/browser/printing/print_view_manager.h" 22 #include "chrome/browser/printing/print_view_manager.h"
27 #else 23 #else
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 printing::PrintViewManager::CreateForWebContents(contents); 69 printing::PrintViewManager::CreateForWebContents(contents);
74 printing::PrintPreviewMessageHandler::CreateForWebContents(contents); 70 printing::PrintPreviewMessageHandler::CreateForWebContents(contents);
75 #else 71 #else
76 printing::PrintViewManagerBasic::CreateForWebContents(contents); 72 printing::PrintViewManagerBasic::CreateForWebContents(contents);
77 #endif // defined(ENABLE_PRINT_PREVIEW) 73 #endif // defined(ENABLE_PRINT_PREVIEW)
78 #endif // defined(ENABLE_PRINTING) 74 #endif // defined(ENABLE_PRINTING)
79 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( 75 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(
80 contents, 76 contents,
81 scoped_ptr<pdf::PDFWebContentsHelperClient>( 77 scoped_ptr<pdf::PDFWebContentsHelperClient>(
82 new ChromePDFWebContentsHelperClient())); 78 new ChromePDFWebContentsHelperClient()));
83
84 // Currently, autofill is only enabled for the Chrome sign in page.
85 // TODO(fsamuel): If this changes in the future, revisit the use of autofill
86 // in <webview>.
87 if (web_view_guest_->GetOwnerSiteURL().GetOrigin().spec() !=
88 chrome::kChromeUIChromeSigninURL) {
89 return;
90 }
91
92 autofill::ChromeAutofillClient::CreateForWebContents(contents);
93 ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient(
94 contents,
95 autofill::ChromeAutofillClient::FromWebContents(contents));
96 autofill::ContentAutofillDriverFactory::CreateForWebContentsAndDelegate(
97 contents,
98 autofill::ChromeAutofillClient::FromWebContents(contents),
99 g_browser_process->GetApplicationLocale(),
100 autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER);
101 } 79 }
102 80
103 void ChromeWebViewGuestDelegate::OnDidCommitProvisionalLoadForFrame( 81 void ChromeWebViewGuestDelegate::OnDidCommitProvisionalLoadForFrame(
104 bool is_main_frame) { 82 bool is_main_frame) {
105 if (is_main_frame) 83 if (is_main_frame)
106 chromevox_injected_ = false; 84 chromevox_injected_ = false;
107 } 85 }
108 86
109 void ChromeWebViewGuestDelegate::OnDidInitialize() { 87 void ChromeWebViewGuestDelegate::OnDidInitialize() {
110 #if defined(OS_CHROMEOS) 88 #if defined(OS_CHROMEOS)
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { 167 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) {
190 if (details.enabled) 168 if (details.enabled)
191 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); 169 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost());
192 else 170 else
193 chromevox_injected_ = false; 171 chromevox_injected_ = false;
194 } 172 }
195 } 173 }
196 #endif 174 #endif
197 175
198 } // namespace extensions 176 } // 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