Skip to content

Commit

Permalink
Revert of Move TouchSelectionController from content to ui (patchset c…
Browse files Browse the repository at this point in the history
…hromium#12 id:600001 of https://codereview.chromium.org/759433002/)

Reason for revert:
Suspected of causing Win8 GN failure

http://build.chromium.org/p/chromium.win/builders/Win8%20GN/builds/1552/steps/compile/logs/stdio#error1

FAILED: ninja -t msvc -e environment.x86 -- "C:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64_x86/cl.exe" /nologo /showIncludes /FC @obj/ui/base/dragdrop/ui_base_unittests.os_exchange_data_provider_aurax11_unittest.obj.rsp /c ../../ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc /Foobj/ui/base/dragdrop/ui_base_unittests.os_exchange_data_provider_aurax11_unittest.obj /Fdobj/ui/base/ui_base_unittests_cc.pdb
c:\b\build\slave\win8_gn\build\src\ui\base\dragdrop\os_exchange_data_provider_aurax11.h(8) : fatalerror C1083: Cannot open include file: 'X11/Xlib.h': No such file or directory

Original issue's description:
> Move TouchSelectionController from content to ui
>
> This patch is only moving new unified touch selection files from
> content/ to ui/touch_selection/. This is the first step to allow Aura
> use the new unified TouchSelectionController.
>
> The only change to TouchSelectionController needed for this move is
> replacing use of cc::ViewportSelectionBound with ui::SelectionBound.
>
> The actual use of the new touch selection for Aura will happen in future
> CL(s). After that, we can remove current touch selection code from
> ui/base/touch/.
>
> BUG=399721
>
> Committed: https://crrev.com/29fd405ca491a6fcf0dde6277d92d44300cb2926
> Cr-Commit-Position: refs/heads/master@{#307336}

TBR=jdduke@chromium.org,mfomitchev@chromium.org,sadrul@chromium.org,boliu@chromium.org,jam@chromium.org,mohsen@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=399721

Review URL: https://codereview.chromium.org/754963007

Cr-Commit-Position: refs/heads/master@{#307344}
  • Loading branch information
sleevi authored and Commit bot committed Dec 8, 2014
1 parent 629d7c9 commit 6b15051
Show file tree
Hide file tree
Showing 49 changed files with 411 additions and 703 deletions.
7 changes: 0 additions & 7 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ group("root") {
"//ui/snapshot",
"//ui/strings",
"//ui/surface",
"//ui/touch_selection",
"//ui/views",
"//ui/views/controls/webview",
"//ui/web_dialogs",
Expand Down Expand Up @@ -298,12 +297,6 @@ group("root") {
]
}

if (is_mac || is_ios) {
deps -= [
"//ui/touch_selection",
]
}

if (is_win) {
deps -= [
"//apps",
Expand Down
2 changes: 1 addition & 1 deletion android_webview/java_library_common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ $(call intermediates-dir-for,GYP,shared)/enums/popup_item_type_java/org/chromium
$(call intermediates-dir-for,GYP,shared)/enums/private_key_types_java/org/chromium/net/PrivateKeyType.java \
$(call intermediates-dir-for,GYP,shared)/enums/result_codes_java/org/chromium/content_public/common/ResultCode.java \
$(call intermediates-dir-for,GYP,shared)/enums/screen_orientation_values_java/org/chromium/content_public/common/ScreenOrientationValues.java \
$(call intermediates-dir-for,GYP,shared)/enums/selection_event_type_java/org/chromium/ui/touch_selection/SelectionEventType.java \
$(call intermediates-dir-for,GYP,shared)/enums/selection_event_type_java/org/chromium/content/browser/input/SelectionEventType.java \
$(call intermediates-dir-for,GYP,shared)/enums/speech_recognition_error_java/org/chromium/content_public/common/SpeechRecognitionErrorCode.java \
$(call intermediates-dir-for,GYP,shared)/enums/top_controls_state_java/org/chromium/content_public/common/TopControlsState.java \
$(call intermediates-dir-for,GYP,shared)/enums/window_open_disposition_java/org/chromium/ui/WindowOpenDisposition.java \
Expand Down
2 changes: 1 addition & 1 deletion android_webview/libwebviewchromium.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'../content/content.gyp:popup_item_type_java',
'../content/content.gyp:result_codes_java',
'../content/content.gyp:screen_orientation_values_java',
'../content/content.gyp:selection_event_type_java',
'../content/content.gyp:speech_recognition_error_java',
'../content/content.gyp:top_controls_state_java',
'../media/media.gyp:media_android_imageformat',
Expand All @@ -36,7 +37,6 @@
'../ui/android/ui_android.gyp:touch_device_types_java',
'../ui/android/ui_android.gyp:window_open_disposition_java',
'../ui/android/ui_android.gyp:text_input_type_java',
'../ui/touch_selection/ui_touch_selection.gyp:selection_event_type_java',
],
# Enable feedback-directed optimisation for the library when building in
# android.
Expand Down
16 changes: 0 additions & 16 deletions build/all.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@
'../url/url.gyp:*',
],
'conditions': [
['OS!="ios" and OS!="mac"', {
'dependencies': [
'../ui/touch_selection/ui_touch_selection.gyp:*',
],
}],
['OS=="ios"', {
'dependencies': [
'../ios/ios.gyp:*',
Expand Down Expand Up @@ -317,11 +312,6 @@
'../url/url.gyp:url_unittests',
],
'conditions': [
['OS!="ios" and OS!="mac"', {
'dependencies': [
'../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
],
}],
['OS!="ios" and OS!="android"', {
'dependencies': [
'../cc/blink/cc_blink_tests.gyp:cc_blink_unittests',
Expand Down Expand Up @@ -844,7 +834,6 @@
'../tools/android/findbugs_plugin/findbugs_plugin.gyp:findbugs_plugin_test',
'../ui/base/ui_base_tests.gyp:ui_base_unittests',
'../ui/events/events.gyp:events_unittests',
'../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
# Unit test bundles packaged as an apk.
'../android_webview/android_webview.gyp:android_webview_test_apk',
'../android_webview/android_webview.gyp:android_webview_unittests_apk',
Expand Down Expand Up @@ -873,7 +862,6 @@
'../ui/base/ui_base_tests.gyp:ui_base_unittests_apk',
'../ui/events/events.gyp:events_unittests_apk',
'../ui/gfx/gfx_tests.gyp:gfx_unittests_apk',
'../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests_apk',
],
'conditions': [
['enable_webrtc==1 and "<(libpeer_target_type)"=="static_library"', {
Expand Down Expand Up @@ -1087,7 +1075,6 @@
'../ui/base/ui_base_tests.gyp:ui_base_unittests',
'../ui/events/events.gyp:events_unittests',
'../ui/gfx/gfx_tests.gyp:gfx_unittests',
'../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
'../ui/views/views.gyp:views_unittests',
'../url/url.gyp:url_unittests',
],
Expand Down Expand Up @@ -1192,7 +1179,6 @@
'../ui/events/events.gyp:events_unittests',
'../ui/gfx/gfx_tests.gyp:gfx_unittests',
'../ui/keyboard/keyboard.gyp:keyboard_unittests',
'../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
'../url/url.gyp:url_unittests',
],
},
Expand Down Expand Up @@ -1233,7 +1219,6 @@
'../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter',
'../ui/base/ui_base_tests.gyp:ui_base_unittests',
'../ui/gfx/gfx_tests.gyp:gfx_unittests',
'../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
'../ui/views/views.gyp:views_unittests',
'../url/url.gyp:url_unittests',
],
Expand Down Expand Up @@ -1282,7 +1267,6 @@
'../ui/keyboard/keyboard.gyp:*',
'../ui/message_center/message_center.gyp:*',
'../ui/snapshot/snapshot.gyp:snapshot_unittests',
'../ui/touch_selection/ui_touch_selection.gyp:ui_touch_selection_unittests',
'../ui/views/examples/examples.gyp:views_examples_with_content_exe',
'../ui/views/views.gyp:views',
'../ui/views/views.gyp:views_unittests',
Expand Down
1 change: 0 additions & 1 deletion build/android/pylib/gtest/gtest_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
'sql_unittests',
'sync_unit_tests',
'ui_base_unittests',
'ui_touch_selection_unittests',
'unit_tests',
'webkit_unit_tests',
]
Expand Down
1 change: 0 additions & 1 deletion content/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ include_rules = [
"+ui/snapshot",
"+ui/strings/grit/ui_strings.h",
"+ui/surface",
"+ui/touch_selection",
"+ui/wm",
# Content knows about grd files, but the specifics of how to get a resource
# given its id is left to the embedder.
Expand Down
1 change: 0 additions & 1 deletion content/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ source_set("browser") {
"//third_party/libyuv",
"//ui/resources",
"//ui/surface",
"//ui/touch_selection",
]
}

Expand Down
22 changes: 11 additions & 11 deletions content/browser/android/composited_touch_handle_drawable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ class HandleResources {
center_bitmap_.setImmutable();
}

const SkBitmap& GetBitmap(ui::TouchHandleOrientation orientation) {
const SkBitmap& GetBitmap(TouchHandleOrientation orientation) {
DCHECK(loaded_);
switch (orientation) {
case ui::TOUCH_HANDLE_LEFT:
case TOUCH_HANDLE_LEFT:
return left_bitmap_;
case ui::TOUCH_HANDLE_RIGHT:
case TOUCH_HANDLE_RIGHT:
return right_bitmap_;
case ui::TOUCH_HANDLE_CENTER:
case TOUCH_HANDLE_CENTER:
return center_bitmap_;
case ui::TOUCH_HANDLE_ORIENTATION_UNDEFINED:
case TOUCH_HANDLE_ORIENTATION_UNDEFINED:
NOTREACHED() << "Invalid touch handle orientation.";
};
return center_bitmap_;
Expand All @@ -83,7 +83,7 @@ CompositedTouchHandleDrawable::CompositedTouchHandleDrawable(
float dpi_scale,
jobject context)
: dpi_scale_(dpi_scale),
orientation_(ui::TOUCH_HANDLE_ORIENTATION_UNDEFINED),
orientation_(TOUCH_HANDLE_ORIENTATION_UNDEFINED),
layer_(cc::UIResourceLayer::Create()) {
g_selection_resources.Get().LoadIfNecessary(context);
DCHECK(root_layer);
Expand All @@ -99,7 +99,7 @@ void CompositedTouchHandleDrawable::SetEnabled(bool enabled) {
}

void CompositedTouchHandleDrawable::SetOrientation(
ui::TouchHandleOrientation orientation) {
TouchHandleOrientation orientation) {
DCHECK(layer_->parent());
orientation_ = orientation;

Expand All @@ -108,16 +108,16 @@ void CompositedTouchHandleDrawable::SetOrientation(
layer_->SetBounds(gfx::Size(bitmap.width(), bitmap.height()));

switch (orientation_) {
case ui::TOUCH_HANDLE_LEFT:
case TOUCH_HANDLE_LEFT:
focal_offset_from_origin_ = gfx::Vector2dF(bitmap.width() * 0.75f, 0);
break;
case ui::TOUCH_HANDLE_RIGHT:
case TOUCH_HANDLE_RIGHT:
focal_offset_from_origin_ = gfx::Vector2dF(bitmap.width() * 0.25f, 0);
break;
case ui::TOUCH_HANDLE_CENTER:
case TOUCH_HANDLE_CENTER:
focal_offset_from_origin_ = gfx::Vector2dF(bitmap.width() * 0.5f, 0);
break;
case ui::TOUCH_HANDLE_ORIENTATION_UNDEFINED:
case TOUCH_HANDLE_ORIENTATION_UNDEFINED:
NOTREACHED() << "Invalid touch handle orientation.";
break;
};
Expand Down
10 changes: 5 additions & 5 deletions content/browser/android/composited_touch_handle_drawable.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
#ifndef CONTENT_BROWSER_ANDROID_COMPOSITED_TOUCH_HANDLE_DRAWABLE_H_
#define CONTENT_BROWSER_ANDROID_COMPOSITED_TOUCH_HANDLE_DRAWABLE_H_

#include "ui/touch_selection/touch_handle.h"
#include "content/browser/renderer_host/input/touch_handle.h"

#include "base/android/jni_android.h"
#include "cc/layers/ui_resource_layer.h"

namespace content {

// Touch handle drawable implementation backed by a cc layer.
class CompositedTouchHandleDrawable : public ui::TouchHandleDrawable {
class CompositedTouchHandleDrawable : public TouchHandleDrawable {
public:
CompositedTouchHandleDrawable(cc::Layer* root_layer,
float dpi_scale,
jobject context);
virtual ~CompositedTouchHandleDrawable();

// ui::TouchHandleDrawable implementation.
// TouchHandleDrawable implementation.
virtual void SetEnabled(bool enabled) override;
virtual void SetOrientation(ui::TouchHandleOrientation orientation) override;
virtual void SetOrientation(TouchHandleOrientation orientation) override;
virtual void SetAlpha(float alpha) override;
virtual void SetFocus(const gfx::PointF& position) override;
virtual bool IntersectsWith(const gfx::RectF& rect) const override;
Expand All @@ -34,7 +34,7 @@ class CompositedTouchHandleDrawable : public ui::TouchHandleDrawable {
gfx::RectF BoundingRect() const;

const float dpi_scale_;
ui::TouchHandleOrientation orientation_;
TouchHandleOrientation orientation_;
gfx::PointF focal_position_;
gfx::Vector2dF focal_offset_from_origin_;
scoped_refptr<cc::UIResourceLayer> layer_;
Expand Down
8 changes: 4 additions & 4 deletions content/browser/android/content_view_core_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ void ContentViewCoreImpl::OnSelectionChanged(const std::string& text) {
Java_ContentViewCore_onSelectionChanged(env, obj.obj(), jtext.obj());
}

void ContentViewCoreImpl::OnSelectionEvent(ui::SelectionEventType event,
void ContentViewCoreImpl::OnSelectionEvent(SelectionEventType event,
const gfx::PointF& position) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
Expand All @@ -599,15 +599,15 @@ void ContentViewCoreImpl::OnSelectionEvent(ui::SelectionEventType event,
env, j_obj.obj(), event, position.x(), position.y());
}

scoped_ptr<ui::TouchHandleDrawable>
scoped_ptr<TouchHandleDrawable>
ContentViewCoreImpl::CreatePopupTouchHandleDrawable() {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null()) {
NOTREACHED();
return scoped_ptr<ui::TouchHandleDrawable>();
return scoped_ptr<TouchHandleDrawable>();
}
return scoped_ptr<ui::TouchHandleDrawable>(new PopupTouchHandleDrawable(
return scoped_ptr<TouchHandleDrawable>(new PopupTouchHandleDrawable(
Java_ContentViewCore_createPopupTouchHandleDrawable(env, obj.obj()),
dpi_scale_));
}
Expand Down
4 changes: 2 additions & 2 deletions content/browser/android/content_view_core_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ class ContentViewCoreImpl : public ContentViewCore,
InputEventAckState ack_result);
bool FilterInputEvent(const blink::WebInputEvent& event);
void OnSelectionChanged(const std::string& text);
void OnSelectionEvent(ui::SelectionEventType event,
void OnSelectionEvent(SelectionEventType event,
const gfx::PointF& anchor_position);
scoped_ptr<ui::TouchHandleDrawable> CreatePopupTouchHandleDrawable();
scoped_ptr<TouchHandleDrawable> CreatePopupTouchHandleDrawable();

void StartContentIntent(const GURL& content_url);

Expand Down
10 changes: 5 additions & 5 deletions content/browser/android/popup_touch_handle_drawable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ void PopupTouchHandleDrawable::SetEnabled(bool enabled) {
}

void PopupTouchHandleDrawable::SetOrientation(
ui::TouchHandleOrientation orientation) {
TouchHandleOrientation orientation) {
JNIEnv* env = base::android::AttachCurrentThread();
jobject obj = drawable_.obj();
switch (orientation) {
case ui::TOUCH_HANDLE_LEFT:
case TOUCH_HANDLE_LEFT:
Java_PopupTouchHandleDrawable_setLeftOrientation(env, obj);
break;

case ui::TOUCH_HANDLE_RIGHT:
case TOUCH_HANDLE_RIGHT:
Java_PopupTouchHandleDrawable_setRightOrientation(env, obj);
break;

case ui::TOUCH_HANDLE_CENTER:
case TOUCH_HANDLE_CENTER:
Java_PopupTouchHandleDrawable_setCenterOrientation(env, obj);
break;

case ui::TOUCH_HANDLE_ORIENTATION_UNDEFINED:
case TOUCH_HANDLE_ORIENTATION_UNDEFINED:
NOTREACHED() << "Invalid touch handle orientation.";
};
}
Expand Down
8 changes: 4 additions & 4 deletions content/browser/android/popup_touch_handle_drawable.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
#ifndef CONTENT_BROWSER_ANDROID_POPUP_TOUCH_HANDLE_DRAWABLE_H_
#define CONTENT_BROWSER_ANDROID_POPUP_TOUCH_HANDLE_DRAWABLE_H_

#include "ui/touch_selection/touch_handle.h"
#include "content/browser/renderer_host/input/touch_handle.h"

#include "base/android/jni_android.h"

namespace content {

// Touch handle drawable backed by an Android PopupWindow.
class PopupTouchHandleDrawable : public ui::TouchHandleDrawable {
class PopupTouchHandleDrawable : public TouchHandleDrawable {
public:
PopupTouchHandleDrawable(base::android::ScopedJavaLocalRef<jobject> drawable,
float dpi_scale);
virtual ~PopupTouchHandleDrawable();

// ui::TouchHandleDrawable implementation.
// TouchHandleDrawable implementation.
virtual void SetEnabled(bool enabled) override;
virtual void SetOrientation(ui::TouchHandleOrientation orientation) override;
virtual void SetOrientation(TouchHandleOrientation orientation) override;
virtual void SetAlpha(float alpha) override;
virtual void SetFocus(const gfx::PointF& position) override;
virtual bool IntersectsWith(const gfx::RectF& rect) const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_TOUCH_SELECTION_SELECTION_EVENT_TYPE_
#define UI_TOUCH_SELECTION_SELECTION_EVENT_TYPE_
#ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SELECTION_EVENT_TYPE_
#define CONTENT_BROWSER_RENDERER_HOST_INPUT_SELECTION_EVENT_TYPE_

namespace ui {
namespace content {

// This file contains a list of events relating to selection and insertion, used
// for notifying Java when the renderer selection has changed.

//
// A Java counterpart will be generated for this enum.
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.touch_selection
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content.browser.input
enum SelectionEventType {
SELECTION_SHOWN,
SELECTION_CLEARED,
Expand All @@ -24,6 +24,6 @@ enum SelectionEventType {
INSERTION_DRAG_STARTED,
};

} // namespace ui
} // namespace content

#endif // UI_TOUCH_SELECTION_SELECTION_EVENT_TYPE_
#endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SELECTION_EVENT_TYPE_
Loading

0 comments on commit 6b15051

Please sign in to comment.