OLD | NEW |
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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 return latency_info; | 258 return latency_info; |
259 } | 259 } |
260 | 260 |
261 scoped_ptr<ui::TouchSelectionController> CreateSelectionController( | 261 scoped_ptr<ui::TouchSelectionController> CreateSelectionController( |
262 ui::TouchSelectionControllerClient* client, | 262 ui::TouchSelectionControllerClient* client, |
263 ContentViewCore* content_view_core) { | 263 ContentViewCore* content_view_core) { |
264 DCHECK(client); | 264 DCHECK(client); |
265 DCHECK(content_view_core); | 265 DCHECK(content_view_core); |
266 int tap_timeout_ms = gfx::ViewConfiguration::GetTapTimeoutInMs(); | 266 int tap_timeout_ms = gfx::ViewConfiguration::GetTapTimeoutInMs(); |
267 int touch_slop_pixels = gfx::ViewConfiguration::GetTouchSlopInPixels(); | 267 int touch_slop_pixels = gfx::ViewConfiguration::GetTouchSlopInPixels(); |
| 268 ui::TextSelectionGranularityStrategy strategy = |
| 269 ui::GRANULARITY_STRATEGY_DEFAULT; |
| 270 const std::string strategy_str = base::CommandLine::ForCurrentProcess()-> |
| 271 GetSwitchValueASCII(switches::kTouchTextSelectionStrategy); |
| 272 if (strategy_str == "1") |
| 273 strategy = ui::GRANULARITY_STRATEGY_DIRECTION; |
| 274 else if (strategy_str == "2") |
| 275 strategy = ui::GRANULARITY_STRATEGY_VELOCITY; |
268 return make_scoped_ptr(new ui::TouchSelectionController( | 276 return make_scoped_ptr(new ui::TouchSelectionController( |
269 client, | 277 client, |
270 base::TimeDelta::FromMilliseconds(tap_timeout_ms), | 278 base::TimeDelta::FromMilliseconds(tap_timeout_ms), |
271 touch_slop_pixels / content_view_core->GetDpiScale(), | 279 touch_slop_pixels / content_view_core->GetDpiScale(), |
272 false)); | 280 false, |
| 281 strategy)); |
273 } | 282 } |
274 | 283 |
275 scoped_ptr<OverscrollControllerAndroid> CreateOverscrollController( | 284 scoped_ptr<OverscrollControllerAndroid> CreateOverscrollController( |
276 ContentViewCore* content_view_core) { | 285 ContentViewCore* content_view_core) { |
277 DCHECK(content_view_core); | 286 DCHECK(content_view_core); |
278 ui::WindowAndroid* window = content_view_core->GetWindowAndroid(); | 287 ui::WindowAndroid* window = content_view_core->GetWindowAndroid(); |
279 DCHECK(window); | 288 DCHECK(window); |
280 ui::WindowAndroidCompositor* compositor = window->GetCompositor(); | 289 ui::WindowAndroidCompositor* compositor = window->GetCompositor(); |
281 DCHECK(compositor); | 290 DCHECK(compositor); |
282 return make_scoped_ptr(new OverscrollControllerAndroid( | 291 return make_scoped_ptr(new OverscrollControllerAndroid( |
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1937 results->orientationAngle = display.RotationAsDegree(); | 1946 results->orientationAngle = display.RotationAsDegree(); |
1938 results->orientationType = | 1947 results->orientationType = |
1939 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1948 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1940 gfx::DeviceDisplayInfo info; | 1949 gfx::DeviceDisplayInfo info; |
1941 results->depth = info.GetBitsPerPixel(); | 1950 results->depth = info.GetBitsPerPixel(); |
1942 results->depthPerComponent = info.GetBitsPerComponent(); | 1951 results->depthPerComponent = info.GetBitsPerComponent(); |
1943 results->isMonochrome = (results->depthPerComponent == 0); | 1952 results->isMonochrome = (results->depthPerComponent == 0); |
1944 } | 1953 } |
1945 | 1954 |
1946 } // namespace content | 1955 } // namespace content |
OLD | NEW |