| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/desktop.h" | 5 #include "ui/aura/desktop.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 549 |
| 550 Window* Desktop::GetFocusedWindow() { | 550 Window* Desktop::GetFocusedWindow() { |
| 551 return focused_window_; | 551 return focused_window_; |
| 552 } | 552 } |
| 553 | 553 |
| 554 bool Desktop::IsFocusedWindow(const Window* window) const { | 554 bool Desktop::IsFocusedWindow(const Window* window) const { |
| 555 return focused_window_ == window; | 555 return focused_window_ == window; |
| 556 } | 556 } |
| 557 | 557 |
| 558 void Desktop::Init() { | 558 void Desktop::Init() { |
| 559 Window::Init(ui::Layer::LAYER_HAS_NO_TEXTURE); | 559 Window::Init(ui::Layer::LAYER_HAS_NO_TEXTURE, |
| 560 Window::LAYER_INITIALLY_INVISIBLE); |
| 560 SetBounds(gfx::Rect(host_->GetSize())); | 561 SetBounds(gfx::Rect(host_->GetSize())); |
| 561 Show(); | 562 Show(); |
| 562 compositor()->SetRootLayer(layer()); | 563 compositor()->SetRootLayer(layer()); |
| 563 } | 564 } |
| 564 | 565 |
| 565 gfx::Rect Desktop::GetInitialHostWindowBounds() const { | 566 gfx::Rect Desktop::GetInitialHostWindowBounds() const { |
| 566 gfx::Rect bounds(kDefaultHostWindowX, kDefaultHostWindowY, | 567 gfx::Rect bounds(kDefaultHostWindowX, kDefaultHostWindowY, |
| 567 kDefaultHostWindowWidth, kDefaultHostWindowHeight); | 568 kDefaultHostWindowWidth, kDefaultHostWindowHeight); |
| 568 | 569 |
| 569 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 570 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 570 switches::kAuraHostWindowSize); | 571 switches::kAuraHostWindowSize); |
| 571 vector<string> parts; | 572 vector<string> parts; |
| 572 base::SplitString(size_str, 'x', &parts); | 573 base::SplitString(size_str, 'x', &parts); |
| 573 int parsed_width = 0, parsed_height = 0; | 574 int parsed_width = 0, parsed_height = 0; |
| 574 if (parts.size() == 2 && | 575 if (parts.size() == 2 && |
| 575 base::StringToInt(parts[0], &parsed_width) && parsed_width > 0 && | 576 base::StringToInt(parts[0], &parsed_width) && parsed_width > 0 && |
| 576 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { | 577 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { |
| 577 bounds.set_size(gfx::Size(parsed_width, parsed_height)); | 578 bounds.set_size(gfx::Size(parsed_width, parsed_height)); |
| 578 } else if (use_fullscreen_host_window_) { | 579 } else if (use_fullscreen_host_window_) { |
| 579 bounds = gfx::Rect(DesktopHost::GetNativeDisplaySize()); | 580 bounds = gfx::Rect(DesktopHost::GetNativeDisplaySize()); |
| 580 } | 581 } |
| 581 | 582 |
| 582 return bounds; | 583 return bounds; |
| 583 } | 584 } |
| 584 | 585 |
| 585 } // namespace aura | 586 } // namespace aura |
| OLD | NEW |