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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 RootWindow* SingleDisplayManager::CreateRootWindowForDisplay( | 47 RootWindow* SingleDisplayManager::CreateRootWindowForDisplay( |
48 const gfx::Display& display) { | 48 const gfx::Display& display) { |
49 DCHECK(!root_window_); | 49 DCHECK(!root_window_); |
50 DCHECK_EQ(display_.id(), display.id()); | 50 DCHECK_EQ(display_.id(), display.id()); |
51 root_window_ = new RootWindow(display.bounds()); | 51 root_window_ = new RootWindow(display.bounds()); |
52 root_window_->AddObserver(this); | 52 root_window_->AddObserver(this); |
53 root_window_->Init(); | 53 root_window_->Init(); |
54 return root_window_; | 54 return root_window_; |
55 } | 55 } |
56 | 56 |
57 const gfx::Display& SingleDisplayManager::GetDisplayAt(size_t index) { | 57 gfx::Display* SingleDisplayManager::GetDisplayAt(size_t index) { |
58 return display_; | 58 return &display_; |
59 } | 59 } |
60 | 60 |
61 size_t SingleDisplayManager::GetNumDisplays() const { | 61 size_t SingleDisplayManager::GetNumDisplays() const { |
62 return 1; | 62 return 1; |
63 } | 63 } |
64 | 64 |
65 const gfx::Display& SingleDisplayManager::GetDisplayNearestWindow( | 65 const gfx::Display& SingleDisplayManager::GetDisplayNearestWindow( |
66 const Window* window) const { | 66 const Window* window) const { |
67 return display_; | 67 return display_; |
68 } | 68 } |
(...skipping 20 matching lines...) Expand all Loading... |
89 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 89 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
90 switches::kAuraHostWindowSize); | 90 switches::kAuraHostWindowSize); |
91 display_ = CreateDisplayFromSpec(size_str); | 91 display_ = CreateDisplayFromSpec(size_str); |
92 } | 92 } |
93 | 93 |
94 void SingleDisplayManager::Update(const gfx::Size size) { | 94 void SingleDisplayManager::Update(const gfx::Size size) { |
95 display_.SetSize(size); | 95 display_.SetSize(size); |
96 } | 96 } |
97 | 97 |
98 } // namespace aura | 98 } // namespace aura |
OLD | NEW |