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

Side by Side Diff: webkit/compositor_bindings/web_layer_tree_view_impl.cc

Issue 12095071: Convert top controls to use DIP instead of PX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 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 "web_layer_tree_view_impl.h" 5 #include "web_layer_tree_view_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "cc/font_atlas.h" 9 #include "cc/font_atlas.h"
10 #include "cc/input_handler.h" 10 #include "cc/input_handler.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 settings.initialDebugState.showFPSCounter = webSettings.showFPSCounter; 51 settings.initialDebugState.showFPSCounter = webSettings.showFPSCounter;
52 settings.initialDebugState.showPaintRects = webSettings.showPaintRects; 52 settings.initialDebugState.showPaintRects = webSettings.showPaintRects;
53 settings.initialDebugState.showPlatformLayerTree = webSettings.showPlatformL ayerTree; 53 settings.initialDebugState.showPlatformLayerTree = webSettings.showPlatformL ayerTree;
54 settings.initialDebugState.showDebugBorders = webSettings.showDebugBorders; 54 settings.initialDebugState.showDebugBorders = webSettings.showDebugBorders;
55 settings.implSidePainting = CommandLine::ForCurrentProcess()->HasSwitch(cc:: switches::kEnableImplSidePainting); 55 settings.implSidePainting = CommandLine::ForCurrentProcess()->HasSwitch(cc:: switches::kEnableImplSidePainting);
56 56
57 settings.calculateTopControlsPosition = CommandLine::ForCurrentProcess()->Ha sSwitch(switches::kEnableTopControlsPositionCalculation); 57 settings.calculateTopControlsPosition = CommandLine::ForCurrentProcess()->Ha sSwitch(switches::kEnableTopControlsPositionCalculation);
58 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTopControlsHeight )) { 58 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTopControlsHeight )) {
59 std::string controls_height_str = 59 std::string controls_height_str =
60 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTop ControlsHeight); 60 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTop ControlsHeight);
61 int controls_height; 61 double controls_height;
62 if (base::StringToInt(controls_height_str, &controls_height) && controls _height > 0) 62 if (base::StringToDouble(controls_height_str, &controls_height) && contr ols_height > 0)
63 settings.topControlsHeightPx = controls_height; 63 settings.topControlsHeight = controls_height;
64 } 64 }
65 if (settings.calculateTopControlsPosition && (settings.topControlsHeightPx < = 0 || !settings.compositorFrameMessage)) { 65 if (settings.calculateTopControlsPosition && (settings.topControlsHeight <= 0 || !settings.compositorFrameMessage)) {
66 DCHECK(false) << "Top controls repositioning enabled without valid heigh t or compositorFrameMessage set."; 66 DCHECK(false) << "Top controls repositioning enabled without valid heigh t or compositorFrameMessage set.";
67 settings.calculateTopControlsPosition = false; 67 settings.calculateTopControlsPosition = false;
68 } 68 }
69 69
70 m_layerTreeHost = LayerTreeHost::create(this, settings, implThread.Pass()); 70 m_layerTreeHost = LayerTreeHost::create(this, settings, implThread.Pass());
71 if (!m_layerTreeHost.get()) 71 if (!m_layerTreeHost.get())
72 return false; 72 return false;
73 return true; 73 return true;
74 } 74 }
75 75
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 { 304 {
305 m_client->didCompleteSwapBuffers(); 305 m_client->didCompleteSwapBuffers();
306 } 306 }
307 307
308 void WebLayerTreeViewImpl::scheduleComposite() 308 void WebLayerTreeViewImpl::scheduleComposite()
309 { 309 {
310 m_client->scheduleComposite(); 310 m_client->scheduleComposite();
311 } 311 }
312 312
313 } // namespace WebKit 313 } // namespace WebKit
OLDNEW
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698