OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 "blimp/client/core/contents/blimp_navigation_controller_impl.h" | 5 #include "blimp/client/core/contents/blimp_navigation_controller_impl.h" |
6 | 6 |
7 #include "blimp/client/core/contents/blimp_navigation_controller_delegate.h" | 7 #include "blimp/client/core/contents/blimp_navigation_controller_delegate.h" |
8 | 8 |
9 namespace { | 9 namespace { |
10 // TODO(shaktisahu): NavigationFeature currently needs a tab_id. Remove this | 10 // TODO(shaktisahu): NavigationFeature currently needs a tab_id. Remove this |
(...skipping 24 matching lines...) Expand all Loading... | |
35 current_url_ = url; | 35 current_url_ = url; |
36 navigation_feature_->NavigateToUrlText(kDummyTabId, current_url_.spec()); | 36 navigation_feature_->NavigateToUrlText(kDummyTabId, current_url_.spec()); |
37 } | 37 } |
38 | 38 |
39 void BlimpNavigationControllerImpl::Reload() { | 39 void BlimpNavigationControllerImpl::Reload() { |
40 navigation_feature_->Reload(kDummyTabId); | 40 navigation_feature_->Reload(kDummyTabId); |
41 } | 41 } |
42 | 42 |
43 bool BlimpNavigationControllerImpl::CanGoBack() const { | 43 bool BlimpNavigationControllerImpl::CanGoBack() const { |
44 NOTIMPLEMENTED(); | 44 NOTIMPLEMENTED(); |
45 return false; | 45 return true; |
46 } | 46 } |
47 | 47 |
48 bool BlimpNavigationControllerImpl::CanGoForward() const { | 48 bool BlimpNavigationControllerImpl::CanGoForward() const { |
49 NOTIMPLEMENTED(); | 49 NOTIMPLEMENTED(); |
50 return false; | 50 return true; |
51 } | 51 } |
52 | 52 |
53 void BlimpNavigationControllerImpl::GoBack() { | 53 void BlimpNavigationControllerImpl::GoBack() { |
54 navigation_feature_->GoBack(kDummyTabId); | 54 navigation_feature_->GoBack(kDummyTabId); |
55 } | 55 } |
56 | 56 |
57 void BlimpNavigationControllerImpl::GoForward() { | 57 void BlimpNavigationControllerImpl::GoForward() { |
58 navigation_feature_->GoForward(kDummyTabId); | 58 navigation_feature_->GoForward(kDummyTabId); |
59 } | 59 } |
60 | 60 |
61 const GURL& BlimpNavigationControllerImpl::GetURL() { | 61 const GURL& BlimpNavigationControllerImpl::GetURL() { |
62 return current_url_; | 62 return current_url_; |
63 } | 63 } |
64 | 64 |
65 const std::string& BlimpNavigationControllerImpl::GetTitle() { | |
66 return current_title_; | |
67 } | |
68 | |
65 void BlimpNavigationControllerImpl::OnUrlChanged(int tab_id, const GURL& url) { | 69 void BlimpNavigationControllerImpl::OnUrlChanged(int tab_id, const GURL& url) { |
70 current_url_ = url; | |
David Trainor- moved to gerrit
2016/08/18 17:06:30
Do we have unit tests for this? It looks like it
shaktisahu
2016/08/18 19:36:06
Actually this is also set in LoadURL() due to whic
| |
66 delegate_->OnNavigationStateChanged(); | 71 delegate_->OnNavigationStateChanged(); |
67 } | 72 } |
68 | 73 |
69 void BlimpNavigationControllerImpl::OnFaviconChanged(int tab_id, | 74 void BlimpNavigationControllerImpl::OnFaviconChanged(int tab_id, |
70 const SkBitmap& favicon) { | 75 const SkBitmap& favicon) { |
71 delegate_->OnNavigationStateChanged(); | 76 delegate_->OnNavigationStateChanged(); |
72 } | 77 } |
73 | 78 |
74 void BlimpNavigationControllerImpl::OnTitleChanged(int tab_id, | 79 void BlimpNavigationControllerImpl::OnTitleChanged(int tab_id, |
75 const std::string& title) { | 80 const std::string& title) { |
81 current_title_ = title; | |
76 delegate_->OnNavigationStateChanged(); | 82 delegate_->OnNavigationStateChanged(); |
77 } | 83 } |
78 | 84 |
79 void BlimpNavigationControllerImpl::OnLoadingChanged(int tab_id, bool loading) { | 85 void BlimpNavigationControllerImpl::OnLoadingChanged(int tab_id, bool loading) { |
80 delegate_->OnNavigationStateChanged(); | 86 delegate_->OnNavigationStateChanged(); |
81 } | 87 } |
82 | 88 |
83 void BlimpNavigationControllerImpl::OnPageLoadStatusUpdate(int tab_id, | 89 void BlimpNavigationControllerImpl::OnPageLoadStatusUpdate(int tab_id, |
84 bool completed) { | 90 bool completed) { |
85 delegate_->OnNavigationStateChanged(); | 91 delegate_->OnNavigationStateChanged(); |
86 } | 92 } |
87 | 93 |
88 } // namespace client | 94 } // namespace client |
89 } // namespace blimp | 95 } // namespace blimp |
OLD | NEW |