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 "ash/accelerators/accelerator_commands.h" | 5 #include "ash/accelerators/accelerator_commands.h" |
6 | 6 |
7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
8 #include "ash/display/display_util.h" | 8 #include "ash/display/display_util.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 bool ZoomInternalDisplay(bool up) { | 67 bool ZoomInternalDisplay(bool up) { |
68 if (up) | 68 if (up) |
69 base::RecordAction(base::UserMetricsAction("Accel_Scale_Ui_Up")); | 69 base::RecordAction(base::UserMetricsAction("Accel_Scale_Ui_Up")); |
70 else | 70 else |
71 base::RecordAction(base::UserMetricsAction("Accel_Scale_Ui_Down")); | 71 base::RecordAction(base::UserMetricsAction("Accel_Scale_Ui_Down")); |
72 | 72 |
73 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 73 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
74 | 74 |
75 int64 display_id = display_manager->IsInUnifiedMode() | 75 int64_t display_id = display_manager->IsInUnifiedMode() |
76 ? DisplayManager::kUnifiedDisplayId | 76 ? DisplayManager::kUnifiedDisplayId |
77 : display_manager->GetDisplayIdForUIScaling(); | 77 : display_manager->GetDisplayIdForUIScaling(); |
78 const DisplayInfo& display_info = display_manager->GetDisplayInfo(display_id); | 78 const DisplayInfo& display_info = display_manager->GetDisplayInfo(display_id); |
79 DisplayMode mode; | 79 DisplayMode mode; |
80 | 80 |
81 if (display_manager->IsInUnifiedMode()) { | 81 if (display_manager->IsInUnifiedMode()) { |
82 if (!GetDisplayModeForNextResolution(display_info, up, &mode)) | 82 if (!GetDisplayModeForNextResolution(display_info, up, &mode)) |
83 return false; | 83 return false; |
84 } else { | 84 } else { |
85 if (!GetDisplayModeForNextUIScale(display_info, up, &mode)) | 85 if (!GetDisplayModeForNextUIScale(display_info, up, &mode)) |
86 return false; | 86 return false; |
87 } | 87 } |
(...skipping 12 matching lines...) Expand all Loading... |
100 std::find_if(modes.begin(), modes.end(), | 100 std::find_if(modes.begin(), modes.end(), |
101 [](const DisplayMode& mode) { return mode.native; }); | 101 [](const DisplayMode& mode) { return mode.native; }); |
102 display_manager->SetDisplayMode(DisplayManager::kUnifiedDisplayId, *iter); | 102 display_manager->SetDisplayMode(DisplayManager::kUnifiedDisplayId, *iter); |
103 } else { | 103 } else { |
104 SetDisplayUIScale(display_manager->GetDisplayIdForUIScaling(), 1.0f); | 104 SetDisplayUIScale(display_manager->GetDisplayIdForUIScaling(), 1.0f); |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 } // namespace accelerators | 108 } // namespace accelerators |
109 } // namespace ash | 109 } // namespace ash |
OLD | NEW |