| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/frame_host/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 | 108 |
| 109 void WaitUntilScreenshotIsReady() { | 109 void WaitUntilScreenshotIsReady() { |
| 110 if (!encoding_screenshot_in_progress_) | 110 if (!encoding_screenshot_in_progress_) |
| 111 return; | 111 return; |
| 112 message_loop_runner_ = new content::MessageLoopRunner; | 112 message_loop_runner_ = new content::MessageLoopRunner; |
| 113 message_loop_runner_->Run(); | 113 message_loop_runner_->Run(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 private: | 116 private: |
| 117 // Overridden from content::NavigationEntryScreenshotManager: | |
| 118 void TakeScreenshotImpl(content::RenderViewHost* host, | |
| 119 content::NavigationEntryImpl* entry) override {} | |
| 120 | |
| 121 void OnScreenshotSet(content::NavigationEntryImpl* entry) override { | 117 void OnScreenshotSet(content::NavigationEntryImpl* entry) override { |
| 122 encoding_screenshot_in_progress_ = false; | 118 encoding_screenshot_in_progress_ = false; |
| 123 NavigationEntryScreenshotManager::OnScreenshotSet(entry); | 119 NavigationEntryScreenshotManager::OnScreenshotSet(entry); |
| 124 if (message_loop_runner_.get()) | 120 if (message_loop_runner_.get()) |
| 125 message_loop_runner_->Quit(); | 121 message_loop_runner_->Quit(); |
| 126 } | 122 } |
| 127 | 123 |
| 128 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; | 124 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; |
| 129 bool encoding_screenshot_in_progress_; | 125 bool encoding_screenshot_in_progress_; |
| 130 | 126 |
| (...skipping 5157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5288 main_test_rfh()->SimulateNavigationStart(url_1); | 5284 main_test_rfh()->SimulateNavigationStart(url_1); |
| 5289 EXPECT_EQ(url_1, controller.GetVisibleEntry()->GetURL()); | 5285 EXPECT_EQ(url_1, controller.GetVisibleEntry()->GetURL()); |
| 5290 EXPECT_EQ(ReloadType::NONE, last_reload_type_); | 5286 EXPECT_EQ(ReloadType::NONE, last_reload_type_); |
| 5291 | 5287 |
| 5292 main_test_rfh()->SimulateNavigationCommit(url_2); | 5288 main_test_rfh()->SimulateNavigationCommit(url_2); |
| 5293 main_test_rfh()->SimulateNavigationCommit(url_1); | 5289 main_test_rfh()->SimulateNavigationCommit(url_1); |
| 5294 main_test_rfh()->SimulateNavigationCommit(url_1); | 5290 main_test_rfh()->SimulateNavigationCommit(url_1); |
| 5295 } | 5291 } |
| 5296 | 5292 |
| 5297 } // namespace content | 5293 } // namespace content |
| OLD | NEW |