OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 virtual void TakeScreenshotImpl(RenderViewHost* host, | 62 virtual void TakeScreenshotImpl(RenderViewHost* host, |
63 NavigationEntryImpl* entry) OVERRIDE { | 63 NavigationEntryImpl* entry) OVERRIDE { |
64 ++waiting_for_screenshots_; | 64 ++waiting_for_screenshots_; |
65 screenshot_taken_for_ = host; | 65 screenshot_taken_for_ = host; |
66 WebContentsScreenshotManager::TakeScreenshotImpl(host, entry); | 66 WebContentsScreenshotManager::TakeScreenshotImpl(host, entry); |
67 } | 67 } |
68 | 68 |
69 virtual void OnScreenshotSet(NavigationEntryImpl* entry) OVERRIDE { | 69 virtual void OnScreenshotSet(NavigationEntryImpl* entry) OVERRIDE { |
70 --waiting_for_screenshots_; | 70 --waiting_for_screenshots_; |
71 WebContentsScreenshotManager::OnScreenshotSet(entry); | 71 WebContentsScreenshotManager::OnScreenshotSet(entry); |
72 if (waiting_for_screenshots_ == 0 && message_loop_runner_) | 72 if (waiting_for_screenshots_ == 0 && message_loop_runner_.get()) |
73 message_loop_runner_->Quit(); | 73 message_loop_runner_->Quit(); |
74 } | 74 } |
75 | 75 |
76 RenderViewHost* screenshot_taken_for_; | 76 RenderViewHost* screenshot_taken_for_; |
77 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; | 77 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; |
78 int waiting_for_screenshots_; | 78 int waiting_for_screenshots_; |
79 | 79 |
80 DISALLOW_COPY_AND_ASSIGN(ScreenshotTracker); | 80 DISALLOW_COPY_AND_ASSIGN(ScreenshotTracker); |
81 }; | 81 }; |
82 | 82 |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 10); | 586 10); |
587 string16 actual_title = title_watcher.WaitAndGetTitle(); | 587 string16 actual_title = title_watcher.WaitAndGetTitle(); |
588 EXPECT_EQ(expected_title, actual_title); | 588 EXPECT_EQ(expected_title, actual_title); |
589 | 589 |
590 EXPECT_EQ(2, GetCurrentIndex()); | 590 EXPECT_EQ(2, GetCurrentIndex()); |
591 EXPECT_TRUE(controller.CanGoBack()); | 591 EXPECT_TRUE(controller.CanGoBack()); |
592 EXPECT_FALSE(controller.CanGoForward()); | 592 EXPECT_FALSE(controller.CanGoForward()); |
593 } | 593 } |
594 | 594 |
595 } // namespace content | 595 } // namespace content |
OLD | NEW |