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

Side by Side Diff: blimp/client/core/blimp_navigation_controller_impl.cc

Issue 2166563003: Split //blimp/client/core to relevant parts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-assignment-source
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(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/blimp_navigation_controller_impl.h"
6
7 #include "base/bind.h"
8 #include "base/location.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/threading/thread_task_runner_handle.h"
11 #include "blimp/client/core/blimp_navigation_controller_delegate.h"
12
13 namespace blimp {
14 namespace client {
15
16 BlimpNavigationControllerImpl::BlimpNavigationControllerImpl(
17 BlimpNavigationControllerDelegate* delegate)
18 : delegate_(delegate), weak_ptr_factory_(this) {}
19
20 BlimpNavigationControllerImpl::~BlimpNavigationControllerImpl() = default;
21
22 void BlimpNavigationControllerImpl::LoadURL(const GURL& url) {
23 current_url_ = url;
24 // Temporary trick to ensure that the delegate is not invoked before this
25 // method has finished executing. This enables tests to test the
26 // asynchronous nature of the API.
27 // TODO(shaktisahu): Remove this after integration with NavigationFeature.
28 base::ThreadTaskRunnerHandle::Get()->PostTask(
29 FROM_HERE,
30 base::Bind(&BlimpNavigationControllerImpl::NotifyDelegateURLLoaded,
31 weak_ptr_factory_.GetWeakPtr(), url));
32 }
33
34 const GURL& BlimpNavigationControllerImpl::GetURL() {
35 return current_url_;
36 }
37
38 void BlimpNavigationControllerImpl::NotifyDelegateURLLoaded(const GURL& url) {
39 delegate_->NotifyURLLoaded(url);
40 }
41
42 } // namespace client
43 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/core/blimp_navigation_controller_impl.h ('k') | blimp/client/core/blimp_navigation_controller_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698