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

Unified Diff: ui/views/touchui/touch_selection_controller_impl.cc

Issue 142543002: Revert 245610 "Consistent fading behavior for touch editing handles" (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1794/src/
Patch Set: Created 6 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/views/touchui/touch_selection_controller_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/touchui/touch_selection_controller_impl.cc
===================================================================
--- ui/views/touchui/touch_selection_controller_impl.cc (revision 245822)
+++ ui/views/touchui/touch_selection_controller_impl.cc (working copy)
@@ -16,7 +16,6 @@
#include "ui/gfx/screen.h"
#include "ui/gfx/size.h"
#include "ui/views/corewm/shadow_types.h"
-#include "ui/views/corewm/window_animations.h"
#include "ui/views/widget/widget.h"
#include "ui/wm/public/masked_window_targeter.h"
@@ -58,8 +57,6 @@
const int kContextMenuTimoutMs = 200;
-const int kSelectionHandleQuickFadeDurationMs = 50;
-
// Creates a widget to host SelectionHandleView.
views::Widget* CreateTouchSelectionPopupWidget(
gfx::NativeView context,
@@ -157,7 +154,6 @@
}
virtual ~EditingHandleView() {
- SetWidgetVisible(false, false);
}
// Overridden from views::WidgetDelegateView:
@@ -232,22 +228,13 @@
return widget_->IsVisible();
}
- void SetWidgetVisible(bool visible, bool quick) {
+ void SetWidgetVisible(bool visible) {
if (widget_->IsVisible() == visible)
return;
- if (visible) {
- corewm::SetWindowShowAnimationDuration(
- widget_->GetNativeView(),
- base::TimeDelta::FromMilliseconds(
- quick ? kSelectionHandleQuickFadeDurationMs : 0));
+ if (visible)
widget_->Show();
- } else {
- corewm::SetWindowHideAnimationDuration(
- widget_->GetNativeView(),
- base::TimeDelta::FromMilliseconds(
- quick ? kSelectionHandleQuickFadeDurationMs : 0));
+ else
widget_->Hide();
- }
}
void SetSelectionRectInScreen(const gfx::Rect& rect) {
@@ -389,13 +376,13 @@
// Check if there is any selection at all.
if (screen_pos_1 == screen_pos_2) {
- selection_handle_1_->SetWidgetVisible(false, false);
- selection_handle_2_->SetWidgetVisible(false, false);
+ selection_handle_1_->SetWidgetVisible(false);
+ selection_handle_2_->SetWidgetVisible(false);
SetHandleSelectionRect(cursor_handle_.get(), r1, screen_rect_1);
return;
}
- cursor_handle_->SetWidgetVisible(false, false);
+ cursor_handle_->SetWidgetVisible(false);
SetHandleSelectionRect(selection_handle_1_.get(), r1, screen_rect_1);
SetHandleSelectionRect(selection_handle_2_.get(), r2, screen_rect_2);
}
@@ -405,12 +392,6 @@
return !!dragging_handle_;
}
-void TouchSelectionControllerImpl::HideHandles(bool quick) {
- selection_handle_1_->SetWidgetVisible(false, quick);
- selection_handle_2_->SetWidgetVisible(false, quick);
- cursor_handle_->SetWidgetVisible(false, quick);
-}
-
void TouchSelectionControllerImpl::SetDraggingHandle(
EditingHandleView* handle) {
dragging_handle_ = handle;
@@ -460,7 +441,7 @@
EditingHandleView* handle,
const gfx::Rect& rect,
const gfx::Rect& rect_in_screen) {
- handle->SetWidgetVisible(client_view_->GetBounds().Contains(rect), false);
+ handle->SetWidgetVisible(client_view_->GetBounds().Contains(rect));
if (handle->IsWidgetVisible())
handle->SetSelectionRectInScreen(rect_in_screen);
}
« no previous file with comments | « ui/views/touchui/touch_selection_controller_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698