| 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) { | 80 std::string SingleDisplayManager::GetDisplayNameFor( |
| 81 const gfx::Display& display) { |
| 81 return "Display"; | 82 return "Display"; |
| 82 } | 83 } |
| 83 | 84 |
| 84 void SingleDisplayManager::OnWindowBoundsChanged( | 85 void SingleDisplayManager::OnWindowBoundsChanged( |
| 85 Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { | 86 Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { |
| 86 if (!use_fullscreen_host_window()) { | 87 if (!use_fullscreen_host_window()) { |
| 87 Update(new_bounds.size()); | 88 Update(new_bounds.size()); |
| 88 NotifyBoundsChanged(display_); | 89 NotifyBoundsChanged(display_); |
| 89 } | 90 } |
| 90 } | 91 } |
| 91 | 92 |
| 92 void SingleDisplayManager::OnWindowDestroying(Window* window) { | 93 void SingleDisplayManager::OnWindowDestroying(Window* window) { |
| 93 if (root_window_ == window) | 94 if (root_window_ == window) |
| 94 root_window_ = NULL; | 95 root_window_ = NULL; |
| 95 } | 96 } |
| 96 | 97 |
| 97 void SingleDisplayManager::Init() { | 98 void SingleDisplayManager::Init() { |
| 98 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 99 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 99 switches::kAuraHostWindowSize); | 100 switches::kAuraHostWindowSize); |
| 100 display_ = CreateDisplayFromSpec(size_str); | 101 display_ = CreateDisplayFromSpec(size_str); |
| 101 } | 102 } |
| 102 | 103 |
| 103 void SingleDisplayManager::Update(const gfx::Size size) { | 104 void SingleDisplayManager::Update(const gfx::Size size) { |
| 104 display_.SetSize(size); | 105 display_.SetSize(size); |
| 105 } | 106 } |
| 106 | 107 |
| 107 } // namespace aura | 108 } // namespace aura |
| OLD | NEW |