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

Unified Diff: mojo/examples/window_manager/window_manager.cc

Issue 636363002: Splits window manager like methods into ViewManagerServiceDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 2 trunk Created 6 years, 2 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 | « no previous file | mojo/examples/wm_flow/wm/wm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/window_manager/window_manager.cc
diff --git a/mojo/examples/window_manager/window_manager.cc b/mojo/examples/window_manager/window_manager.cc
index 82a22bbc113008b50fc86990e31d21165d808e6b..057ba6767c9221a1d2a64ebce83d3747dc15db88 100644
--- a/mojo/examples/window_manager/window_manager.cc
+++ b/mojo/examples/window_manager/window_manager.cc
@@ -20,10 +20,10 @@
#include "mojo/services/public/cpp/view_manager/view_manager.h"
#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
#include "mojo/services/public/cpp/view_manager/view_observer.h"
-#include "mojo/services/public/cpp/view_manager/window_manager_delegate.h"
#include "mojo/services/public/interfaces/input_events/input_events.mojom.h"
#include "mojo/services/public/interfaces/navigation/navigation.mojom.h"
#include "mojo/services/window_manager/window_manager_app.h"
+#include "mojo/services/window_manager/window_manager_delegate.h"
#include "mojo/views/views_init.h"
#include "ui/aura/window.h"
#include "ui/events/event.h"
@@ -181,32 +181,9 @@ class KeyboardManager : public KeyboardClient,
virtual void OnKeyboardEvent(Id view_id,
int32_t code,
int32_t flags) override {
- View* view = view_manager_->GetViewById(view_id);
- if (!view)
- return;
-#if defined(OS_WIN)
- const bool is_char = code != ui::VKEY_BACK && code != ui::VKEY_RETURN;
-#else
- const bool is_char = false;
-#endif
- if (is_char) {
- view_manager_->DispatchEvent(
- view,
- Event::From(ui::KeyEvent(ui::ET_KEY_PRESSED,
- static_cast<ui::KeyboardCode>(code),
- flags)));
- } else {
- view_manager_->DispatchEvent(
- view,
- Event::From(ui::KeyEvent(static_cast<base::char16>(code),
- static_cast<ui::KeyboardCode>(code),
- flags)));
- }
- view_manager_->DispatchEvent(
- view,
- Event::From(ui::KeyEvent(ui::ET_KEY_RELEASED,
- static_cast<ui::KeyboardCode>(code),
- flags)));
+ // TODO(sky): figure this out. Code use to dispatch events, but that's a
+ // hack. Instead strings should be passed through, or maybe a richer text
+ // input interface.
}
// Overridden from ViewObserver:
@@ -463,7 +440,6 @@ class WindowManager
const Id kInvalidSourceViewId = 0;
OnLaunch(kInvalidSourceViewId, TARGET_DEFAULT, url);
}
- virtual void DispatchEvent(EventPtr event) override {}
// Overridden from ui::EventHandler:
virtual void OnEvent(ui::Event* event) override {
« no previous file with comments | « no previous file | mojo/examples/wm_flow/wm/wm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698