| 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/navigator_host_impl.h" | 5 #include "services/kiosk_wm/navigator_host_impl.h" |
| 6 | 6 |
| 7 #include "sky/tools/debugger/debugger.h" | 7 #include "services/kiosk_wm/kiosk_wm.h" |
| 8 | 8 |
| 9 namespace sky { | 9 namespace mojo { |
| 10 namespace debugger { | 10 namespace kiosk_wm { |
| 11 | 11 |
| 12 NavigatorHostImpl::NavigatorHostImpl(SkyDebugger* debugger) | 12 NavigatorHostImpl::NavigatorHostImpl(KioskWM* window_manager) |
| 13 : debugger_(debugger->GetWeakPtr()) { | 13 : kiosk_wm_(window_manager->GetWeakPtr()) { |
| 14 } | 14 } |
| 15 | 15 |
| 16 NavigatorHostImpl::~NavigatorHostImpl() { | 16 NavigatorHostImpl::~NavigatorHostImpl() { |
| 17 } | 17 } |
| 18 | 18 |
| 19 void NavigatorHostImpl::DidNavigateLocally(const mojo::String& url) { | 19 void NavigatorHostImpl::DidNavigateLocally(const mojo::String& url) { |
| 20 // TODO(abarth): Do something interesting. | 20 // TODO(abarth): Do something interesting. |
| 21 } | 21 } |
| 22 | 22 |
| 23 void NavigatorHostImpl::RequestNavigate(mojo::Target target, | 23 void NavigatorHostImpl::RequestNavigate(mojo::Target target, |
| 24 mojo::URLRequestPtr request) { | 24 mojo::URLRequestPtr request) { |
| 25 if (!debugger_) | 25 if (!kiosk_wm_) |
| 26 return; | 26 return; |
| 27 debugger_->NavigateToURL(request->url); | 27 |
| 28 // kiosk_wm sets up default services including navigation. |
| 29 kiosk_wm_->ReplaceContentWithURL(request->url); |
| 28 } | 30 } |
| 29 | 31 |
| 30 } // namespace debugger | 32 } // namespace kiosk_wm |
| 31 } // namespace sky | 33 } // namespace mojo |
| OLD | NEW |