| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "ios/web/public/test/fakes/test_web_state.h" | 5 #import "ios/web/public/test/fakes/test_web_state.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" |
| 9 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/threading/sequenced_task_runner_handle.h" |
| 10 #import "ios/web/public/web_state/ui/crw_content_view.h" | 12 #import "ios/web/public/web_state/ui/crw_content_view.h" |
| 11 #include "ios/web/public/web_state/web_state_observer.h" | 13 #include "ios/web/public/web_state/web_state_observer.h" |
| 14 #include "ui/gfx/image/image.h" |
| 12 | 15 |
| 13 #if !defined(__has_feature) || !__has_feature(objc_arc) | 16 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 14 #error "This file requires ARC support." | 17 #error "This file requires ARC support." |
| 15 #endif | 18 #endif |
| 16 | 19 |
| 17 namespace web { | 20 namespace web { |
| 18 | 21 |
| 19 void TestWebState::AddObserver(WebStateObserver* observer) { | 22 void TestWebState::AddObserver(WebStateObserver* observer) { |
| 20 observers_.AddObserver(observer); | 23 observers_.AddObserver(observer); |
| 21 } | 24 } |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 } | 226 } |
| 224 | 227 |
| 225 WebStateInterfaceProvider* TestWebState::GetWebStateInterfaceProvider() { | 228 WebStateInterfaceProvider* TestWebState::GetWebStateInterfaceProvider() { |
| 226 return nullptr; | 229 return nullptr; |
| 227 } | 230 } |
| 228 | 231 |
| 229 bool TestWebState::HasOpener() const { | 232 bool TestWebState::HasOpener() const { |
| 230 return false; | 233 return false; |
| 231 } | 234 } |
| 232 | 235 |
| 236 void TestWebState::TakeSnapshot(const SnapshotCallback& callback, |
| 237 CGSize target_size) const { |
| 238 base::SequencedTaskRunnerHandle::Get()->PostTask( |
| 239 FROM_HERE, base::Bind(callback, gfx::Image())); |
| 240 } |
| 241 |
| 233 base::WeakPtr<WebState> TestWebState::AsWeakPtr() { | 242 base::WeakPtr<WebState> TestWebState::AsWeakPtr() { |
| 234 NOTREACHED(); | 243 NOTREACHED(); |
| 235 return base::WeakPtr<WebState>(); | 244 return base::WeakPtr<WebState>(); |
| 236 } | 245 } |
| 237 | 246 |
| 238 } // namespace web | 247 } // namespace web |
| OLD | NEW |