| 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/browser/external_protocol_handler.h" | 29 #include "chrome/browser/external_protocol_handler.h" |
| 30 #include "chrome/browser/favicon_service.h" | 30 #include "chrome/browser/favicon_service.h" |
| 31 #include "chrome/browser/google/google_util.h" | 31 #include "chrome/browser/google/google_util.h" |
| 32 #include "chrome/browser/history/history.h" | 32 #include "chrome/browser/history/history.h" |
| 33 #include "chrome/browser/history/history_types.h" | 33 #include "chrome/browser/history/history_types.h" |
| 34 #include "chrome/browser/load_from_memory_cache_details.h" | 34 #include "chrome/browser/load_from_memory_cache_details.h" |
| 35 #include "chrome/browser/load_notification_details.h" | 35 #include "chrome/browser/load_notification_details.h" |
| 36 #include "chrome/browser/metrics/metric_event_duration_details.h" | 36 #include "chrome/browser/metrics/metric_event_duration_details.h" |
| 37 #include "chrome/browser/metrics/user_metrics.h" | 37 #include "chrome/browser/metrics/user_metrics.h" |
| 38 #include "chrome/browser/notifications/desktop_notification_service.h" | 38 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 39 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | |
| 40 #include "chrome/browser/omnibox_search_hint.h" | 39 #include "chrome/browser/omnibox_search_hint.h" |
| 41 #include "chrome/browser/pdf_unsupported_feature.h" | 40 #include "chrome/browser/pdf_unsupported_feature.h" |
| 42 #include "chrome/browser/platform_util.h" | 41 #include "chrome/browser/platform_util.h" |
| 43 #include "chrome/browser/plugin_observer.h" | 42 #include "chrome/browser/plugin_observer.h" |
| 44 #include "chrome/browser/prefs/pref_service.h" | 43 #include "chrome/browser/prefs/pref_service.h" |
| 45 #include "chrome/browser/profiles/profile.h" | 44 #include "chrome/browser/profiles/profile.h" |
| 46 #include "chrome/browser/renderer_host/web_cache_manager.h" | 45 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 47 #include "chrome/browser/renderer_preferences_util.h" | 46 #include "chrome/browser/renderer_preferences_util.h" |
| 48 #include "chrome/browser/safe_browsing/client_side_detection_host.h" | 47 #include "chrome/browser/safe_browsing/client_side_detection_host.h" |
| 49 #include "chrome/browser/sessions/session_types.h" | 48 #include "chrome/browser/sessions/session_types.h" |
| (...skipping 2351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2401 } | 2400 } |
| 2402 | 2401 |
| 2403 void TabContents::WorkerCrashed() { | 2402 void TabContents::WorkerCrashed() { |
| 2404 if (delegate()) | 2403 if (delegate()) |
| 2405 delegate()->WorkerCrashed(); | 2404 delegate()->WorkerCrashed(); |
| 2406 } | 2405 } |
| 2407 | 2406 |
| 2408 void TabContents::RequestDesktopNotificationPermission( | 2407 void TabContents::RequestDesktopNotificationPermission( |
| 2409 const GURL& source_origin, int callback_context) { | 2408 const GURL& source_origin, int callback_context) { |
| 2410 DesktopNotificationService* service = | 2409 DesktopNotificationService* service = |
| 2411 DesktopNotificationServiceFactory::GetForProfile(profile()); | 2410 profile()->GetDesktopNotificationService(); |
| 2412 service->RequestPermission( | 2411 service->RequestPermission( |
| 2413 source_origin, GetRenderProcessHost()->id(), | 2412 source_origin, GetRenderProcessHost()->id(), |
| 2414 render_view_host()->routing_id(), callback_context, this); | 2413 render_view_host()->routing_id(), callback_context, this); |
| 2415 } | 2414 } |
| 2416 | 2415 |
| 2417 void TabContents::OnUpdateFaviconURL( | 2416 void TabContents::OnUpdateFaviconURL( |
| 2418 int32 page_id, | 2417 int32 page_id, |
| 2419 const std::vector<FaviconURL>& candidates) { | 2418 const std::vector<FaviconURL>& candidates) { |
| 2420 favicon_helper().OnUpdateFaviconURL(page_id, candidates); | 2419 favicon_helper().OnUpdateFaviconURL(page_id, candidates); |
| 2421 if (touch_icon_helper_.get()) | 2420 if (touch_icon_helper_.get()) |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2593 | 2592 |
| 2594 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2593 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2595 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2594 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 2596 rwh_view->SetSize(view()->GetContainerSize()); | 2595 rwh_view->SetSize(view()->GetContainerSize()); |
| 2597 } | 2596 } |
| 2598 | 2597 |
| 2599 void TabContents::OnOnlineStateChanged(bool online) { | 2598 void TabContents::OnOnlineStateChanged(bool online) { |
| 2600 render_view_host()->Send(new ViewMsg_NetworkStateChanged( | 2599 render_view_host()->Send(new ViewMsg_NetworkStateChanged( |
| 2601 render_view_host()->routing_id(), online)); | 2600 render_view_host()->routing_id(), online)); |
| 2602 } | 2601 } |
| OLD | NEW |