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

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

Issue 9500015: Pass DefaultDeviceScaleFactor to webkit (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Ensure OverrideWebkitPrefs receives correct default_device_scale_factor Created 8 years, 9 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
« no previous file with comments | « no previous file | content/common/view_messages.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"
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_number_conversions.h"
13 #include "base/string_util.h" 14 #include "base/string_util.h"
14 #include "base/time.h" 15 #include "base/time.h"
15 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
16 #include "content/browser/child_process_security_policy_impl.h" 17 #include "content/browser/child_process_security_policy_impl.h"
17 #include "content/browser/debugger/devtools_manager_impl.h" 18 #include "content/browser/debugger/devtools_manager_impl.h"
18 #include "content/browser/download/download_stats.h" 19 #include "content/browser/download/download_stats.h"
19 #include "content/browser/download/save_package.h" 20 #include "content/browser/download/save_package.h"
20 #include "content/browser/gpu/gpu_data_manager_impl.h" 21 #include "content/browser/gpu/gpu_data_manager_impl.h"
21 #include "content/browser/gpu/gpu_process_host.h" 22 #include "content/browser/gpu/gpu_process_host.h"
22 #include "content/browser/host_zoom_map_impl.h" 23 #include "content/browser/host_zoom_map_impl.h"
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 // chrome-devtools: pages (unless it's specifically allowed). 451 // chrome-devtools: pages (unless it's specifically allowed).
451 if ((url.SchemeIs(chrome::kChromeDevToolsScheme) || 452 if ((url.SchemeIs(chrome::kChromeDevToolsScheme) ||
452 url.SchemeIs(chrome::kChromeUIScheme) || 453 url.SchemeIs(chrome::kChromeUIScheme) ||
453 (url.SchemeIs(chrome::kAboutScheme) && 454 (url.SchemeIs(chrome::kAboutScheme) &&
454 url.spec() != chrome::kAboutBlankURL)) && 455 url.spec() != chrome::kAboutBlankURL)) &&
455 !command_line.HasSwitch(switches::kAllowWebUICompositing)) { 456 !command_line.HasSwitch(switches::kAllowWebUICompositing)) {
456 prefs.accelerated_compositing_enabled = false; 457 prefs.accelerated_compositing_enabled = false;
457 prefs.accelerated_2d_canvas_enabled = false; 458 prefs.accelerated_2d_canvas_enabled = false;
458 } 459 }
459 460
461 int default_device_scale_factor;
462 base::StringToInt(command_line.GetSwitchValueASCII(
463 switches::kDefaultDeviceScaleFactor),
464 &default_device_scale_factor);
465
466 if (default_device_scale_factor)
Fady Samuel 2012/02/29 15:42:25 This if statement is probably not necessary. We ca
tdresser 2012/02/29 16:51:30 Done.
467 prefs.default_device_scale_factor = default_device_scale_factor;
468
460 content::GetContentClient()->browser()->OverrideWebkitPrefs(rvh, &prefs); 469 content::GetContentClient()->browser()->OverrideWebkitPrefs(rvh, &prefs);
461 470
462 return prefs; 471 return prefs;
463 } 472 }
464 473
465 NavigationControllerImpl& TabContents::GetControllerImpl() { 474 NavigationControllerImpl& TabContents::GetControllerImpl() {
466 return controller_; 475 return controller_;
467 } 476 }
468 477
469 RenderViewHostManager* TabContents::GetRenderManagerForTesting() { 478 RenderViewHostManager* TabContents::GetRenderManagerForTesting() {
(...skipping 2002 matching lines...) Expand 10 before | Expand all | Expand 10 after
2472 save_info, 2481 save_info,
2473 this); 2482 this);
2474 } 2483 }
2475 2484
2476 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2485 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2477 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); 2486 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh);
2478 // Can be NULL during tests. 2487 // Can be NULL during tests.
2479 if (rwh_view) 2488 if (rwh_view)
2480 rwh_view->SetSize(GetView()->GetContainerSize()); 2489 rwh_view->SetSize(GetView()->GetContainerSize());
2481 } 2490 }
OLDNEW
« no previous file with comments | « no previous file | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698