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

Unified Diff: ui/aura/test/ui_controls_factory_ozone.cc

Issue 2836073003: Fix an interactive ui test (Closed)
Patch Set: Rename to g_button_down_mask Created 3 years, 8 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 | « chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/ui_controls_factory_ozone.cc
diff --git a/ui/aura/test/ui_controls_factory_ozone.cc b/ui/aura/test/ui_controls_factory_ozone.cc
index 403757b947503c7c2cf344760960eb90af5a6937..cc3589e4778bbc6d7d27b45374e40899a740ffec 100644
--- a/ui/aura/test/ui_controls_factory_ozone.cc
+++ b/ui/aura/test/ui_controls_factory_ozone.cc
@@ -21,6 +21,9 @@ namespace aura {
namespace test {
namespace {
+// Mask of the mouse buttons currently down.
+unsigned g_button_down_mask = 0;
+
class UIControlsOzone : public ui_controls::UIControlsAura {
public:
UIControlsOzone(WindowTreeHost* host) : host_(host) {}
@@ -42,7 +45,7 @@ class UIControlsOzone : public ui_controls::UIControlsAura {
bool alt,
bool command,
const base::Closure& closure) override {
- int flags = button_down_mask_;
+ int flags = g_button_down_mask;
if (control) {
flags |= ui::EF_CONTROL_DOWN;
@@ -111,12 +114,12 @@ class UIControlsOzone : public ui_controls::UIControlsAura {
ui::EventType event_type;
- if (button_down_mask_)
+ if (g_button_down_mask)
event_type = ui::ET_MOUSE_DRAGGED;
else
event_type = ui::ET_MOUSE_MOVED;
- PostMouseEvent(event_type, host_location, button_down_mask_, 0);
+ PostMouseEvent(event_type, host_location, g_button_down_mask, 0);
RunClosureAfterAllPendingUIEvents(closure);
return true;
@@ -157,14 +160,14 @@ class UIControlsOzone : public ui_controls::UIControlsAura {
}
if (state & ui_controls::DOWN) {
- button_down_mask_ |= flag;
+ g_button_down_mask |= flag;
PostMouseEvent(ui::ET_MOUSE_PRESSED, host_location,
- button_down_mask_ | flag, flag);
+ g_button_down_mask | flag, flag);
}
if (state & ui_controls::UP) {
- button_down_mask_ &= ~flag;
+ g_button_down_mask &= ~flag;
PostMouseEvent(ui::ET_MOUSE_RELEASED, host_location,
- button_down_mask_ | flag, flag);
+ g_button_down_mask | flag, flag);
}
RunClosureAfterAllPendingUIEvents(closure);
@@ -229,9 +232,6 @@ class UIControlsOzone : public ui_controls::UIControlsAura {
WindowTreeHost* host_;
- // Mask of the mouse buttons currently down.
- unsigned button_down_mask_ = 0;
-
DISALLOW_COPY_AND_ASSIGN(UIControlsOzone);
};
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698