| 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 "content/browser/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "chrome/browser/omnibox_search_hint.h" | 39 #include "chrome/browser/omnibox_search_hint.h" |
| 40 #include "chrome/browser/pdf_unsupported_feature.h" | 40 #include "chrome/browser/pdf_unsupported_feature.h" |
| 41 #include "chrome/browser/platform_util.h" | 41 #include "chrome/browser/platform_util.h" |
| 42 #include "chrome/browser/plugin_observer.h" | 42 #include "chrome/browser/plugin_observer.h" |
| 43 #include "chrome/browser/profiles/profile.h" | 43 #include "chrome/browser/profiles/profile.h" |
| 44 #include "chrome/browser/renderer_host/web_cache_manager.h" | 44 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 45 #include "chrome/browser/renderer_preferences_util.h" | 45 #include "chrome/browser/renderer_preferences_util.h" |
| 46 #include "chrome/browser/safe_browsing/client_side_detection_host.h" | 46 #include "chrome/browser/safe_browsing/client_side_detection_host.h" |
| 47 #include "chrome/browser/sessions/session_types.h" | 47 #include "chrome/browser/sessions/session_types.h" |
| 48 #include "chrome/browser/tab_contents/infobar_delegate.h" | 48 #include "chrome/browser/tab_contents/infobar_delegate.h" |
| 49 #include "chrome/browser/tab_contents/introducer_handler.h" |
| 49 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" | 50 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" |
| 50 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 51 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
| 51 #include "chrome/browser/translate/page_translated_details.h" | 52 #include "chrome/browser/translate/page_translated_details.h" |
| 52 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" | 53 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" |
| 53 #include "chrome/browser/ui/browser_dialogs.h" | 54 #include "chrome/browser/ui/browser_dialogs.h" |
| 54 #include "chrome/common/bindings_policy.h" | 55 #include "chrome/common/bindings_policy.h" |
| 55 #include "chrome/common/chrome_constants.h" | 56 #include "chrome/common/chrome_constants.h" |
| 56 #include "chrome/common/chrome_switches.h" | 57 #include "chrome/common/chrome_switches.h" |
| 57 #include "chrome/common/content_restriction.h" | 58 #include "chrome/common/content_restriction.h" |
| 58 #include "chrome/common/extensions/extension.h" | 59 #include "chrome/common/extensions/extension.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 base::TimeTicks::Now() - tab_close_start_time_); | 373 base::TimeTicks::Now() - tab_close_start_time_); |
| 373 } | 374 } |
| 374 | 375 |
| 375 FOR_EACH_OBSERVER(TabContentsObserver, observers_, TabContentsDestroyed()); | 376 FOR_EACH_OBSERVER(TabContentsObserver, observers_, TabContentsDestroyed()); |
| 376 | 377 |
| 377 net::NetworkChangeNotifier::RemoveOnlineStateObserver(this); | 378 net::NetworkChangeNotifier::RemoveOnlineStateObserver(this); |
| 378 } | 379 } |
| 379 | 380 |
| 380 void TabContents::AddObservers() { | 381 void TabContents::AddObservers() { |
| 381 favicon_helper_.reset(new FaviconHelper(this)); | 382 favicon_helper_.reset(new FaviconHelper(this)); |
| 383 introducer_handler_.reset(IntroducerService::Make(this)); |
| 382 desktop_notification_handler_.reset( | 384 desktop_notification_handler_.reset( |
| 383 new DesktopNotificationHandlerForTC(this, GetRenderProcessHost())); | 385 new DesktopNotificationHandlerForTC(this, GetRenderProcessHost())); |
| 384 plugin_observer_.reset(new PluginObserver(this)); | 386 plugin_observer_.reset(new PluginObserver(this)); |
| 385 safebrowsing_detection_host_.reset(new safe_browsing::ClientSideDetectionHost( | 387 safebrowsing_detection_host_.reset(new safe_browsing::ClientSideDetectionHost( |
| 386 this)); | 388 this)); |
| 387 net::NetworkChangeNotifier::AddOnlineStateObserver(this); | 389 net::NetworkChangeNotifier::AddOnlineStateObserver(this); |
| 388 } | 390 } |
| 389 | 391 |
| 390 bool TabContents::OnMessageReceived(const IPC::Message& message) { | 392 bool TabContents::OnMessageReceived(const IPC::Message& message) { |
| 391 ObserverListBase<TabContentsObserver>::Iterator it(observers_); | 393 ObserverListBase<TabContentsObserver>::Iterator it(observers_); |
| (...skipping 2359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2751 | 2753 |
| 2752 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2754 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2753 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2755 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 2754 rwh_view->SetSize(view()->GetContainerSize()); | 2756 rwh_view->SetSize(view()->GetContainerSize()); |
| 2755 } | 2757 } |
| 2756 | 2758 |
| 2757 void TabContents::OnOnlineStateChanged(bool online) { | 2759 void TabContents::OnOnlineStateChanged(bool online) { |
| 2758 render_view_host()->Send(new ViewMsg_NetworkStateChanged( | 2760 render_view_host()->Send(new ViewMsg_NetworkStateChanged( |
| 2759 render_view_host()->routing_id(), online)); | 2761 render_view_host()->routing_id(), online)); |
| 2760 } | 2762 } |
| OLD | NEW |