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

Unified Diff: ui/views/widget/desktop_native_widget_aura.cc

Issue 10910144: Get mouse events to work with win aura, and make the combobox function in the views examples app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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/views/widget/desktop_capture_client.cc ('k') | ui/views/widget/desktop_root_window_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_native_widget_aura.cc
===================================================================
--- ui/views/widget/desktop_native_widget_aura.cc (revision 155443)
+++ ui/views/widget/desktop_native_widget_aura.cc (working copy)
@@ -4,8 +4,10 @@
#include "ui/views/widget/desktop_native_widget_aura.h"
+#include "ui/aura/root_window_host.h"
#include "ui/aura/window.h"
#include "ui/base/hit_test.h"
+#include "ui/compositor/layer.h"
#include "ui/views/widget/desktop_root_window_host.h"
namespace views {
@@ -68,11 +70,11 @@
}
const ui::Compositor* DesktopNativeWidgetAura::GetCompositor() const {
- return NULL;
+ return window_->layer()->GetCompositor();
}
ui::Compositor* DesktopNativeWidgetAura::GetCompositor() {
- return NULL;
+ return window_->layer()->GetCompositor();
}
void DesktopNativeWidgetAura::CalculateOffsetToAncestorWithLayer(
@@ -157,7 +159,7 @@
}
gfx::Rect DesktopNativeWidgetAura::GetClientAreaBoundsInScreen() const {
- return gfx::Rect(100, 100);
+ return desktop_root_window_host_->GetClientAreaBoundsInScreen();
}
gfx::Rect DesktopNativeWidgetAura::GetRestoredBounds() const {
@@ -183,15 +185,19 @@
}
void DesktopNativeWidgetAura::Close() {
+ desktop_root_window_host_->Close();
}
void DesktopNativeWidgetAura::CloseNow() {
+ desktop_root_window_host_->CloseNow();
}
void DesktopNativeWidgetAura::Show() {
+ desktop_root_window_host_->AsRootWindowHost()->Show();
}
void DesktopNativeWidgetAura::Hide() {
+ desktop_root_window_host_->AsRootWindowHost()->Hide();
}
void DesktopNativeWidgetAura::ShowMaximizedWithBounds(
@@ -203,7 +209,7 @@
}
bool DesktopNativeWidgetAura::IsVisible() const {
- return false;
+ return desktop_root_window_host_->IsVisible();
}
void DesktopNativeWidgetAura::Activate() {
@@ -263,6 +269,8 @@
}
void DesktopNativeWidgetAura::SchedulePaintInRect(const gfx::Rect& rect) {
+ if (window_)
+ window_->SchedulePaintInRect(rect);
}
void DesktopNativeWidgetAura::SetCursor(gfx::NativeCursor cursor) {
@@ -369,7 +377,23 @@
}
ui::EventResult DesktopNativeWidgetAura::OnMouseEvent(ui::MouseEvent* event) {
- return ui::ER_UNHANDLED;
+ DCHECK(window_->IsVisible());
+ if (event->type() == ui::ET_MOUSEWHEEL) {
+ return native_widget_delegate_->OnMouseEvent(*event) ?
Peter Kasting 2012/09/07 22:32:15 Random drive-by nit: Can these delegate functions
+ ui::ER_HANDLED : ui::ER_UNHANDLED;
+ }
+
+ if (event->type() == ui::ET_SCROLL) {
+ if (native_widget_delegate_->OnMouseEvent(*event))
+ return ui::ER_HANDLED;
+
+ // Convert unprocessed scroll events into wheel events.
+ ui::MouseWheelEvent mwe(*static_cast<ui::ScrollEvent*>(event));
+ return native_widget_delegate_->OnMouseEvent(mwe) ?
+ ui::ER_HANDLED : ui::ER_UNHANDLED;
+ }
+ return native_widget_delegate_->OnMouseEvent(*event) ?
+ ui::ER_HANDLED : ui::ER_UNHANDLED;
}
ui::TouchStatus DesktopNativeWidgetAura::OnTouchEvent(ui::TouchEvent* event) {
« no previous file with comments | « ui/views/widget/desktop_capture_client.cc ('k') | ui/views/widget/desktop_root_window_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698