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

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 183853037: aura: Remove client::UserActionClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unrevert Created 6 years, 9 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/aura/window_tree_host_x11.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index 44f13f4649ffc9070169fd8c377ccb72bbfc5016..5f00e62c08857071c5e0dd38051e1b318531eb96 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -18,7 +18,6 @@
#include "third_party/skia/include/core/SkPath.h"
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/client/focus_client.h"
-#include "ui/aura/client/user_action_client.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_property.h"
@@ -65,10 +64,6 @@ DEFINE_WINDOW_PROPERTY_KEY(
namespace {
-// Standard Linux mouse buttons for going back and forward.
-const int kBackMouseButton = 8;
-const int kForwardMouseButton = 9;
-
// Constants that are part of EWMH.
const int k_NET_WM_STATE_ADD = 1;
const int k_NET_WM_STATE_REMOVE = 0;
@@ -1302,20 +1297,7 @@ uint32_t DesktopWindowTreeHostX11::Dispatch(const base::NativeEvent& event) {
SendEventToProcessor(&keyup_event);
break;
}
- case ButtonPress: {
- if (static_cast<int>(xev->xbutton.button) == kBackMouseButton ||
- static_cast<int>(xev->xbutton.button) == kForwardMouseButton) {
- aura::client::UserActionClient* gesture_client =
- aura::client::GetUserActionClient(dispatcher_->window());
- if (gesture_client) {
- gesture_client->OnUserAction(
- static_cast<int>(xev->xbutton.button) == kBackMouseButton ?
- aura::client::UserActionClient::BACK :
- aura::client::UserActionClient::FORWARD);
- }
- break;
- }
- } // fallthrough
+ case ButtonPress:
case ButtonRelease: {
ui::EventType event_type = ui::EventTypeFromNative(xev);
switch (event_type) {
@@ -1408,34 +1390,6 @@ uint32_t DesktopWindowTreeHostX11::Dispatch(const base::NativeEvent& event) {
num_coalesced = ui::CoalescePendingMotionEvents(xev, &last_event);
if (num_coalesced > 0)
xev = &last_event;
- } else if (type == ui::ET_MOUSE_PRESSED) {
- XIDeviceEvent* xievent =
- static_cast<XIDeviceEvent*>(xev->xcookie.data);
- int button = xievent->detail;
- if (button == kBackMouseButton || button == kForwardMouseButton) {
- aura::client::UserActionClient* gesture_client =
- aura::client::GetUserActionClient(
- delegate_->AsDispatcher()->window());
- if (gesture_client) {
- bool reverse_direction =
- ui::IsTouchpadEvent(xev) && ui::IsNaturalScrollEnabled();
- gesture_client->OnUserAction(
- (button == kBackMouseButton && !reverse_direction) ||
- (button == kForwardMouseButton && reverse_direction) ?
- aura::client::UserActionClient::BACK :
- aura::client::UserActionClient::FORWARD);
- }
- break;
- }
- } else if (type == ui::ET_MOUSE_RELEASED) {
- XIDeviceEvent* xievent =
- static_cast<XIDeviceEvent*>(xev->xcookie.data);
- int button = xievent->detail;
- if (button == kBackMouseButton || button == kForwardMouseButton) {
- // We've already passed the back/forward mouse down to the user
- // action client; we want to swallow the corresponding release.
- break;
- }
}
ui::MouseEvent mouseev(xev);
DispatchMouseEvent(&mouseev);
« no previous file with comments | « ui/aura/window_tree_host_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698