| 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/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "chrome/browser/load_from_memory_cache_details.h" | 46 #include "chrome/browser/load_from_memory_cache_details.h" |
| 47 #include "chrome/browser/load_notification_details.h" | 47 #include "chrome/browser/load_notification_details.h" |
| 48 #include "chrome/browser/metrics/metric_event_duration_details.h" | 48 #include "chrome/browser/metrics/metric_event_duration_details.h" |
| 49 #include "chrome/browser/metrics/user_metrics.h" | 49 #include "chrome/browser/metrics/user_metrics.h" |
| 50 #include "chrome/browser/modal_html_dialog_delegate.h" | 50 #include "chrome/browser/modal_html_dialog_delegate.h" |
| 51 #include "chrome/browser/omnibox_search_hint.h" | 51 #include "chrome/browser/omnibox_search_hint.h" |
| 52 #include "chrome/browser/platform_util.h" | 52 #include "chrome/browser/platform_util.h" |
| 53 #include "chrome/browser/plugin_installer.h" | 53 #include "chrome/browser/plugin_installer.h" |
| 54 #include "chrome/browser/prefs/pref_service.h" | 54 #include "chrome/browser/prefs/pref_service.h" |
| 55 #include "chrome/browser/prerender/prerender_manager.h" | 55 #include "chrome/browser/prerender/prerender_manager.h" |
| 56 #include "chrome/browser/printing/print_preview_tab_controller.h" | 56 #include "chrome/browser/printing/print_preview_manager.h" |
| 57 #include "chrome/browser/printing/print_view_manager.h" | 57 #include "chrome/browser/printing/print_view_manager.h" |
| 58 #include "chrome/browser/profiles/profile.h" | 58 #include "chrome/browser/profiles/profile.h" |
| 59 #include "chrome/browser/renderer_host/render_process_host.h" | 59 #include "chrome/browser/renderer_host/render_process_host.h" |
| 60 #include "chrome/browser/renderer_host/render_view_host.h" | 60 #include "chrome/browser/renderer_host/render_view_host.h" |
| 61 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 61 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 62 #include "chrome/browser/renderer_host/resource_request_details.h" | 62 #include "chrome/browser/renderer_host/resource_request_details.h" |
| 63 #include "chrome/browser/renderer_host/site_instance.h" | 63 #include "chrome/browser/renderer_host/site_instance.h" |
| 64 #include "chrome/browser/renderer_host/web_cache_manager.h" | 64 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 65 #include "chrome/browser/renderer_preferences_util.h" | 65 #include "chrome/browser/renderer_preferences_util.h" |
| 66 #include "chrome/browser/search_engines/template_url.h" | 66 #include "chrome/browser/search_engines/template_url.h" |
| (...skipping 2700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2767 void TabContents::RequestMove(const gfx::Rect& new_bounds) { | 2767 void TabContents::RequestMove(const gfx::Rect& new_bounds) { |
| 2768 if (delegate() && delegate()->IsPopup(this)) | 2768 if (delegate() && delegate()->IsPopup(this)) |
| 2769 delegate()->MoveContents(this, new_bounds); | 2769 delegate()->MoveContents(this, new_bounds); |
| 2770 } | 2770 } |
| 2771 | 2771 |
| 2772 void TabContents::DidStartLoading() { | 2772 void TabContents::DidStartLoading() { |
| 2773 SetIsLoading(true, NULL); | 2773 SetIsLoading(true, NULL); |
| 2774 | 2774 |
| 2775 if (delegate()) { | 2775 if (delegate()) { |
| 2776 bool is_print_preview_tab = | 2776 bool is_print_preview_tab = |
| 2777 printing::PrintPreviewTabController::IsPrintPreviewTab(this); | 2777 printing::PrintPreviewManager::IsPrintPreviewTab(this); |
| 2778 if (content_restrictions_ || is_print_preview_tab) { | 2778 if (content_restrictions_ || is_print_preview_tab) { |
| 2779 content_restrictions_= is_print_preview_tab ? | 2779 content_restrictions_= is_print_preview_tab ? |
| 2780 CONTENT_RESTRICTION_PRINT : 0; | 2780 CONTENT_RESTRICTION_PRINT : 0; |
| 2781 delegate()->ContentRestrictionsChanged(this); | 2781 delegate()->ContentRestrictionsChanged(this); |
| 2782 } | 2782 } |
| 2783 } | 2783 } |
| 2784 | 2784 |
| 2785 // Notify observers about navigation. | 2785 // Notify observers about navigation. |
| 2786 FOR_EACH_OBSERVER(WebNavigationObserver, web_navigation_observers_, | 2786 FOR_EACH_OBSERVER(WebNavigationObserver, web_navigation_observers_, |
| 2787 DidStartLoading()); | 2787 DidStartLoading()); |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3378 } | 3378 } |
| 3379 | 3379 |
| 3380 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 3380 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
| 3381 render_manager_.SwapInRenderViewHost(rvh); | 3381 render_manager_.SwapInRenderViewHost(rvh); |
| 3382 } | 3382 } |
| 3383 | 3383 |
| 3384 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 3384 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 3385 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 3385 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 3386 rwh_view->SetSize(view()->GetContainerSize()); | 3386 rwh_view->SetSize(view()->GetContainerSize()); |
| 3387 } | 3387 } |
| OLD | NEW |