OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/metrics/stats_counters.h" | 11 #include "base/metrics/stats_counters.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "content/browser/child_process_security_policy.h" | 16 #include "content/browser/child_process_security_policy.h" |
17 #include "content/browser/debugger/devtools_manager_impl.h" | 17 #include "content/browser/debugger/devtools_manager_impl.h" |
18 #include "content/browser/download/download_stats.h" | 18 #include "content/browser/download/download_stats.h" |
19 #include "content/browser/download/save_package.h" | 19 #include "content/browser/download/save_package.h" |
20 #include "content/browser/host_zoom_map.h" | 20 #include "content/browser/host_zoom_map_impl.h" |
21 #include "content/browser/in_process_webkit/session_storage_namespace.h" | 21 #include "content/browser/in_process_webkit/session_storage_namespace.h" |
22 #include "content/browser/intents/web_intents_dispatcher_impl.h" | 22 #include "content/browser/intents/web_intents_dispatcher_impl.h" |
23 #include "content/browser/load_from_memory_cache_details.h" | 23 #include "content/browser/load_from_memory_cache_details.h" |
24 #include "content/browser/load_notification_details.h" | 24 #include "content/browser/load_notification_details.h" |
25 #include "content/browser/renderer_host/render_process_host_impl.h" | 25 #include "content/browser/renderer_host/render_process_host_impl.h" |
26 #include "content/browser/renderer_host/render_view_host.h" | 26 #include "content/browser/renderer_host/render_view_host.h" |
27 #include "content/browser/renderer_host/render_widget_host_view.h" | 27 #include "content/browser/renderer_host/render_widget_host_view.h" |
28 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 28 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
29 #include "content/browser/renderer_host/resource_request_details.h" | 29 #include "content/browser/renderer_host/resource_request_details.h" |
30 #include "content/browser/site_instance_impl.h" | 30 #include "content/browser/site_instance_impl.h" |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 | 1030 |
1031 void TabContents::SetClosedByUserGesture(bool value) { | 1031 void TabContents::SetClosedByUserGesture(bool value) { |
1032 closed_by_user_gesture_ = value; | 1032 closed_by_user_gesture_ = value; |
1033 } | 1033 } |
1034 | 1034 |
1035 bool TabContents::GetClosedByUserGesture() const { | 1035 bool TabContents::GetClosedByUserGesture() const { |
1036 return closed_by_user_gesture_; | 1036 return closed_by_user_gesture_; |
1037 } | 1037 } |
1038 | 1038 |
1039 double TabContents::GetZoomLevel() const { | 1039 double TabContents::GetZoomLevel() const { |
1040 HostZoomMap* zoom_map = GetBrowserContext()->GetHostZoomMap(); | 1040 HostZoomMapImpl* zoom_map = static_cast<HostZoomMapImpl*>( |
| 1041 GetBrowserContext()->GetHostZoomMap()); |
1041 if (!zoom_map) | 1042 if (!zoom_map) |
1042 return 0; | 1043 return 0; |
1043 | 1044 |
1044 double zoom_level; | 1045 double zoom_level; |
1045 if (temporary_zoom_settings_) { | 1046 if (temporary_zoom_settings_) { |
1046 zoom_level = zoom_map->GetTemporaryZoomLevel( | 1047 zoom_level = zoom_map->GetTemporaryZoomLevel( |
1047 GetRenderProcessHost()->GetID(), GetRenderViewHost()->routing_id()); | 1048 GetRenderProcessHost()->GetID(), GetRenderViewHost()->routing_id()); |
1048 } else { | 1049 } else { |
1049 GURL url; | 1050 GURL url; |
1050 NavigationEntry* active_entry = GetController().GetActiveEntry(); | 1051 NavigationEntry* active_entry = GetController().GetActiveEntry(); |
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2281 encoding_ = content::GetContentClient()->browser()-> | 2282 encoding_ = content::GetContentClient()->browser()-> |
2282 GetCanonicalEncodingNameByAliasName(encoding); | 2283 GetCanonicalEncodingNameByAliasName(encoding); |
2283 } | 2284 } |
2284 | 2285 |
2285 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2286 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2286 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2287 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
2287 // Can be NULL during tests. | 2288 // Can be NULL during tests. |
2288 if (rwh_view) | 2289 if (rwh_view) |
2289 rwh_view->SetSize(GetView()->GetContainerSize()); | 2290 rwh_view->SetSize(GetView()->GetContainerSize()); |
2290 } | 2291 } |
OLD | NEW |