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

Side by Side Diff: chrome/browser/extensions/api/system_info_display/display_info_provider_chromeos.cc

Issue 12217120: Add IsInternal property to gfx::Display (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Get rid of static initializer Created 7 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/extensions/api/system_info_display/display_info_provide r.h" 5 #include "chrome/browser/extensions/api/system_info_display/display_info_provide r.h"
6 6
7 #include "ash/display/display_manager.h" 7 #include "ash/display/display_manager.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "ui/gfx/display.h" 10 #include "ui/gfx/display.h"
(...skipping 24 matching lines...) Expand all
35 int64 primary_id = ash::Shell::GetScreen()->GetPrimaryDisplay().id(); 35 int64 primary_id = ash::Shell::GetScreen()->GetPrimaryDisplay().id();
36 for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) { 36 for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) {
37 linked_ptr<DisplayUnitInfo> unit(new DisplayUnitInfo()); 37 linked_ptr<DisplayUnitInfo> unit(new DisplayUnitInfo());
38 const gfx::Display* display = display_manager->GetDisplayAt(i); 38 const gfx::Display* display = display_manager->GetDisplayAt(i);
39 const gfx::Rect& bounds = display->bounds(); 39 const gfx::Rect& bounds = display->bounds();
40 const gfx::Rect& work_area = display->work_area(); 40 const gfx::Rect& work_area = display->work_area();
41 const float dpi = display->device_scale_factor() * kDpi96; 41 const float dpi = display->device_scale_factor() * kDpi96;
42 unit->id = base::Int64ToString(display->id()); 42 unit->id = base::Int64ToString(display->id());
43 unit->name = display_manager->GetDisplayNameFor(*display); 43 unit->name = display_manager->GetDisplayNameFor(*display);
44 unit->is_primary = (display->id() == primary_id); 44 unit->is_primary = (display->id() == primary_id);
45 unit->is_internal = display_manager->IsInternalDisplayId(display->id()); 45 unit->is_internal = display->IsInternal();
46 unit->is_enabled = true; 46 unit->is_enabled = true;
47 unit->dpi_x = dpi; 47 unit->dpi_x = dpi;
48 unit->dpi_y = dpi; 48 unit->dpi_y = dpi;
49 unit->bounds.left = bounds.x(); 49 unit->bounds.left = bounds.x();
50 unit->bounds.top = bounds.y(); 50 unit->bounds.top = bounds.y();
51 unit->bounds.width = bounds.width(); 51 unit->bounds.width = bounds.width();
52 unit->bounds.height = bounds.height(); 52 unit->bounds.height = bounds.height();
53 unit->work_area.left = work_area.x(); 53 unit->work_area.left = work_area.x();
54 unit->work_area.top = work_area.y(); 54 unit->work_area.top = work_area.y();
55 unit->work_area.width = work_area.width(); 55 unit->work_area.width = work_area.width();
56 unit->work_area.height = work_area.height(); 56 unit->work_area.height = work_area.height();
57 info->push_back(unit); 57 info->push_back(unit);
58 } 58 }
59 59
60 return true; 60 return true;
61 } 61 }
62 62
63 } // namespace extensions 63 } // namespace extensions
OLDNEW
« no previous file with comments | « ash/test/ash_test_base.cc ('k') | chrome/browser/ui/webui/options/chromeos/display_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698