| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/ui/zoom/zoom_controller.h" | 5 #include "components/zoom/zoom_controller.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/process/kill.h" | 8 #include "base/process/kill.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_commands.h" | 12 #include "chrome/browser/ui/browser_commands.h" |
| 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 14 #include "chrome/browser/ui/webui/signin/login_ui_test_utils.h" | 14 #include "chrome/browser/ui/webui/signin/login_ui_test_utils.h" |
| 15 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" | 15 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" |
| 16 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
| 17 #include "chrome/test/base/in_process_browser_test.h" | 17 #include "chrome/test/base/in_process_browser_test.h" |
| 18 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
| 19 #include "components/prefs/pref_service.h" | 19 #include "components/prefs/pref_service.h" |
| 20 #include "components/signin/core/common/profile_management_switches.h" | 20 #include "components/signin/core/common/profile_management_switches.h" |
| 21 #include "content/public/browser/host_zoom_map.h" | 21 #include "content/public/browser/host_zoom_map.h" |
| 22 #include "content/public/browser/navigation_entry.h" | 22 #include "content/public/browser/navigation_entry.h" |
| 23 #include "content/public/browser/render_process_host.h" | 23 #include "content/public/browser/render_process_host.h" |
| 24 #include "content/public/browser/render_view_host.h" | 24 #include "content/public/browser/render_view_host.h" |
| 25 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
| 26 #include "content/public/common/page_type.h" | 26 #include "content/public/common/page_type.h" |
| 27 #include "content/public/test/browser_test_utils.h" | 27 #include "content/public/test/browser_test_utils.h" |
| 28 #include "testing/gmock/include/gmock/gmock.h" | 28 #include "testing/gmock/include/gmock/gmock.h" |
| 29 | 29 |
| 30 using ui_zoom::ZoomController; | 30 using zoom::ZoomController; |
| 31 using ui_zoom::ZoomObserver; | 31 using zoom::ZoomObserver; |
| 32 | 32 |
| 33 bool operator==(const ZoomController::ZoomChangedEventData& lhs, | 33 bool operator==(const ZoomController::ZoomChangedEventData& lhs, |
| 34 const ZoomController::ZoomChangedEventData& rhs) { | 34 const ZoomController::ZoomChangedEventData& rhs) { |
| 35 return lhs.web_contents == rhs.web_contents && | 35 return lhs.web_contents == rhs.web_contents && |
| 36 lhs.old_zoom_level == rhs.old_zoom_level && | 36 lhs.old_zoom_level == rhs.old_zoom_level && |
| 37 lhs.new_zoom_level == rhs.new_zoom_level && | 37 lhs.new_zoom_level == rhs.new_zoom_level && |
| 38 lhs.zoom_mode == rhs.zoom_mode && | 38 lhs.zoom_mode == rhs.zoom_mode && |
| 39 lhs.can_show_bubble == rhs.can_show_bubble; | 39 lhs.can_show_bubble == rhs.can_show_bubble; |
| 40 } | 40 } |
| 41 | 41 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 web_contents, | 322 web_contents, |
| 323 old_zoom_level, | 323 old_zoom_level, |
| 324 new_zoom_level, | 324 new_zoom_level, |
| 325 ZoomController::ZOOM_MODE_DEFAULT, | 325 ZoomController::ZOOM_MODE_DEFAULT, |
| 326 true); // We have a non-empty host, so this will be 'true'. | 326 true); // We have a non-empty host, so this will be 'true'. |
| 327 ZoomChangedWatcher zoom_change_watcher(web_contents, zoom_change_data); | 327 ZoomChangedWatcher zoom_change_watcher(web_contents, zoom_change_data); |
| 328 zoom_controller->SetZoomLevel(new_zoom_level); | 328 zoom_controller->SetZoomLevel(new_zoom_level); |
| 329 zoom_change_watcher.Wait(); | 329 zoom_change_watcher.Wait(); |
| 330 } | 330 } |
| 331 #endif // !defined(OS_CHROMEOS) | 331 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |