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/root_window.h" | 5 #include "ui/aura/root_window.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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 | 646 |
647 Window* RootWindow::GetFocusedWindow() { | 647 Window* RootWindow::GetFocusedWindow() { |
648 return focused_window_; | 648 return focused_window_; |
649 } | 649 } |
650 | 650 |
651 bool RootWindow::IsFocusedWindow(const Window* window) const { | 651 bool RootWindow::IsFocusedWindow(const Window* window) const { |
652 return focused_window_ == window; | 652 return focused_window_ == window; |
653 } | 653 } |
654 | 654 |
655 void RootWindow::Init() { | 655 void RootWindow::Init() { |
656 Window::Init(ui::Layer::LAYER_HAS_NO_TEXTURE); | 656 Window::Init(ui::Layer::LAYER_NOT_DRAWN); |
657 SetBounds(gfx::Rect(host_->GetSize())); | 657 SetBounds(gfx::Rect(host_->GetSize())); |
658 Show(); | 658 Show(); |
659 compositor()->SetRootLayer(layer()); | 659 compositor()->SetRootLayer(layer()); |
660 host_->SetRootWindow(this); | 660 host_->SetRootWindow(this); |
661 } | 661 } |
662 | 662 |
663 gfx::Rect RootWindow::GetInitialHostWindowBounds() const { | 663 gfx::Rect RootWindow::GetInitialHostWindowBounds() const { |
664 gfx::Rect bounds(kDefaultHostWindowX, kDefaultHostWindowY, | 664 gfx::Rect bounds(kDefaultHostWindowX, kDefaultHostWindowY, |
665 kDefaultHostWindowWidth, kDefaultHostWindowHeight); | 665 kDefaultHostWindowWidth, kDefaultHostWindowHeight); |
666 | 666 |
667 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 667 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
668 switches::kAuraHostWindowSize); | 668 switches::kAuraHostWindowSize); |
669 vector<string> parts; | 669 vector<string> parts; |
670 base::SplitString(size_str, 'x', &parts); | 670 base::SplitString(size_str, 'x', &parts); |
671 int parsed_width = 0, parsed_height = 0; | 671 int parsed_width = 0, parsed_height = 0; |
672 if (parts.size() == 2 && | 672 if (parts.size() == 2 && |
673 base::StringToInt(parts[0], &parsed_width) && parsed_width > 0 && | 673 base::StringToInt(parts[0], &parsed_width) && parsed_width > 0 && |
674 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { | 674 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { |
675 bounds.set_size(gfx::Size(parsed_width, parsed_height)); | 675 bounds.set_size(gfx::Size(parsed_width, parsed_height)); |
676 } else if (use_fullscreen_host_window_) { | 676 } else if (use_fullscreen_host_window_) { |
677 bounds = gfx::Rect(RootWindowHost::GetNativeScreenSize()); | 677 bounds = gfx::Rect(RootWindowHost::GetNativeScreenSize()); |
678 } | 678 } |
679 | 679 |
680 return bounds; | 680 return bounds; |
681 } | 681 } |
682 | 682 |
683 } // namespace aura | 683 } // namespace aura |
OLD | NEW |