| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/web_view/web_view_impl.h" | 5 #include "components/web_view/web_view_impl.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 258 |
| 259 //////////////////////////////////////////////////////////////////////////////// | 259 //////////////////////////////////////////////////////////////////////////////// |
| 260 // WebViewImpl, NavigationControllerDelegate implementation: | 260 // WebViewImpl, NavigationControllerDelegate implementation: |
| 261 | 261 |
| 262 void WebViewImpl::OnNavigate(mojo::URLRequestPtr request) { | 262 void WebViewImpl::OnNavigate(mojo::URLRequestPtr request) { |
| 263 pending_load_.reset(new PendingWebViewLoad(this)); | 263 pending_load_.reset(new PendingWebViewLoad(this)); |
| 264 pending_load_->Init(std::move(request)); | 264 pending_load_->Init(std::move(request)); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void WebViewImpl::OnDidNavigate() { | 267 void WebViewImpl::OnDidNavigate() { |
| 268 client_->BackForwardChanged(navigation_controller_.CanGoBack() | 268 client_->BackForwardChanged( |
| 269 ? ButtonState::BUTTON_STATE_ENABLED | 269 navigation_controller_.CanGoBack() ? ButtonState::ENABLED |
| 270 : ButtonState::BUTTON_STATE_DISABLED, | 270 : ButtonState::DISABLED, |
| 271 navigation_controller_.CanGoForward() | 271 navigation_controller_.CanGoForward() ? ButtonState::ENABLED |
| 272 ? ButtonState::BUTTON_STATE_ENABLED | 272 : ButtonState::DISABLED); |
| 273 : ButtonState::BUTTON_STATE_DISABLED); | |
| 274 } | 273 } |
| 275 | 274 |
| 276 //////////////////////////////////////////////////////////////////////////////// | 275 //////////////////////////////////////////////////////////////////////////////// |
| 277 // WebViewImpl, FindControllerDelegate implementation: | 276 // WebViewImpl, FindControllerDelegate implementation: |
| 278 | 277 |
| 279 std::vector<Frame*> WebViewImpl::GetAllFrames() { | 278 std::vector<Frame*> WebViewImpl::GetAllFrames() { |
| 280 std::vector<Frame*> all_frames; | 279 std::vector<Frame*> all_frames; |
| 281 PreOrderDepthFirstTraverseTree(frame_tree_->root(), &all_frames); | 280 PreOrderDepthFirstTraverseTree(frame_tree_->root(), &all_frames); |
| 282 return all_frames; | 281 return all_frames; |
| 283 } | 282 } |
| 284 | 283 |
| 285 mojom::WebViewClient* WebViewImpl::GetWebViewClient() { | 284 mojom::WebViewClient* WebViewImpl::GetWebViewClient() { |
| 286 return client_.get(); | 285 return client_.get(); |
| 287 } | 286 } |
| 288 | 287 |
| 289 } // namespace web_view | 288 } // namespace web_view |
| OLD | NEW |