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

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

Issue 9148032: [Web Intents] Refactor picker to use WebIntentPickerModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: groby's fix Created 8 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 | Annotate | Revision Log
OLDNEW
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 "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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "chrome/browser/autocomplete_history_manager.h" 9 #include "chrome/browser/autocomplete_history_manager.h"
10 #include "chrome/browser/autofill/autofill_external_delegate.h" 10 #include "chrome/browser/autofill/autofill_external_delegate.h"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" 28 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h"
29 #include "chrome/browser/sessions/restore_tab_helper.h" 29 #include "chrome/browser/sessions/restore_tab_helper.h"
30 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" 30 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h"
31 #include "chrome/browser/tab_contents/thumbnail_generator.h" 31 #include "chrome/browser/tab_contents/thumbnail_generator.h"
32 #include "chrome/browser/translate/translate_tab_helper.h" 32 #include "chrome/browser/translate/translate_tab_helper.h"
33 #include "chrome/browser/ui/alternate_error_tab_observer.h" 33 #include "chrome/browser/ui/alternate_error_tab_observer.h"
34 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" 34 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h"
35 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" 35 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
36 #include "chrome/browser/ui/constrained_window_tab_helper.h" 36 #include "chrome/browser/ui/constrained_window_tab_helper.h"
37 #include "chrome/browser/ui/find_bar/find_tab_helper.h" 37 #include "chrome/browser/ui/find_bar/find_tab_helper.h"
38 #include "chrome/browser/ui/intents/web_intent_picker_factory_impl.h"
39 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" 38 #include "chrome/browser/ui/intents/web_intent_picker_controller.h"
40 #include "chrome/browser/ui/pdf/pdf_tab_observer.h" 39 #include "chrome/browser/ui/pdf/pdf_tab_observer.h"
41 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" 40 #include "chrome/browser/ui/prefs/prefs_tab_helper.h"
42 #include "chrome/browser/ui/sad_tab_observer.h" 41 #include "chrome/browser/ui/sad_tab_observer.h"
43 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" 42 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h"
44 #include "chrome/browser/ui/snapshot_tab_helper.h" 43 #include "chrome/browser/ui/snapshot_tab_helper.h"
45 #include "chrome/browser/ui/sync/tab_contents_wrapper_synced_tab_delegate.h" 44 #include "chrome/browser/ui/sync/tab_contents_wrapper_synced_tab_delegate.h"
46 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" 45 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
47 #include "chrome/common/chrome_switches.h" 46 #include "chrome/common/chrome_switches.h"
48 #include "content/public/browser/web_contents.h" 47 #include "content/public/browser/web_contents.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 prefs_tab_helper_.reset(new PrefsTabHelper(contents)); 96 prefs_tab_helper_.reset(new PrefsTabHelper(contents));
98 prerender_tab_helper_.reset(new prerender::PrerenderTabHelper(this)); 97 prerender_tab_helper_.reset(new prerender::PrerenderTabHelper(this));
99 print_view_manager_.reset(new printing::PrintViewManager(this)); 98 print_view_manager_.reset(new printing::PrintViewManager(this));
100 restore_tab_helper_.reset(new RestoreTabHelper(contents)); 99 restore_tab_helper_.reset(new RestoreTabHelper(contents));
101 search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); 100 search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents));
102 snapshot_tab_helper_.reset(new SnapshotTabHelper(contents)); 101 snapshot_tab_helper_.reset(new SnapshotTabHelper(contents));
103 ssl_helper_.reset(new TabContentsSSLHelper(this)); 102 ssl_helper_.reset(new TabContentsSSLHelper(this));
104 synced_tab_delegate_.reset(new TabContentsWrapperSyncedTabDelegate(this)); 103 synced_tab_delegate_.reset(new TabContentsWrapperSyncedTabDelegate(this));
105 content_settings_.reset(new TabSpecificContentSettings(contents)); 104 content_settings_.reset(new TabSpecificContentSettings(contents));
106 translate_tab_helper_.reset(new TranslateTabHelper(contents)); 105 translate_tab_helper_.reset(new TranslateTabHelper(contents));
107 web_intent_picker_controller_.reset(new WebIntentPickerController( 106 web_intent_picker_controller_.reset(new WebIntentPickerController(this));
108 this, new WebIntentPickerFactoryImpl()));
109 107
110 // Create the per-tab observers. 108 // Create the per-tab observers.
111 alternate_error_page_tab_observer_.reset( 109 alternate_error_page_tab_observer_.reset(
112 new AlternateErrorPageTabObserver(contents)); 110 new AlternateErrorPageTabObserver(contents));
113 download_request_limiter_observer_.reset( 111 download_request_limiter_observer_.reset(
114 new DownloadRequestLimiterObserver(contents)); 112 new DownloadRequestLimiterObserver(contents));
115 webnavigation_observer_.reset( 113 webnavigation_observer_.reset(
116 new ExtensionWebNavigationTabObserver(contents)); 114 new ExtensionWebNavigationTabObserver(contents));
117 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); 115 external_protocol_observer_.reset(new ExternalProtocolObserver(contents));
118 if (OmniboxSearchHint::IsEnabled(profile())) 116 if (OmniboxSearchHint::IsEnabled(profile()))
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 182
185 //////////////////////////////////////////////////////////////////////////////// 183 ////////////////////////////////////////////////////////////////////////////////
186 // WebContentsObserver overrides 184 // WebContentsObserver overrides
187 185
188 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { 186 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) {
189 // Destruction of the WebContents should only be done by us from our 187 // Destruction of the WebContents should only be done by us from our
190 // destructor. Otherwise it's very likely we (or one of the helpers we own) 188 // destructor. Otherwise it's very likely we (or one of the helpers we own)
191 // will attempt to access the TabContents and we'll crash. 189 // will attempt to access the TabContents and we'll crash.
192 DCHECK(in_destructor_); 190 DCHECK(in_destructor_);
193 } 191 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/intents/web_intent_picker_model_unittest.cc ('k') | chrome/browser/ui/views/web_intent_picker_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698