| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include <blimp/client/core/contents/fake_navigation_feature.h> | |
| 6 #include "base/bind.h" | |
| 7 #include "base/location.h" | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "base/threading/thread_task_runner_handle.h" | |
| 10 #include "url/gurl.h" | |
| 11 | |
| 12 namespace blimp { | |
| 13 namespace client { | |
| 14 | |
| 15 FakeNavigationFeature::FakeNavigationFeature() {} | |
| 16 | |
| 17 FakeNavigationFeature::~FakeNavigationFeature() {} | |
| 18 | |
| 19 void FakeNavigationFeature::NavigateToUrlText(int tab_id, | |
| 20 const std::string& url_text) { | |
| 21 base::ThreadTaskRunnerHandle::Get()->PostTask( | |
| 22 FROM_HERE, base::Bind(&FakeNavigationFeature::NotifyDelegateURLLoaded, | |
| 23 base::Unretained(this), tab_id, url_text)); | |
| 24 } | |
| 25 | |
| 26 void FakeNavigationFeature::NotifyDelegateURLLoaded( | |
| 27 int tab_id, | |
| 28 const std::string& url_text) { | |
| 29 NavigationFeatureDelegate* delegate = FindDelegate(tab_id); | |
| 30 delegate->OnUrlChanged(tab_id, GURL(url_text)); | |
| 31 } | |
| 32 | |
| 33 } // namespace client | |
| 34 } // namespace blimp | |
| OLD | NEW |