| OLD | NEW |
| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void SkyDebugger::OnViewDestroyed(mojo::View* view) { | 76 void SkyDebugger::OnViewDestroyed(mojo::View* view) { |
| 77 view->RemoveObserver(this); | 77 view->RemoveObserver(this); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void SkyDebugger::OnViewBoundsChanged(mojo::View* view, | 80 void SkyDebugger::OnViewBoundsChanged(mojo::View* view, |
| 81 const mojo::Rect& old_bounds, | 81 const mojo::Rect& old_bounds, |
| 82 const mojo::Rect& new_bounds) { | 82 const mojo::Rect& new_bounds) { |
| 83 content_->SetBounds(new_bounds); | 83 content_->SetBounds(new_bounds); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void SkyDebugger::OnViewInputEvent( | |
| 87 mojo::View* view, const mojo::EventPtr& event) { | |
| 88 if (view != root_) | |
| 89 return; | |
| 90 // Currently, the event targeting system is broken for mojo::Views, so we | |
| 91 // blindly forward events from the root to the content view. Once event | |
| 92 // targeting works, we should be able to rip out this code. | |
| 93 window_manager_app_->DispatchInputEventToView(content_, event.Clone()); | |
| 94 } | |
| 95 | |
| 96 void SkyDebugger::Create(mojo::ApplicationConnection* connection, | 86 void SkyDebugger::Create(mojo::ApplicationConnection* connection, |
| 97 mojo::InterfaceRequest<Debugger> request) { | 87 mojo::InterfaceRequest<Debugger> request) { |
| 98 mojo::WeakBindToRequest(this, &request); | 88 mojo::WeakBindToRequest(this, &request); |
| 99 } | 89 } |
| 100 | 90 |
| 101 void SkyDebugger::NavigateToURL(const mojo::String& url) { | 91 void SkyDebugger::NavigateToURL(const mojo::String& url) { |
| 102 // We can get Navigate commands before we've actually been | 92 // We can get Navigate commands before we've actually been |
| 103 // embedded into the view and content_ created. | 93 // embedded into the view and content_ created. |
| 104 // Just save the last one. | 94 // Just save the last one. |
| 105 if (content_) { | 95 if (content_) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 126 } | 116 } |
| 127 | 117 |
| 128 void SkyDebugger::InjectInspector() { | 118 void SkyDebugger::InjectInspector() { |
| 129 InspectorServicePtr inspector_service; | 119 InspectorServicePtr inspector_service; |
| 130 mojo::ConnectToService(viewer_services_.get(), &inspector_service); | 120 mojo::ConnectToService(viewer_services_.get(), &inspector_service); |
| 131 inspector_service->Inject(); | 121 inspector_service->Inject(); |
| 132 } | 122 } |
| 133 | 123 |
| 134 } // namespace debugger | 124 } // namespace debugger |
| 135 } // namespace sky | 125 } // namespace sky |
| OLD | NEW |