| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/aura/single_display_manager.h" | 5 #include "ui/aura/single_display_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "ui/aura/aura_switches.h" | 10 #include "ui/aura/aura_switches.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 const gfx::Display& SingleDisplayManager::GetDisplayNearestPoint( | 70 const gfx::Display& SingleDisplayManager::GetDisplayNearestPoint( |
| 71 const gfx::Point& point) const { | 71 const gfx::Point& point) const { |
| 72 return display_; | 72 return display_; |
| 73 } | 73 } |
| 74 | 74 |
| 75 const gfx::Display& SingleDisplayManager::GetDisplayMatching( | 75 const gfx::Display& SingleDisplayManager::GetDisplayMatching( |
| 76 const gfx::Rect& match_rect) const { | 76 const gfx::Rect& match_rect) const { |
| 77 return display_; | 77 return display_; |
| 78 } | 78 } |
| 79 | 79 |
| 80 std::string SingleDisplayManager::GetDisplayNameAt(size_t index) { |
| 81 return "Display"; |
| 82 } |
| 83 |
| 80 void SingleDisplayManager::OnWindowBoundsChanged( | 84 void SingleDisplayManager::OnWindowBoundsChanged( |
| 81 Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { | 85 Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { |
| 82 if (!use_fullscreen_host_window()) { | 86 if (!use_fullscreen_host_window()) { |
| 83 Update(new_bounds.size()); | 87 Update(new_bounds.size()); |
| 84 NotifyBoundsChanged(display_); | 88 NotifyBoundsChanged(display_); |
| 85 } | 89 } |
| 86 } | 90 } |
| 87 | 91 |
| 88 void SingleDisplayManager::OnWindowDestroying(Window* window) { | 92 void SingleDisplayManager::OnWindowDestroying(Window* window) { |
| 89 if (root_window_ == window) | 93 if (root_window_ == window) |
| 90 root_window_ = NULL; | 94 root_window_ = NULL; |
| 91 } | 95 } |
| 92 | 96 |
| 93 void SingleDisplayManager::Init() { | 97 void SingleDisplayManager::Init() { |
| 94 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 98 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 95 switches::kAuraHostWindowSize); | 99 switches::kAuraHostWindowSize); |
| 96 display_ = CreateDisplayFromSpec(size_str); | 100 display_ = CreateDisplayFromSpec(size_str); |
| 97 } | 101 } |
| 98 | 102 |
| 99 void SingleDisplayManager::Update(const gfx::Size size) { | 103 void SingleDisplayManager::Update(const gfx::Size size) { |
| 100 display_.SetSize(size); | 104 display_.SetSize(size); |
| 101 } | 105 } |
| 102 | 106 |
| 103 } // namespace aura | 107 } // namespace aura |
| OLD | NEW |