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

Unified Diff: ash/accelerators/accelerator_commands_aura.cc

Issue 2196923002: Make ash::DisplayMode more like ui::DisplayMode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more tests fixed 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/common/display/display_info.h » ('j') | ash/common/display/display_info.h » ('J')
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 0c5bb9857b5a9f8a8d81cd0c8ecf5d2f1568d1a5..8473c19ddd4ae50380e11c98d3073df47547dada 100644
--- a/ash/accelerators/accelerator_commands_aura.cc
+++ b/ash/accelerators/accelerator_commands_aura.cc
@@ -4,6 +4,7 @@
#include "ash/accelerators/accelerator_commands_aura.h"
+#include "ash/common/display/display_info.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm_window.h"
#include "ash/display/display_manager.h"
@@ -39,13 +40,15 @@ bool ZoomInternalDisplay(bool up) {
? DisplayManager::kUnifiedDisplayId
: display_manager->GetDisplayIdForUIScaling();
const DisplayInfo& display_info = display_manager->GetDisplayInfo(display_id);
- DisplayMode mode;
+ scoped_refptr<DisplayMode> mode;
if (display_manager->IsInUnifiedMode()) {
- if (!GetDisplayModeForNextResolution(display_info, up, &mode))
+ mode = GetDisplayModeForNextResolution(display_info, up);
+ if (!mode)
return false;
oshima 2016/08/02 19:44:57 move this outside of if?
rjkroege 2016/08/04 00:12:04 Done.
} else {
- if (!GetDisplayModeForNextUIScale(display_info, up, &mode))
+ mode = GetDisplayModeForNextUIScale(display_info, up);
+ if (!mode)
return false;
}
return display_manager->SetDisplayMode(display_id, mode);
@@ -58,10 +61,10 @@ void ResetInternalDisplayZoom() {
if (display_manager->IsInUnifiedMode()) {
const DisplayInfo& display_info =
display_manager->GetDisplayInfo(DisplayManager::kUnifiedDisplayId);
- const std::vector<DisplayMode>& modes = display_info.display_modes();
- auto iter =
- std::find_if(modes.begin(), modes.end(),
- [](const DisplayMode& mode) { return mode.native; });
+ const DisplayInfo::DisplayModeList& modes = display_info.display_modes();
+ auto iter = std::find_if(
+ modes.begin(), modes.end(),
+ [](const scoped_refptr<DisplayMode>& mode) { return mode->native(); });
display_manager->SetDisplayMode(DisplayManager::kUnifiedDisplayId, *iter);
} else {
SetDisplayUIScale(display_manager->GetDisplayIdForUIScaling(), 1.0f);
« no previous file with comments | « no previous file | ash/common/display/display_info.h » ('j') | ash/common/display/display_info.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698