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

Side by Side Diff: sky/tools/debugger/debugger.cc

Issue 714213003: Input events are broken in skydb (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « sky/tools/debugger/debugger.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sky/tools/debugger/debugger.h" 5 #include "sky/tools/debugger/debugger.h"
6 6
7 #include "mojo/services/window_manager/basic_focus_rules.h" 7 #include "mojo/services/window_manager/basic_focus_rules.h"
8 8
9 namespace sky { 9 namespace sky {
10 namespace debugger { 10 namespace debugger {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 void SkyDebugger::OnViewDestroyed(mojo::View* view) { 75 void SkyDebugger::OnViewDestroyed(mojo::View* view) {
76 view->RemoveObserver(this); 76 view->RemoveObserver(this);
77 } 77 }
78 78
79 void SkyDebugger::OnViewBoundsChanged(mojo::View* view, 79 void SkyDebugger::OnViewBoundsChanged(mojo::View* view,
80 const mojo::Rect& old_bounds, 80 const mojo::Rect& old_bounds,
81 const mojo::Rect& new_bounds) { 81 const mojo::Rect& new_bounds) {
82 content_->SetBounds(new_bounds); 82 content_->SetBounds(new_bounds);
83 } 83 }
84 84
85 void SkyDebugger::OnViewInputEvent(
86 mojo::View* view, const mojo::EventPtr& event) {
87 if (view != root_)
88 return;
89 // Currently, the event targeting system is broken for mojo::Views, so we
90 // blindly forward events from the root to the content view. Once event
91 // targeting works, we should be able to rip out this code.
92 window_manager_app_->DispatchInputEventToView(content_, event.Clone());
93 }
94
85 void SkyDebugger::Create(mojo::ApplicationConnection* connection, 95 void SkyDebugger::Create(mojo::ApplicationConnection* connection,
86 mojo::InterfaceRequest<Debugger> request) { 96 mojo::InterfaceRequest<Debugger> request) {
87 mojo::WeakBindToRequest(this, &request); 97 mojo::WeakBindToRequest(this, &request);
88 } 98 }
89 99
90 void SkyDebugger::NavigateToURL(const mojo::String& url) { 100 void SkyDebugger::NavigateToURL(const mojo::String& url) {
91 // We can get Navigate commands before we've actually been 101 // We can get Navigate commands before we've actually been
92 // embedded into the view and content_ created. 102 // embedded into the view and content_ created.
93 // Just save the last one. 103 // Just save the last one.
94 if (content_) { 104 if (content_) {
(...skipping 20 matching lines...) Expand all
115 } 125 }
116 126
117 void SkyDebugger::InjectInspector() { 127 void SkyDebugger::InjectInspector() {
118 InspectorServicePtr inspector_service; 128 InspectorServicePtr inspector_service;
119 mojo::ConnectToService(viewer_services_.get(), &inspector_service); 129 mojo::ConnectToService(viewer_services_.get(), &inspector_service);
120 inspector_service->Inject(); 130 inspector_service->Inject();
121 } 131 }
122 132
123 } // namespace debugger 133 } // namespace debugger
124 } // namespace sky 134 } // namespace sky
OLDNEW
« no previous file with comments | « sky/tools/debugger/debugger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698