OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/printing/print_dialog_cloud.h" | 5 #include "chrome/browser/printing/print_dialog_cloud.h" |
6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" | 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/singleton.h" | 13 #include "base/singleton.h" |
14 #include "base/threading/thread_restrictions.h" | 14 #include "base/threading/thread_restrictions.h" |
| 15 #include "base/utf_string_conversions.h" |
15 #include "base/values.h" | 16 #include "base/values.h" |
16 #include "chrome/browser/browser_list.h" | 17 #include "chrome/browser/browser_list.h" |
17 #include "chrome/browser/browser_thread.h" | 18 #include "chrome/browser/browser_thread.h" |
18 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 19 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
19 #include "chrome/browser/printing/cloud_print/cloud_print_url.h" | 20 #include "chrome/browser/printing/cloud_print/cloud_print_url.h" |
20 #include "chrome/browser/renderer_host/render_view_host.h" | 21 #include "chrome/browser/renderer_host/render_view_host.h" |
21 #include "chrome/browser/tab_contents/tab_contents.h" | 22 #include "chrome/browser/tab_contents/tab_contents.h" |
22 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
23 #include "chrome/common/url_constants.h" | 24 #include "chrome/common/url_constants.h" |
24 #include "chrome/test/in_process_browser_test.h" | 25 #include "chrome/test/in_process_browser_test.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 BrowserList::SetLastActive(browser()); | 243 BrowserList::SetLastActive(browser()); |
243 ASSERT_TRUE(BrowserList::GetLastActive()); | 244 ASSERT_TRUE(BrowserList::GetLastActive()); |
244 | 245 |
245 AddTestHandlers(); | 246 AddTestHandlers(); |
246 | 247 |
247 // This goes back one step further for the Chrome OS case, to making | 248 // This goes back one step further for the Chrome OS case, to making |
248 // sure 'window.print()' gets to the right place. | 249 // sure 'window.print()' gets to the right place. |
249 ASSERT_TRUE(browser()->GetSelectedTabContents()); | 250 ASSERT_TRUE(browser()->GetSelectedTabContents()); |
250 ASSERT_TRUE(browser()->GetSelectedTabContents()->render_view_host()); | 251 ASSERT_TRUE(browser()->GetSelectedTabContents()->render_view_host()); |
251 | 252 |
252 std::wstring window_print(L"window.print()"); | 253 string16 window_print = ASCIIToUTF16("window.print()"); |
253 browser()->GetSelectedTabContents()->render_view_host()-> | 254 browser()->GetSelectedTabContents()->render_view_host()-> |
254 ExecuteJavascriptInWebFrame(std::wstring(), window_print); | 255 ExecuteJavascriptInWebFrame(string16(), window_print); |
255 | 256 |
256 ui_test_utils::RunMessageLoop(); | 257 ui_test_utils::RunMessageLoop(); |
257 | 258 |
258 ASSERT_TRUE(TestController::GetInstance()->result()); | 259 ASSERT_TRUE(TestController::GetInstance()->result()); |
259 } | 260 } |
260 #endif | 261 #endif |
OLD | NEW |