Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Unified Diff: ash/accelerators/accelerator_commands_aura.cc

Issue 2286523002: Relocate reuseable portions of ash/display/display_util.* (Closed)
Patch Set: fixed ozone build Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/display/display_change_observer_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_commands_aura.cc
diff --git a/ash/accelerators/accelerator_commands_aura.cc b/ash/accelerators/accelerator_commands_aura.cc
index ea84e462b3b0dea03e8c4f6d1d45a77a07d8b066..fc252343985a54e8582e125c9aec49fdcaf0525d 100644
--- a/ash/accelerators/accelerator_commands_aura.cc
+++ b/ash/accelerators/accelerator_commands_aura.cc
@@ -7,7 +7,6 @@
#include "ash/common/wm/window_state.h"
#include "ash/common/wm_window.h"
#include "ash/display/display_manager.h"
-#include "ash/display/display_util.h"
#include "ash/shell.h"
#include "ash/wm/screen_pinning_controller.h"
#include "base/metrics/user_metrics.h"
@@ -35,42 +34,13 @@ bool ZoomInternalDisplay(bool up) {
base::RecordAction(base::UserMetricsAction("Accel_Scale_Ui_Down"));
DisplayManager* display_manager = Shell::GetInstance()->display_manager();
-
- int64_t display_id = display_manager->IsInUnifiedMode()
- ? DisplayManager::kUnifiedDisplayId
- : display_manager->GetDisplayIdForUIScaling();
- const display::ManagedDisplayInfo& display_info =
- display_manager->GetDisplayInfo(display_id);
-
- scoped_refptr<display::ManagedDisplayMode> mode;
- if (display_manager->IsInUnifiedMode())
- mode = GetDisplayModeForNextResolution(display_info, up);
- else
- mode = GetDisplayModeForNextUIScale(display_info, up);
-
- if (!mode)
- return false;
- return display_manager->SetDisplayMode(display_id, mode);
+ return display_manager->ZoomInternalDisplay(up);
}
void ResetInternalDisplayZoom() {
base::RecordAction(base::UserMetricsAction("Accel_Scale_Ui_Reset"));
DisplayManager* display_manager = Shell::GetInstance()->display_manager();
-
- if (display_manager->IsInUnifiedMode()) {
- const display::ManagedDisplayInfo& display_info =
- display_manager->GetDisplayInfo(DisplayManager::kUnifiedDisplayId);
- const display::ManagedDisplayInfo::ManagedDisplayModeList& modes =
- display_info.display_modes();
- auto iter = std::find_if(
- modes.begin(), modes.end(),
- [](const scoped_refptr<display::ManagedDisplayMode>& mode) {
- return mode->native();
- });
- display_manager->SetDisplayMode(DisplayManager::kUnifiedDisplayId, *iter);
- } else {
- SetDisplayUIScale(display_manager->GetDisplayIdForUIScaling(), 1.0f);
- }
+ display_manager->ResetInternalDisplayZoom();
}
void Unpin() {
« no previous file with comments | « no previous file | ash/display/display_change_observer_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698