Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1094)

Side by Side Diff: content/browser/tab_contents/tab_contents.cc

Issue 9416070: Move creation and ownership of HostZoomMap to content instead of having every embedder do this. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac/cros browsertests Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/resource_context_impl.cc ('k') | content/public/browser/browser_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // - The previous renderer is kept swapped out in RenderViewHostManager in case 109 // - The previous renderer is kept swapped out in RenderViewHostManager in case
110 // the user goes back. The process only stays live if another tab is using 110 // the user goes back. The process only stays live if another tab is using
111 // it, but if so, the existing frame relationships will be maintained. 111 // it, but if so, the existing frame relationships will be maintained.
112 112
113 using content::DevToolsAgentHost; 113 using content::DevToolsAgentHost;
114 using content::DevToolsAgentHostRegistry; 114 using content::DevToolsAgentHostRegistry;
115 using content::DevToolsManagerImpl; 115 using content::DevToolsManagerImpl;
116 using content::DownloadItem; 116 using content::DownloadItem;
117 using content::DownloadManager; 117 using content::DownloadManager;
118 using content::GlobalRequestID; 118 using content::GlobalRequestID;
119 using content::HostZoomMap;
119 using content::InterstitialPage; 120 using content::InterstitialPage;
120 using content::NavigationController; 121 using content::NavigationController;
121 using content::NavigationEntry; 122 using content::NavigationEntry;
122 using content::NavigationEntryImpl; 123 using content::NavigationEntryImpl;
123 using content::OpenURLParams; 124 using content::OpenURLParams;
124 using content::RenderViewHostDelegate; 125 using content::RenderViewHostDelegate;
125 using content::RenderWidgetHostView; 126 using content::RenderWidgetHostView;
126 using content::RenderWidgetHostViewPort; 127 using content::RenderWidgetHostViewPort;
127 using content::SiteInstance; 128 using content::SiteInstance;
128 using content::SSLStatus; 129 using content::SSLStatus;
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 void TabContents::SetClosedByUserGesture(bool value) { 1192 void TabContents::SetClosedByUserGesture(bool value) {
1192 closed_by_user_gesture_ = value; 1193 closed_by_user_gesture_ = value;
1193 } 1194 }
1194 1195
1195 bool TabContents::GetClosedByUserGesture() const { 1196 bool TabContents::GetClosedByUserGesture() const {
1196 return closed_by_user_gesture_; 1197 return closed_by_user_gesture_;
1197 } 1198 }
1198 1199
1199 double TabContents::GetZoomLevel() const { 1200 double TabContents::GetZoomLevel() const {
1200 HostZoomMapImpl* zoom_map = static_cast<HostZoomMapImpl*>( 1201 HostZoomMapImpl* zoom_map = static_cast<HostZoomMapImpl*>(
1201 GetBrowserContext()->GetHostZoomMap()); 1202 HostZoomMap::GetForBrowserContext(GetBrowserContext()));
1202 if (!zoom_map) 1203 if (!zoom_map)
1203 return 0; 1204 return 0;
1204 1205
1205 double zoom_level; 1206 double zoom_level;
1206 if (temporary_zoom_settings_) { 1207 if (temporary_zoom_settings_) {
1207 zoom_level = zoom_map->GetTemporaryZoomLevel( 1208 zoom_level = zoom_map->GetTemporaryZoomLevel(
1208 GetRenderProcessHost()->GetID(), GetRenderViewHost()->routing_id()); 1209 GetRenderProcessHost()->GetID(), GetRenderViewHost()->routing_id());
1209 } else { 1210 } else {
1210 GURL url; 1211 GURL url;
1211 NavigationEntry* active_entry = GetController().GetActiveEntry(); 1212 NavigationEntry* active_entry = GetController().GetActiveEntry();
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
2467 save_info, 2468 save_info,
2468 this); 2469 this);
2469 } 2470 }
2470 2471
2471 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2472 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2472 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); 2473 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh);
2473 // Can be NULL during tests. 2474 // Can be NULL during tests.
2474 if (rwh_view) 2475 if (rwh_view)
2475 rwh_view->SetSize(GetView()->GetContainerSize()); 2476 rwh_view->SetSize(GetView()->GetContainerSize());
2476 } 2477 }
OLDNEW
« no previous file with comments | « content/browser/resource_context_impl.cc ('k') | content/public/browser/browser_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698