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 "services/navigation/public/cpp/view.h" | 5 #include "services/navigation/public/cpp/view.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "components/mus/public/cpp/window.h" | 8 #include "components/mus/public/cpp/window.h" |
9 #include "services/navigation/public/cpp/view_delegate.h" | 9 #include "services/navigation/public/cpp/view_delegate.h" |
10 #include "services/navigation/public/cpp/view_observer.h" | 10 #include "services/navigation/public/cpp/view_observer.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 void View::EmbedInWindow(mus::Window* parent) { | 92 void View::EmbedInWindow(mus::Window* parent) { |
93 mus::mojom::WindowTreeClientPtr client; | 93 mus::mojom::WindowTreeClientPtr client; |
94 view_->GetWindowTreeClient(GetProxy(&client)); | 94 view_->GetWindowTreeClient(GetProxy(&client)); |
95 parent->Embed(std::move(client)); | 95 parent->Embed(std::move(client)); |
96 } | 96 } |
97 | 97 |
98 //////////////////////////////////////////////////////////////////////////////// | 98 //////////////////////////////////////////////////////////////////////////////// |
99 // View, mojom::ViewClient implementation: | 99 // View, mojom::ViewClient implementation: |
100 | 100 |
| 101 void View::OpenURL(mojom::OpenURLParamsPtr params) { |
| 102 if (delegate_) |
| 103 delegate_->OpenURL(this, std::move(params)); |
| 104 } |
| 105 |
101 void View::LoadingStateChanged(bool is_loading) { | 106 void View::LoadingStateChanged(bool is_loading) { |
102 is_loading_ = is_loading; | 107 is_loading_ = is_loading; |
103 FOR_EACH_OBSERVER(ViewObserver, observers_, LoadingStateChanged(this)); | 108 FOR_EACH_OBSERVER(ViewObserver, observers_, LoadingStateChanged(this)); |
104 } | 109 } |
105 | 110 |
106 void View::NavigationStateChanged(const GURL& url, | 111 void View::NavigationStateChanged(const GURL& url, |
107 const mojo::String& title, | 112 const mojo::String& title, |
108 bool can_go_back, | 113 bool can_go_back, |
109 bool can_go_forward) { | 114 bool can_go_forward) { |
110 url_ = url; | 115 url_ = url; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 if (from_front) { | 174 if (from_front) { |
170 auto it = navigation_list_.begin() + count; | 175 auto it = navigation_list_.begin() + count; |
171 navigation_list_.erase(navigation_list_.begin(), it); | 176 navigation_list_.erase(navigation_list_.begin(), it); |
172 } else { | 177 } else { |
173 auto it = navigation_list_.end() - count; | 178 auto it = navigation_list_.end() - count; |
174 navigation_list_.erase(it, navigation_list_.end()); | 179 navigation_list_.erase(it, navigation_list_.end()); |
175 } | 180 } |
176 } | 181 } |
177 | 182 |
178 } // namespace navigation | 183 } // namespace navigation |
OLD | NEW |