OLD | NEW |
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/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 40 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
41 #include "chrome/browser/themes/theme_service.h" | 41 #include "chrome/browser/themes/theme_service.h" |
42 #include "chrome/browser/themes/theme_service_factory.h" | 42 #include "chrome/browser/themes/theme_service_factory.h" |
43 #include "chrome/browser/translate/translate_tab_helper.h" | 43 #include "chrome/browser/translate/translate_tab_helper.h" |
44 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 44 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
45 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 45 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
46 #include "chrome/browser/ui/constrained_window_tab_helper.h" | 46 #include "chrome/browser/ui/constrained_window_tab_helper.h" |
47 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 47 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
48 #include "chrome/browser/ui/intents/web_intent_picker_factory_impl.h" | 48 #include "chrome/browser/ui/intents/web_intent_picker_factory_impl.h" |
49 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" | 49 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
| 50 #include "chrome/browser/ui/sad_tab_observer.h" |
50 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 51 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
51 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h" | 52 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h" |
52 #include "chrome/common/chrome_notification_types.h" | 53 #include "chrome/common/chrome_notification_types.h" |
53 #include "chrome/common/chrome_switches.h" | 54 #include "chrome/common/chrome_switches.h" |
54 #include "chrome/common/pref_names.h" | 55 #include "chrome/common/pref_names.h" |
55 #include "chrome/common/render_messages.h" | 56 #include "chrome/common/render_messages.h" |
56 #include "content/browser/renderer_host/render_view_host.h" | 57 #include "content/browser/renderer_host/render_view_host.h" |
57 #include "content/browser/tab_contents/tab_contents_view.h" | 58 #include "content/browser/tab_contents/tab_contents_view.h" |
58 #include "content/public/browser/notification_service.h" | 59 #include "content/public/browser/notification_service.h" |
59 #include "grit/generated_resources.h" | 60 #include "grit/generated_resources.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 this, new WebIntentPickerFactoryImpl())); | 300 this, new WebIntentPickerFactoryImpl())); |
300 | 301 |
301 // Create the per-tab observers. | 302 // Create the per-tab observers. |
302 download_request_limiter_observer_.reset( | 303 download_request_limiter_observer_.reset( |
303 new DownloadRequestLimiterObserver(contents)); | 304 new DownloadRequestLimiterObserver(contents)); |
304 webnavigation_observer_.reset( | 305 webnavigation_observer_.reset( |
305 new ExtensionWebNavigationTabObserver(contents)); | 306 new ExtensionWebNavigationTabObserver(contents)); |
306 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); | 307 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); |
307 plugin_observer_.reset(new PluginObserver(this)); | 308 plugin_observer_.reset(new PluginObserver(this)); |
308 print_preview_.reset(new printing::PrintPreviewMessageHandler(contents)); | 309 print_preview_.reset(new printing::PrintPreviewMessageHandler(contents)); |
| 310 sad_tab_observer_.reset(new SadTabObserver(contents)); |
309 // Start the in-browser thumbnailing if the feature is enabled. | 311 // Start the in-browser thumbnailing if the feature is enabled. |
310 if (switches::IsInBrowserThumbnailingEnabled()) { | 312 if (switches::IsInBrowserThumbnailingEnabled()) { |
311 thumbnail_generation_observer_.reset(new ThumbnailGenerator); | 313 thumbnail_generation_observer_.reset(new ThumbnailGenerator); |
312 thumbnail_generation_observer_->StartThumbnailing(tab_contents_.get()); | 314 thumbnail_generation_observer_->StartThumbnailing(tab_contents_.get()); |
313 } | 315 } |
314 | 316 |
315 // Set-up the showing of the omnibox search infobar if applicable. | 317 // Set-up the showing of the omnibox search infobar if applicable. |
316 if (OmniboxSearchHint::IsEnabled(profile())) | 318 if (OmniboxSearchHint::IsEnabled(profile())) |
317 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); | 319 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); |
318 | 320 |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 render_view_host()->Send( | 713 render_view_host()->Send( |
712 new ChromeViewMsg_SetClientSidePhishingDetection(routing_id(), | 714 new ChromeViewMsg_SetClientSidePhishingDetection(routing_id(), |
713 safe_browsing)); | 715 safe_browsing)); |
714 #endif | 716 #endif |
715 } | 717 } |
716 | 718 |
717 void TabContentsWrapper::ExitFullscreenMode() { | 719 void TabContentsWrapper::ExitFullscreenMode() { |
718 if (tab_contents() && render_view_host()) | 720 if (tab_contents() && render_view_host()) |
719 tab_contents()->render_view_host()->ExitFullscreen(); | 721 tab_contents()->render_view_host()->ExitFullscreen(); |
720 } | 722 } |
OLD | NEW |