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

Side by Side Diff: chrome/browser/ui/tab_contents/tab_contents_wrapper.cc

Issue 8353025: External autofill delegates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Carnitasify Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 5 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 8
9 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
10 #include "base/stringprintf.h" 11 #include "base/stringprintf.h"
11 #include "chrome/browser/autocomplete_history_manager.h" 12 #include "chrome/browser/autocomplete_history_manager.h"
13 #include "chrome/browser/autofill/autofill_external_delegate.h"
12 #include "chrome/browser/autofill/autofill_manager.h" 14 #include "chrome/browser/autofill/autofill_manager.h"
13 #include "chrome/browser/automation/automation_tab_helper.h" 15 #include "chrome/browser/automation/automation_tab_helper.h"
14 #include "chrome/browser/browser_process.h" 16 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 17 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
16 #include "chrome/browser/download/download_request_limiter_observer.h" 18 #include "chrome/browser/download/download_request_limiter_observer.h"
17 #include "chrome/browser/extensions/extension_tab_helper.h" 19 #include "chrome/browser/extensions/extension_tab_helper.h"
18 #include "chrome/browser/extensions/extension_webnavigation_api.h" 20 #include "chrome/browser/extensions/extension_webnavigation_api.h"
19 #include "chrome/browser/external_protocol/external_protocol_observer.h" 21 #include "chrome/browser/external_protocol/external_protocol_observer.h"
20 #include "chrome/browser/favicon/favicon_tab_helper.h" 22 #include "chrome/browser/favicon/favicon_tab_helper.h"
21 #include "chrome/browser/google/google_util.h" 23 #include "chrome/browser/google/google_util.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 tab_contents_(contents) { 242 tab_contents_(contents) {
241 DCHECK(contents); 243 DCHECK(contents);
242 DCHECK(!GetCurrentWrapperForContents(contents)); 244 DCHECK(!GetCurrentWrapperForContents(contents));
243 // Stash this in the property bag so it can be retrieved without having to 245 // Stash this in the property bag so it can be retrieved without having to
244 // go to a Browser. 246 // go to a Browser.
245 property_accessor()->SetProperty(contents->property_bag(), this); 247 property_accessor()->SetProperty(contents->property_bag(), this);
246 248
247 // Create the tab helpers. 249 // Create the tab helpers.
248 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); 250 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents));
249 autofill_manager_.reset(new AutofillManager(this)); 251 autofill_manager_.reset(new AutofillManager(this));
252 if (CommandLine::ForCurrentProcess()->HasSwitch(
253 switches::kExternalAutofillPopup)) {
254 autofill_external_delegate_.reset(
255 AutofillExternalDelegate::create(this, autofill_manager_.get()));
256 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get());
257 autocomplete_history_manager_->SetExternalDelegate(
258 autofill_external_delegate_.get());
259 }
250 automation_tab_helper_.reset(new AutomationTabHelper(contents)); 260 automation_tab_helper_.reset(new AutomationTabHelper(contents));
251 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); 261 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this));
252 bookmark_tab_helper_.reset(new BookmarkTabHelper(this)); 262 bookmark_tab_helper_.reset(new BookmarkTabHelper(this));
253 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); 263 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this));
254 extension_tab_helper_.reset(new ExtensionTabHelper(this)); 264 extension_tab_helper_.reset(new ExtensionTabHelper(this));
255 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); 265 favicon_tab_helper_.reset(new FaviconTabHelper(contents));
256 find_tab_helper_.reset(new FindTabHelper(contents)); 266 find_tab_helper_.reset(new FindTabHelper(contents));
257 history_tab_helper_.reset(new HistoryTabHelper(contents)); 267 history_tab_helper_.reset(new HistoryTabHelper(contents));
258 infobar_tab_helper_.reset(new InfoBarTabHelper(contents)); 268 infobar_tab_helper_.reset(new InfoBarTabHelper(contents));
259 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(this)); 269 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(this));
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 render_view_host()->Send( 682 render_view_host()->Send(
673 new ChromeViewMsg_SetClientSidePhishingDetection(routing_id(), 683 new ChromeViewMsg_SetClientSidePhishingDetection(routing_id(),
674 safe_browsing)); 684 safe_browsing));
675 #endif 685 #endif
676 } 686 }
677 687
678 void TabContentsWrapper::ExitFullscreenMode() { 688 void TabContentsWrapper::ExitFullscreenMode() {
679 if (tab_contents() && render_view_host()) 689 if (tab_contents() && render_view_host())
680 tab_contents()->render_view_host()->ExitFullscreen(); 690 tab_contents()->render_view_host()->ExitFullscreen();
681 } 691 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698