| 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 "chrome/test/base/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "chrome/browser/ui/browser_finder.h" | 38 #include "chrome/browser/ui/browser_finder.h" |
| 39 #include "chrome/browser/ui/browser_list.h" | 39 #include "chrome/browser/ui/browser_list.h" |
| 40 #include "chrome/browser/ui/browser_navigator.h" | 40 #include "chrome/browser/ui/browser_navigator.h" |
| 41 #include "chrome/browser/ui/browser_tabstrip.h" | 41 #include "chrome/browser/ui/browser_tabstrip.h" |
| 42 #include "chrome/browser/ui/browser_window.h" | 42 #include "chrome/browser/ui/browser_window.h" |
| 43 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 43 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
| 44 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 44 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 45 #include "chrome/browser/ui/host_desktop.h" | 45 #include "chrome/browser/ui/host_desktop.h" |
| 46 #include "chrome/browser/ui/omnibox/location_bar.h" | 46 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 47 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 47 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 48 #include "chrome/browser/ui/window_snapshot/window_snapshot.h" | |
| 49 #include "chrome/common/chrome_notification_types.h" | 48 #include "chrome/common/chrome_notification_types.h" |
| 50 #include "chrome/common/chrome_paths.h" | 49 #include "chrome/common/chrome_paths.h" |
| 51 #include "chrome/common/pref_names.h" | 50 #include "chrome/common/pref_names.h" |
| 52 #include "chrome/test/base/bookmark_load_observer.h" | 51 #include "chrome/test/base/bookmark_load_observer.h" |
| 53 #include "content/public/browser/browser_thread.h" | 52 #include "content/public/browser/browser_thread.h" |
| 54 #include "content/public/browser/dom_operation_notification_details.h" | 53 #include "content/public/browser/dom_operation_notification_details.h" |
| 55 #include "content/public/browser/download_item.h" | 54 #include "content/public/browser/download_item.h" |
| 56 #include "content/public/browser/download_manager.h" | 55 #include "content/public/browser/download_manager.h" |
| 57 #include "content/public/browser/geolocation.h" | 56 #include "content/public/browser/geolocation.h" |
| 58 #include "content/public/browser/navigation_controller.h" | 57 #include "content/public/browser/navigation_controller.h" |
| 59 #include "content/public/browser/navigation_entry.h" | 58 #include "content/public/browser/navigation_entry.h" |
| 60 #include "content/public/browser/notification_service.h" | 59 #include "content/public/browser/notification_service.h" |
| 61 #include "content/public/browser/render_process_host.h" | 60 #include "content/public/browser/render_process_host.h" |
| 62 #include "content/public/browser/render_view_host.h" | 61 #include "content/public/browser/render_view_host.h" |
| 63 #include "content/public/browser/web_contents.h" | 62 #include "content/public/browser/web_contents.h" |
| 64 #include "content/public/browser/web_contents_observer.h" | 63 #include "content/public/browser/web_contents_observer.h" |
| 65 #include "content/public/browser/web_contents_view.h" | 64 #include "content/public/browser/web_contents_view.h" |
| 66 #include "content/public/common/geoposition.h" | 65 #include "content/public/common/geoposition.h" |
| 67 #include "content/public/test/browser_test_utils.h" | 66 #include "content/public/test/browser_test_utils.h" |
| 68 #include "content/public/test/download_test_observer.h" | 67 #include "content/public/test/download_test_observer.h" |
| 69 #include "content/public/test/test_navigation_observer.h" | 68 #include "content/public/test/test_navigation_observer.h" |
| 70 #include "content/public/test/test_utils.h" | 69 #include "content/public/test/test_utils.h" |
| 71 #include "net/base/net_util.h" | 70 #include "net/base/net_util.h" |
| 72 #include "net/test/python_utils.h" | 71 #include "net/test/python_utils.h" |
| 73 #include "third_party/skia/include/core/SkBitmap.h" | 72 #include "third_party/skia/include/core/SkBitmap.h" |
| 74 #include "third_party/skia/include/core/SkColor.h" | 73 #include "third_party/skia/include/core/SkColor.h" |
| 75 #include "ui/gfx/size.h" | 74 #include "ui/gfx/size.h" |
| 75 #include "ui/snapshot/snapshot.h" |
| 76 #include "ui/ui_controls/ui_controls.h" | 76 #include "ui/ui_controls/ui_controls.h" |
| 77 | 77 |
| 78 #if defined(USE_AURA) | 78 #if defined(USE_AURA) |
| 79 #include "ash/shell.h" | 79 #include "ash/shell.h" |
| 80 #include "ui/aura/root_window.h" | 80 #include "ui/aura/root_window.h" |
| 81 #endif | 81 #endif |
| 82 | 82 |
| 83 using content::BrowserThread; | 83 using content::BrowserThread; |
| 84 using content::DomOperationNotificationDetails; | 84 using content::DomOperationNotificationDetails; |
| 85 using content::NativeWebKeyboardEvent; | 85 using content::NativeWebKeyboardEvent; |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 | 627 |
| 628 MONITORINFO monitor_info = {}; | 628 MONITORINFO monitor_info = {}; |
| 629 monitor_info.cbSize = sizeof(monitor_info); | 629 monitor_info.cbSize = sizeof(monitor_info); |
| 630 HMONITOR main_monitor = MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY); | 630 HMONITOR main_monitor = MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY); |
| 631 if (GetMonitorInfo(main_monitor, &monitor_info)) { | 631 if (GetMonitorInfo(main_monitor, &monitor_info)) { |
| 632 RECT& rect = monitor_info.rcMonitor; | 632 RECT& rect = monitor_info.rcMonitor; |
| 633 | 633 |
| 634 std::vector<unsigned char> png_data; | 634 std::vector<unsigned char> png_data; |
| 635 gfx::Rect bounds( | 635 gfx::Rect bounds( |
| 636 gfx::Size(rect.right - rect.left, rect.bottom - rect.top)); | 636 gfx::Size(rect.right - rect.left, rect.bottom - rect.top)); |
| 637 if (chrome::internal::GrabWindowSnapshot(NULL, &png_data, bounds) && | 637 if (ui::GrabWindowSnapshot(NULL, &png_data, bounds) && |
| 638 png_data.size() <= INT_MAX) { | 638 png_data.size() <= INT_MAX) { |
| 639 int bytes = static_cast<int>(png_data.size()); | 639 int bytes = static_cast<int>(png_data.size()); |
| 640 int written = file_util::WriteFile( | 640 int written = file_util::WriteFile( |
| 641 out_path, reinterpret_cast<char*>(&png_data[0]), bytes); | 641 out_path, reinterpret_cast<char*>(&png_data[0]), bytes); |
| 642 succeeded = (written == bytes); | 642 succeeded = (written == bytes); |
| 643 } | 643 } |
| 644 } | 644 } |
| 645 | 645 |
| 646 if (succeeded && screenshot_path != NULL) | 646 if (succeeded && screenshot_path != NULL) |
| 647 *screenshot_path = out_path; | 647 *screenshot_path = out_path; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 void HistoryEnumerator::HistoryQueryComplete( | 704 void HistoryEnumerator::HistoryQueryComplete( |
| 705 const base::Closure& quit_task, | 705 const base::Closure& quit_task, |
| 706 HistoryService::Handle request_handle, | 706 HistoryService::Handle request_handle, |
| 707 history::QueryResults* results) { | 707 history::QueryResults* results) { |
| 708 for (size_t i = 0; i < results->size(); ++i) | 708 for (size_t i = 0; i < results->size(); ++i) |
| 709 urls_.push_back((*results)[i].url()); | 709 urls_.push_back((*results)[i].url()); |
| 710 quit_task.Run(); | 710 quit_task.Run(); |
| 711 } | 711 } |
| 712 | 712 |
| 713 } // namespace ui_test_utils | 713 } // namespace ui_test_utils |
| OLD | NEW |