| 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 "chrome/browser/extensions/api/system_display/display_info_provider.h" | 5 #include "chrome/browser/extensions/api/system_display/display_info_provider.h" |
| 6 | 6 |
| 7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
| 9 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 (*error).clear(); | 34 (*error).clear(); |
| 35 *success = DisplayInfoProvider::Get()->SetInfo(display_id, info, error); | 35 *success = DisplayInfoProvider::Get()->SetInfo(display_id, info, error); |
| 36 } | 36 } |
| 37 | 37 |
| 38 bool DisplayExists(int64 display_id) const { | 38 bool DisplayExists(int64 display_id) const { |
| 39 const gfx::Display& display = | 39 const gfx::Display& display = |
| 40 GetDisplayManager()->GetDisplayForId(display_id); | 40 GetDisplayManager()->GetDisplayForId(display_id); |
| 41 return display.id() != gfx::Display::kInvalidDisplayID; | 41 return display.id() != gfx::Display::kInvalidDisplayID; |
| 42 } | 42 } |
| 43 | 43 |
| 44 ash::internal::DisplayManager* GetDisplayManager() const { | 44 ash::DisplayManager* GetDisplayManager() const { |
| 45 return ash::Shell::GetInstance()->display_manager(); | 45 return ash::Shell::GetInstance()->display_manager(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 ash::DisplayController* GetDisplayController() const { | 48 ash::DisplayController* GetDisplayController() const { |
| 49 return ash::Shell::GetInstance()->display_controller(); | 49 return ash::Shell::GetInstance()->display_controller(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 std::string SystemInfoDisplayInsetsToString( | 52 std::string SystemInfoDisplayInsetsToString( |
| 53 const api::system_display::Insets& insets) const { | 53 const api::system_display::Insets& insets) const { |
| 54 // Order to match gfx::Insets::ToString(). | 54 // Order to match gfx::Insets::ToString(). |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 CallSetDisplayUnitInfo(base::Int64ToString(internal_display_id), info, | 884 CallSetDisplayUnitInfo(base::Int64ToString(internal_display_id), info, |
| 885 &success, &error); | 885 &success, &error); |
| 886 | 886 |
| 887 ASSERT_FALSE(success); | 887 ASSERT_FALSE(success); |
| 888 EXPECT_EQ("Overscan changes not allowed for the internal monitor.", | 888 EXPECT_EQ("Overscan changes not allowed for the internal monitor.", |
| 889 error); | 889 error); |
| 890 } | 890 } |
| 891 | 891 |
| 892 } // namespace | 892 } // namespace |
| 893 } // namespace extensions | 893 } // namespace extensions |
| OLD | NEW |