Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: ui/aura/root_window.cc

Issue 9289036: aura: Add Layer::LAYER_SOLID_COLOR to compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor changes Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 634
635 Window* RootWindow::GetFocusedWindow() { 635 Window* RootWindow::GetFocusedWindow() {
636 return focused_window_; 636 return focused_window_;
637 } 637 }
638 638
639 bool RootWindow::IsFocusedWindow(const Window* window) const { 639 bool RootWindow::IsFocusedWindow(const Window* window) const {
640 return focused_window_ == window; 640 return focused_window_ == window;
641 } 641 }
642 642
643 void RootWindow::Init() { 643 void RootWindow::Init() {
644 Window::Init(ui::Layer::LAYER_HAS_NO_TEXTURE); 644 Window::Init(ui::Layer::LAYER_NOT_DRAWN);
645 SetBounds(gfx::Rect(host_->GetSize())); 645 SetBounds(gfx::Rect(host_->GetSize()));
646 Show(); 646 Show();
647 compositor()->SetRootLayer(layer()); 647 compositor()->SetRootLayer(layer());
648 host_->SetRootWindow(this); 648 host_->SetRootWindow(this);
649 } 649 }
650 650
651 gfx::Rect RootWindow::GetInitialHostWindowBounds() const { 651 gfx::Rect RootWindow::GetInitialHostWindowBounds() const {
652 gfx::Rect bounds(kDefaultHostWindowX, kDefaultHostWindowY, 652 gfx::Rect bounds(kDefaultHostWindowX, kDefaultHostWindowY,
653 kDefaultHostWindowWidth, kDefaultHostWindowHeight); 653 kDefaultHostWindowWidth, kDefaultHostWindowHeight);
654 654
655 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 655 const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
656 switches::kAuraHostWindowSize); 656 switches::kAuraHostWindowSize);
657 vector<string> parts; 657 vector<string> parts;
658 base::SplitString(size_str, 'x', &parts); 658 base::SplitString(size_str, 'x', &parts);
659 int parsed_width = 0, parsed_height = 0; 659 int parsed_width = 0, parsed_height = 0;
660 if (parts.size() == 2 && 660 if (parts.size() == 2 &&
661 base::StringToInt(parts[0], &parsed_width) && parsed_width > 0 && 661 base::StringToInt(parts[0], &parsed_width) && parsed_width > 0 &&
662 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { 662 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) {
663 bounds.set_size(gfx::Size(parsed_width, parsed_height)); 663 bounds.set_size(gfx::Size(parsed_width, parsed_height));
664 } else if (use_fullscreen_host_window_) { 664 } else if (use_fullscreen_host_window_) {
665 bounds = gfx::Rect(RootWindowHost::GetNativeScreenSize()); 665 bounds = gfx::Rect(RootWindowHost::GetNativeScreenSize());
666 } 666 }
667 667
668 return bounds; 668 return bounds;
669 } 669 }
670 670
671 } // namespace aura 671 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698