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 "apps/app_window.h" | 5 #include "apps/app_window.h" |
6 #include "apps/app_window_registry.h" | 6 #include "apps/app_window_registry.h" |
7 #include "apps/launcher.h" | 7 #include "apps/launcher.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 virtual void DidGetPreviewPageCount(int page_count) OVERRIDE { | 139 virtual void DidGetPreviewPageCount(int page_count) OVERRIDE { |
140 total_page_count_ = page_count; | 140 total_page_count_ = page_count; |
141 } | 141 } |
142 | 142 |
143 // PrintPreviewUI::TestingDelegate implementation. | 143 // PrintPreviewUI::TestingDelegate implementation. |
144 virtual void DidRenderPreviewPage(content::WebContents* preview_dialog) | 144 virtual void DidRenderPreviewPage(content::WebContents* preview_dialog) |
145 OVERRIDE { | 145 OVERRIDE { |
146 dialog_size_ = preview_dialog->GetContainerBounds().size(); | 146 dialog_size_ = preview_dialog->GetContainerBounds().size(); |
147 ++rendered_page_count_; | 147 ++rendered_page_count_; |
148 CHECK(rendered_page_count_ <= total_page_count_); | 148 CHECK(rendered_page_count_ <= total_page_count_); |
149 if (waiting_runner_ && rendered_page_count_ == total_page_count_) { | 149 if (waiting_runner_.get() && rendered_page_count_ == total_page_count_) { |
150 waiting_runner_->Quit(); | 150 waiting_runner_->Quit(); |
151 } | 151 } |
152 } | 152 } |
153 | 153 |
154 void WaitUntilPreviewIsReady() { | 154 void WaitUntilPreviewIsReady() { |
155 CHECK(!waiting_runner_); | 155 CHECK(!waiting_runner_.get()); |
156 if (rendered_page_count_ < total_page_count_) { | 156 if (rendered_page_count_ < total_page_count_) { |
157 waiting_runner_ = new content::MessageLoopRunner; | 157 waiting_runner_ = new content::MessageLoopRunner; |
158 waiting_runner_->Run(); | 158 waiting_runner_->Run(); |
159 waiting_runner_ = NULL; | 159 waiting_runner_ = NULL; |
160 } | 160 } |
161 } | 161 } |
162 | 162 |
163 gfx::Size dialog_size() { | 163 gfx::Size dialog_size() { |
164 return dialog_size_; | 164 return dialog_size_; |
165 } | 165 } |
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 LoadAndLaunchPlatformApp("reinstall_data_cleanup", "Launched"); | 1321 LoadAndLaunchPlatformApp("reinstall_data_cleanup", "Launched"); |
1322 ASSERT_TRUE(extension); | 1322 ASSERT_TRUE(extension); |
1323 ASSERT_EQ(extension_id, extension->id()); | 1323 ASSERT_EQ(extension_id, extension->id()); |
1324 | 1324 |
1325 ExtensionApiTest::ResultCatcher result_catcher; | 1325 ExtensionApiTest::ResultCatcher result_catcher; |
1326 EXPECT_TRUE(result_catcher.GetNextResult()); | 1326 EXPECT_TRUE(result_catcher.GetNextResult()); |
1327 } | 1327 } |
1328 } | 1328 } |
1329 | 1329 |
1330 } // namespace extensions | 1330 } // namespace extensions |
OLD | NEW |