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

Unified Diff: ui/base/touch/touch_editing_controller.h

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/touch/touch_device_ozone.cc ('k') | ui/base/touch/touch_editing_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/touch/touch_editing_controller.h
diff --git a/ui/base/touch/touch_editing_controller.h b/ui/base/touch/touch_editing_controller.h
deleted file mode 100644
index 00d8d496388c4b916c280115ff598b6e171de3eb..0000000000000000000000000000000000000000
--- a/ui/base/touch/touch_editing_controller.h
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_
-#define UI_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_
-
-#include "ui/base/models/simple_menu_model.h"
-#include "ui/gfx/point.h"
-#include "ui/gfx/rect.h"
-
-namespace ui {
-
-// An interface implemented by widget that has text that can be selected/edited
-// using touch.
-class UI_BASE_EXPORT TouchEditable : public ui::SimpleMenuModel::Delegate {
- public:
- // TODO(mohsen): Consider switching from local coordinates to screen
- // coordinates in this interface and see if it will simplify things.
-
- // Select everything between start and end (points are in view's local
- // coordinate system). |start| is the logical start and |end| is the logical
- // end of selection. Visually, |start| may lie after |end|.
- virtual void SelectRect(const gfx::Point& start, const gfx::Point& end) = 0;
-
- // Move the caret to |point|. |point| is in local coordinates.
- virtual void MoveCaretTo(const gfx::Point& point) = 0;
-
- // Gets the end points of the current selection. The end points p1 and p2 must
- // be the cursor rect for the start and end of selection (in local
- // coordinates):
- // ____________________________________
- // | textfield with |selected text| |
- // ------------------------------------
- // ^p1 ^p2
- //
- // p1 should be the logical start and p2 the logical end of selection. Hence,
- // visually, p1 could be to the right of p2 in the figure above.
- virtual void GetSelectionEndPoints(gfx::Rect* p1, gfx::Rect* p2) = 0;
-
- // Gets the bounds of the client view in its local coordinates.
- virtual gfx::Rect GetBounds() = 0;
-
- // Gets the NativeView hosting the client.
- virtual gfx::NativeView GetNativeView() const = 0;
-
- // Converts a point to/from screen coordinates from/to client view.
- virtual void ConvertPointToScreen(gfx::Point* point) = 0;
- virtual void ConvertPointFromScreen(gfx::Point* point) = 0;
-
- // Returns true if the editable draws its own handles (hence, the
- // TouchSelectionController need not draw handles).
- virtual bool DrawsHandles() = 0;
-
- // Tells the editable to open context menu.
- virtual void OpenContextMenu(const gfx::Point& anchor) = 0;
-
- // Tells the editable to end touch editing and destroy touch selection
- // controller it owns.
- virtual void DestroyTouchSelection() = 0;
-
- protected:
- ~TouchEditable() override {}
-};
-
-// This defines the callback interface for other code to be notified of changes
-// in the state of a TouchEditable.
-class UI_BASE_EXPORT TouchSelectionController {
- public:
- virtual ~TouchSelectionController() {}
-
- // Creates a TouchSelectionController. Caller owns the returned object.
- static TouchSelectionController* create(
- TouchEditable* client_view);
-
- // Notifies the controller that the selection has changed.
- virtual void SelectionChanged() = 0;
-
- // Returns true if the user is currently dragging one of the handles.
- virtual bool IsHandleDragInProgress() = 0;
-
- // Hides visible handles. According to the value of |quick|, handles might
- // fade out quickly or slowly.
- virtual void HideHandles(bool quick) = 0;
-};
-
-class UI_BASE_EXPORT TouchSelectionControllerFactory {
- public:
- static void SetInstance(TouchSelectionControllerFactory* instance);
-
- virtual TouchSelectionController* create(TouchEditable* client_view) = 0;
-
- protected:
- virtual ~TouchSelectionControllerFactory() {}
-};
-
-} // namespace views
-
-#endif // UI_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_
« no previous file with comments | « ui/base/touch/touch_device_ozone.cc ('k') | ui/base/touch/touch_editing_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698