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

Unified Diff: ui/views/widget/desktop_root_window_host_win.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_root_window_host_win.h ('k') | ui/views/win/hwnd_message_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_root_window_host_win.cc
===================================================================
--- ui/views/widget/desktop_root_window_host_win.cc (revision 156204)
+++ ui/views/widget/desktop_root_window_host_win.cc (working copy)
@@ -4,7 +4,11 @@
#include "ui/views/widget/desktop_root_window_host_win.h"
+#include "ui/aura/desktop/desktop_activation_client.h"
+#include "ui/aura/desktop/desktop_dispatcher_client.h"
+#include "ui/aura/focus_manager.h"
#include "ui/aura/root_window.h"
+#include "ui/views/widget/desktop_capture_client.h"
#include "ui/views/win/hwnd_message_handler.h"
namespace views {
@@ -40,13 +44,50 @@
root_window_->Init();
root_window_->AddChild(content_window_);
root_window_host_delegate_ = root_window_.get();
+
+ native_widget_delegate_->OnNativeWidgetCreated();
+
+ capture_client_.reset(new DesktopCaptureClient);
+ aura::client::SetCaptureClient(root_window_.get(), capture_client_.get());
+
+ focus_manager_.reset(new aura::FocusManager);
+ root_window_->set_focus_manager(focus_manager_.get());
+
+ activation_client_.reset(
+ new aura::DesktopActivationClient(root_window_->GetFocusManager()));
+ aura::client::SetActivationClient(root_window_.get(),
+ activation_client_.get());
+
+ dispatcher_client_.reset(new aura::DesktopDispatcherClient);
+ aura::client::SetDispatcherClient(root_window_.get(),
+ dispatcher_client_.get());
}
+void DesktopRootWindowHostWin::Close() {
+ message_handler_->Close();
+}
+
+void DesktopRootWindowHostWin::CloseNow() {
+ message_handler_->CloseNow();
+}
+
+aura::RootWindowHost* DesktopRootWindowHostWin::AsRootWindowHost() {
+ return this;
+}
+
void DesktopRootWindowHostWin::ShowWindowWithState(
ui::WindowShowState show_state) {
message_handler_->ShowWindowWithState(show_state);
}
+bool DesktopRootWindowHostWin::IsVisible() const {
+ return message_handler_->IsVisible();
+}
+
+gfx::Rect DesktopRootWindowHostWin::GetClientAreaBoundsInScreen() const {
+ return message_handler_->GetClientAreaBoundsInScreen();
+}
+
////////////////////////////////////////////////////////////////////////////////
// DesktopRootWindowHostWin, RootWindowHost implementation:
@@ -59,9 +100,11 @@
}
void DesktopRootWindowHostWin::Show() {
+ message_handler_->Show();
}
void DesktopRootWindowHostWin::Hide() {
+ message_handler_->Hide();
}
void DesktopRootWindowHostWin::ToggleFullScreen() {
@@ -254,8 +297,6 @@
// 2. MouseWheel.
// 3. Drop target.
// 4. Tooltip Manager.
-
- native_widget_delegate_->OnNativeWidgetCreated();
}
void DesktopRootWindowHostWin::HandleDestroying() {
@@ -289,7 +330,8 @@
void DesktopRootWindowHostWin::HandleClientSizeChanged(
const gfx::Size& new_size) {
- root_window_host_delegate_->OnHostResized(new_size);
+ if (root_window_host_delegate_)
+ root_window_host_delegate_->OnHostResized(new_size);
// TODO(beng): replace with a layout manager??
content_window_->SetBounds(gfx::Rect(new_size));
}
@@ -304,7 +346,8 @@
}
bool DesktopRootWindowHostWin::HandleMouseEvent(const ui::MouseEvent& event) {
- return false;
+ return root_window_host_delegate_->OnHostMouseEvent(
+ const_cast<ui::MouseEvent*>(&event));
}
bool DesktopRootWindowHostWin::HandleKeyEvent(const ui::KeyEvent& event) {
« no previous file with comments | « ui/views/widget/desktop_root_window_host_win.h ('k') | ui/views/win/hwnd_message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698