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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 } | 382 } |
383 | 383 |
384 FOR_EACH_OBSERVER(TabContentsObserver, observers_, TabContentsDestroyed()); | 384 FOR_EACH_OBSERVER(TabContentsObserver, observers_, TabContentsDestroyed()); |
385 | 385 |
386 net::NetworkChangeNotifier::RemoveOnlineStateObserver(this); | 386 net::NetworkChangeNotifier::RemoveOnlineStateObserver(this); |
387 } | 387 } |
388 | 388 |
389 void TabContents::AddObservers() { | 389 void TabContents::AddObservers() { |
390 printing_.reset(new printing::PrintViewManager(this)); | 390 printing_.reset(new printing::PrintViewManager(this)); |
391 print_preview_.reset(new printing::PrintPreviewMessageHandler(this)); | 391 print_preview_.reset(new printing::PrintPreviewMessageHandler(this)); |
392 fav_icon_helper_.reset(new FaviconHelper(this)); | 392 favicon_helper_.reset(new FaviconHelper(this)); |
393 autofill_manager_.reset(new AutofillManager(this)); | 393 autofill_manager_.reset(new AutofillManager(this)); |
394 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(this)); | 394 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(this)); |
395 desktop_notification_handler_.reset( | 395 desktop_notification_handler_.reset( |
396 new DesktopNotificationHandlerForTC(this, GetRenderProcessHost())); | 396 new DesktopNotificationHandlerForTC(this, GetRenderProcessHost())); |
397 plugin_observer_.reset(new PluginObserver(this)); | 397 plugin_observer_.reset(new PluginObserver(this)); |
398 safebrowsing_detection_host_.reset(new safe_browsing::ClientSideDetectionHost( | 398 safebrowsing_detection_host_.reset(new safe_browsing::ClientSideDetectionHost( |
399 this)); | 399 this)); |
400 net::NetworkChangeNotifier::AddOnlineStateObserver(this); | 400 net::NetworkChangeNotifier::AddOnlineStateObserver(this); |
401 } | 401 } |
402 | 402 |
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1660 // clicking on a link); see bugs 1184641 and 980803. We don't want to | 1660 // clicking on a link); see bugs 1184641 and 980803. We don't want to |
1661 // clear the bubble when a user navigates to a named anchor in the same | 1661 // clear the bubble when a user navigates to a named anchor in the same |
1662 // page. | 1662 // page. |
1663 UpdateTargetURL(details.entry->page_id(), GURL()); | 1663 UpdateTargetURL(details.entry->page_id(), GURL()); |
1664 } | 1664 } |
1665 | 1665 |
1666 // Allow the new page to set the title again. | 1666 // Allow the new page to set the title again. |
1667 received_page_title_ = false; | 1667 received_page_title_ = false; |
1668 | 1668 |
1669 // Get the favicon, either from history or request it from the net. | 1669 // Get the favicon, either from history or request it from the net. |
1670 fav_icon_helper_->FetchFavicon(details.entry->url()); | 1670 favicon_helper_->FetchFavicon(details.entry->url()); |
1671 | 1671 |
1672 // Clear all page actions, blocked content notifications and browser actions | 1672 // Clear all page actions, blocked content notifications and browser actions |
1673 // for this tab, unless this is an in-page navigation. | 1673 // for this tab, unless this is an in-page navigation. |
1674 if (!details.is_in_page) { | 1674 if (!details.is_in_page) { |
1675 ExtensionService* service = profile()->GetExtensionService(); | 1675 ExtensionService* service = profile()->GetExtensionService(); |
1676 if (service) { | 1676 if (service) { |
1677 for (size_t i = 0; i < service->extensions()->size(); ++i) { | 1677 for (size_t i = 0; i < service->extensions()->size(); ++i) { |
1678 ExtensionAction* browser_action = | 1678 ExtensionAction* browser_action = |
1679 service->extensions()->at(i)->browser_action(); | 1679 service->extensions()->at(i)->browser_action(); |
1680 if (browser_action) { | 1680 if (browser_action) { |
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2817 | 2817 |
2818 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2818 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2819 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2819 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
2820 rwh_view->SetSize(view()->GetContainerSize()); | 2820 rwh_view->SetSize(view()->GetContainerSize()); |
2821 } | 2821 } |
2822 | 2822 |
2823 void TabContents::OnOnlineStateChanged(bool online) { | 2823 void TabContents::OnOnlineStateChanged(bool online) { |
2824 render_view_host()->Send(new ViewMsg_NetworkStateChanged( | 2824 render_view_host()->Send(new ViewMsg_NetworkStateChanged( |
2825 render_view_host()->routing_id(), online)); | 2825 render_view_host()->routing_id(), online)); |
2826 } | 2826 } |
OLD | NEW |