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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10537067: mac: Basic HighDPI implementation for web contents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: done Created 8 years, 6 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
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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 // Force accelerated compositing and 2d canvas off for chrome:, about: and 543 // Force accelerated compositing and 2d canvas off for chrome:, about: and
544 // chrome-devtools: pages (unless it's specifically allowed). 544 // chrome-devtools: pages (unless it's specifically allowed).
545 if ((url.SchemeIs(chrome::kChromeDevToolsScheme) || 545 if ((url.SchemeIs(chrome::kChromeDevToolsScheme) ||
546 url.SchemeIs(chrome::kChromeUIScheme) || 546 url.SchemeIs(chrome::kChromeUIScheme) ||
547 (url.SchemeIs(chrome::kAboutScheme) && 547 (url.SchemeIs(chrome::kAboutScheme) &&
548 url.spec() != chrome::kAboutBlankURL)) && 548 url.spec() != chrome::kAboutBlankURL)) &&
549 !command_line.HasSwitch(switches::kAllowWebUICompositing)) { 549 !command_line.HasSwitch(switches::kAllowWebUICompositing)) {
550 prefs.accelerated_compositing_enabled = false; 550 prefs.accelerated_compositing_enabled = false;
551 prefs.accelerated_2d_canvas_enabled = false; 551 prefs.accelerated_2d_canvas_enabled = false;
552 } 552 }
553 #if defined(OS_MACOSX)
554 // Mac doesn't have gfx::Screen::GetMonitorNearestWindow impl.
555 // crbug.com/125690.
556 prefs.default_device_scale_factor =
557 gfx::Monitor::GetDefaultDeviceScaleFactor();
558 #else
559 if (rvh->GetView()) { 553 if (rvh->GetView()) {
560 gfx::Monitor monitor = gfx::Screen::GetMonitorNearestWindow( 554 gfx::Monitor monitor = gfx::Screen::GetMonitorNearestWindow(
561 rvh->GetView()->GetNativeView()); 555 rvh->GetView()->GetNativeView());
562 prefs.default_device_scale_factor = 556 prefs.default_device_scale_factor =
563 static_cast<int>(monitor.device_scale_factor()); 557 static_cast<int>(monitor.device_scale_factor());
564 } else { 558 } else {
565 prefs.default_device_scale_factor = 559 prefs.default_device_scale_factor =
566 gfx::Monitor::GetDefaultDeviceScaleFactor();; 560 gfx::Monitor::GetDefaultDeviceScaleFactor();;
567 } 561 }
568 #endif
569 562
570 if (command_line.HasSwitch(switches::kDefaultTileWidth)) 563 if (command_line.HasSwitch(switches::kDefaultTileWidth))
571 prefs.default_tile_width = 564 prefs.default_tile_width =
572 GetSwitchValueAsInt(command_line, switches::kDefaultTileWidth, 1); 565 GetSwitchValueAsInt(command_line, switches::kDefaultTileWidth, 1);
573 if (command_line.HasSwitch(switches::kDefaultTileHeight)) 566 if (command_line.HasSwitch(switches::kDefaultTileHeight))
574 prefs.default_tile_height = 567 prefs.default_tile_height =
575 GetSwitchValueAsInt(command_line, switches::kDefaultTileHeight, 1); 568 GetSwitchValueAsInt(command_line, switches::kDefaultTileHeight, 1);
576 if (command_line.HasSwitch(switches::kMaxUntiledLayerWidth)) 569 if (command_line.HasSwitch(switches::kMaxUntiledLayerWidth))
577 prefs.max_untiled_layer_width = 570 prefs.max_untiled_layer_width =
578 GetSwitchValueAsInt(command_line, switches::kMaxUntiledLayerWidth, 1); 571 GetSwitchValueAsInt(command_line, switches::kMaxUntiledLayerWidth, 1);
(...skipping 2453 matching lines...) Expand 10 before | Expand all | Expand 10 after
3032 browser_plugin_host()->embedder_render_process_host(); 3025 browser_plugin_host()->embedder_render_process_host();
3033 *embedder_container_id = browser_plugin_host()->instance_id(); 3026 *embedder_container_id = browser_plugin_host()->instance_id();
3034 int embedder_process_id = 3027 int embedder_process_id =
3035 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; 3028 embedder_render_process_host ? embedder_render_process_host->GetID() : -1;
3036 if (embedder_process_id != -1) { 3029 if (embedder_process_id != -1) {
3037 *embedder_channel_name = 3030 *embedder_channel_name =
3038 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), 3031 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(),
3039 embedder_process_id); 3032 embedder_process_id);
3040 } 3033 }
3041 } 3034 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698