| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 248 |
| 249 //////////////////////////////////////////////////////////////////////////////// | 249 //////////////////////////////////////////////////////////////////////////////// |
| 250 // WebViewImpl, NavigationControllerDelegate implementation: | 250 // WebViewImpl, NavigationControllerDelegate implementation: |
| 251 | 251 |
| 252 void WebViewImpl::OnNavigate(mojo::URLRequestPtr request) { | 252 void WebViewImpl::OnNavigate(mojo::URLRequestPtr request) { |
| 253 pending_load_.reset(new PendingWebViewLoad(this)); | 253 pending_load_.reset(new PendingWebViewLoad(this)); |
| 254 pending_load_->Init(std::move(request)); | 254 pending_load_->Init(std::move(request)); |
| 255 } | 255 } |
| 256 | 256 |
| 257 void WebViewImpl::OnDidNavigate() { | 257 void WebViewImpl::OnDidNavigate() { |
| 258 client_->BackForwardChanged(navigation_controller_.CanGoBack() | 258 client_->BackForwardChanged( |
| 259 ? ButtonState::BUTTON_STATE_ENABLED | 259 navigation_controller_.CanGoBack() ? ButtonState::ENABLED |
| 260 : ButtonState::BUTTON_STATE_DISABLED, | 260 : ButtonState::DISABLED, |
| 261 navigation_controller_.CanGoForward() | 261 navigation_controller_.CanGoForward() ? ButtonState::ENABLED |
| 262 ? ButtonState::BUTTON_STATE_ENABLED | 262 : ButtonState::DISABLED); |
| 263 : ButtonState::BUTTON_STATE_DISABLED); | |
| 264 } | 263 } |
| 265 | 264 |
| 266 //////////////////////////////////////////////////////////////////////////////// | 265 //////////////////////////////////////////////////////////////////////////////// |
| 267 // WebViewImpl, FindControllerDelegate implementation: | 266 // WebViewImpl, FindControllerDelegate implementation: |
| 268 | 267 |
| 269 std::vector<Frame*> WebViewImpl::GetAllFrames() { | 268 std::vector<Frame*> WebViewImpl::GetAllFrames() { |
| 270 std::vector<Frame*> all_frames; | 269 std::vector<Frame*> all_frames; |
| 271 PreOrderDepthFirstTraverseTree(frame_tree_->root(), &all_frames); | 270 PreOrderDepthFirstTraverseTree(frame_tree_->root(), &all_frames); |
| 272 return all_frames; | 271 return all_frames; |
| 273 } | 272 } |
| 274 | 273 |
| 275 mojom::WebViewClient* WebViewImpl::GetWebViewClient() { | 274 mojom::WebViewClient* WebViewImpl::GetWebViewClient() { |
| 276 return client_.get(); | 275 return client_.get(); |
| 277 } | 276 } |
| 278 | 277 |
| 279 } // namespace web_view | 278 } // namespace web_view |
| OLD | NEW |