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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 1216933013: [Android] Expose native ViewConfiguration constants as DIPs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment and add assert Created 5 years, 5 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
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/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 } 265 }
266 266
267 scoped_ptr<ui::TouchSelectionController> CreateSelectionController( 267 scoped_ptr<ui::TouchSelectionController> CreateSelectionController(
268 ui::TouchSelectionControllerClient* client, 268 ui::TouchSelectionControllerClient* client,
269 ContentViewCore* content_view_core) { 269 ContentViewCore* content_view_core) {
270 DCHECK(client); 270 DCHECK(client);
271 DCHECK(content_view_core); 271 DCHECK(content_view_core);
272 ui::TouchSelectionController::Config config; 272 ui::TouchSelectionController::Config config;
273 config.tap_timeout = base::TimeDelta::FromMilliseconds( 273 config.tap_timeout = base::TimeDelta::FromMilliseconds(
274 gfx::ViewConfiguration::GetTapTimeoutInMs()); 274 gfx::ViewConfiguration::GetTapTimeoutInMs());
275 config.tap_slop = gfx::ViewConfiguration::GetTouchSlopInPixels() / 275 config.tap_slop = gfx::ViewConfiguration::GetTouchSlopInDips();
276 content_view_core->GetDpiScale();
277 config.show_on_tap_for_empty_editable = false; 276 config.show_on_tap_for_empty_editable = false;
278 config.enable_longpress_drag_selection = 277 config.enable_longpress_drag_selection =
279 base::CommandLine::ForCurrentProcess()->HasSwitch( 278 base::CommandLine::ForCurrentProcess()->HasSwitch(
280 switches::kEnableLongpressDragSelection); 279 switches::kEnableLongpressDragSelection);
281 return make_scoped_ptr(new ui::TouchSelectionController(client, config)); 280 return make_scoped_ptr(new ui::TouchSelectionController(client, config));
282 } 281 }
283 282
284 scoped_ptr<OverscrollControllerAndroid> CreateOverscrollController( 283 scoped_ptr<OverscrollControllerAndroid> CreateOverscrollController(
285 ContentViewCoreImpl* content_view_core) { 284 ContentViewCoreImpl* content_view_core) {
286 return make_scoped_ptr(new OverscrollControllerAndroid(content_view_core)); 285 return make_scoped_ptr(new OverscrollControllerAndroid(content_view_core));
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after
2048 results->orientationAngle = display.RotationAsDegree(); 2047 results->orientationAngle = display.RotationAsDegree();
2049 results->orientationType = 2048 results->orientationType =
2050 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 2049 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
2051 gfx::DeviceDisplayInfo info; 2050 gfx::DeviceDisplayInfo info;
2052 results->depth = info.GetBitsPerPixel(); 2051 results->depth = info.GetBitsPerPixel();
2053 results->depthPerComponent = info.GetBitsPerComponent(); 2052 results->depthPerComponent = info.GetBitsPerComponent();
2054 results->isMonochrome = (results->depthPerComponent == 0); 2053 results->isMonochrome = (results->depthPerComponent == 0);
2055 } 2054 }
2056 2055
2057 } // namespace content 2056 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698