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

Unified Diff: ui/aura/toplevel_window_event_filter.cc

Issue 7977012: Adds a NonClientFrameView for generic toplevel windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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/toplevel_window_event_filter.h ('k') | ui/aura_shell/aura_shell.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/toplevel_window_event_filter.cc
===================================================================
--- ui/aura/toplevel_window_event_filter.cc (revision 102277)
+++ ui/aura/toplevel_window_event_filter.cc (working copy)
@@ -4,6 +4,8 @@
#include "ui/aura/toplevel_window_event_filter.h"
+#include "ui/aura/cursor.h"
+#include "ui/aura/desktop.h"
#include "ui/aura/event.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
@@ -25,9 +27,12 @@
bool ToplevelWindowEventFilter::OnMouseEvent(Window* target,
MouseEvent* event) {
switch (event->type()) {
- case ui::ET_MOUSE_PRESSED:
+ case ui::ET_MOUSE_MOVED:
window_component_ =
target->delegate()->GetNonClientComponent(event->location());
+ UpdateCursorForWindowComponent();
+ break;
+ case ui::ET_MOUSE_PRESSED:
MoveWindowToFront(target);
mouse_down_offset_ = event->location();
window_location_ = target->bounds().origin();
@@ -64,4 +69,19 @@
}
}
+void ToplevelWindowEventFilter::UpdateCursorForWindowComponent() {
+ switch (window_component_) {
+ case HTLEFT:
+ case HTRIGHT:
+ Desktop::GetInstance()->SetCursor(CURSOR_SIZE_HORIZONTAL);
+ break;
+ case HTBOTTOM:
+ Desktop::GetInstance()->SetCursor(CURSOR_SIZE_VERTICAL);
+ break;
+ default:
+ Desktop::GetInstance()->SetCursor(CURSOR_POINTER);
+ break;
+ }
+}
+
} // namespace aura
« no previous file with comments | « ui/aura/toplevel_window_event_filter.h ('k') | ui/aura_shell/aura_shell.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698