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

Unified Diff: chrome/browser/ui/webui/options/chromeos/display_options_handler.cc

Issue 10905288: Switch primary display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 3 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 | « chrome/browser/chromeos/display/display_preferences.cc ('k') | ui/aura/display_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
index ec2ae224749abbe496872a5a733c9a291ad8735f..b38e3a5857f2324d0cab2014437049c3f86a707f 100644
--- a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
@@ -8,6 +8,7 @@
#include "ash/display/display_controller.h"
#include "ash/display/output_configurator_animation.h"
+#include "ash/screen_ash.h"
#include "ash/shell.h"
#include "base/bind.h"
#include "base/json/json_value_converter.h"
@@ -118,17 +119,18 @@ void DisplayOptionsHandler::SendDisplayInfo() {
js_display->SetDouble("y", bounds.y());
js_display->SetDouble("width", bounds.width());
js_display->SetDouble("height", bounds.height());
- js_display->SetString("name", display_manager->GetDisplayNameAt(i));
+ js_display->SetString("name",
+ display_manager->GetDisplayNameFor(*display));
displays.Set(i, js_display);
}
scoped_ptr<base::Value> layout_value(base::Value::CreateNullValue());
scoped_ptr<base::Value> offset_value(base::Value::CreateNullValue());
if (display_manager->GetNumDisplays() > 1) {
- const std::string& secondary_display_name =
- display_manager->GetDisplayNameAt(1);
+ const gfx::Display secondary_display =
+ ash::ScreenAsh::GetSecondaryDisplay();
const ash::DisplayLayout& layout =
- display_controller->GetLayoutForDisplayName(secondary_display_name);
+ display_controller->GetLayoutForDisplay(secondary_display);
layout_value.reset(new base::FundamentalValue(layout.position));
offset_value.reset(new base::FundamentalValue(layout.offset));
}
« no previous file with comments | « chrome/browser/chromeos/display/display_preferences.cc ('k') | ui/aura/display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698