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

Unified Diff: ui/views/event_utils_aura.cc

Issue 245993005: views: move native event reposting back to MenuController as it's the only (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win compile Created 6 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 | « ui/views/event_utils.h ('k') | ui/views/event_utils_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/event_utils_aura.cc
diff --git a/ui/views/event_utils_aura.cc b/ui/views/event_utils_aura.cc
deleted file mode 100644
index 5e93e8e55731f2cd4908f690bf7d2530169e9b42..0000000000000000000000000000000000000000
--- a/ui/views/event_utils_aura.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 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.
-
-#include "ui/views/event_utils.h"
-
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-#include "ui/aura/client/screen_position_client.h"
-#include "ui/aura/window_event_dispatcher.h"
-#include "ui/aura/window_tree_host.h"
-#include "ui/events/event.h"
-#include "ui/gfx/point.h"
-#include "ui/views/views_delegate.h"
-
-using aura::client::ScreenPositionClient;
-
-namespace views {
-
-bool RepostLocatedEvent(gfx::NativeWindow window,
- const ui::LocatedEvent& event) {
-#if defined(OS_WIN)
- // On Windows, if the |window| parameter is NULL, then we attempt to repost
- // the event to the window at the current location, if it is on the current
- // thread.
- HWND target_window = NULL;
- if (!window) {
- target_window = ::WindowFromPoint(event.location().ToPOINT());
- if (::GetWindowThreadProcessId(target_window, NULL) !=
- ::GetCurrentThreadId())
- return false;
- } else {
- if (ViewsDelegate::views_delegate &&
- !ViewsDelegate::views_delegate->IsWindowInMetro(window))
- target_window = window->GetHost()->GetAcceleratedWidget();
- }
- return RepostLocatedEventWin(target_window, event);
-#else
- if (!window)
- return false;
-
- aura::Window* root_window = window->GetRootWindow();
-
- gfx::Point root_loc(event.location());
- ScreenPositionClient* spc =
- aura::client::GetScreenPositionClient(root_window);
- if (!spc)
- return false;
-
- spc->ConvertPointFromScreen(root_window, &root_loc);
-
- scoped_ptr<ui::LocatedEvent> relocated;
- if (!event.IsMouseEvent()) {
- // TODO(rbyers): Gesture event repost is tricky to get right
- // crbug.com/170987.
- DCHECK(event.IsGestureEvent());
- return false;
- }
-
- const ui::MouseEvent& orig = static_cast<const ui::MouseEvent&>(event);
- relocated.reset(new ui::MouseEvent(orig));
- relocated->set_location(root_loc);
- relocated->set_root_location(root_loc);
-
- root_window->GetHost()->dispatcher()->RepostEvent(*relocated);
- return true;
-#endif
-}
-
-} // namespace views
« no previous file with comments | « ui/views/event_utils.h ('k') | ui/views/event_utils_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698