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

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

Issue 8417008: aura: Add fullscreen/popups to RenderWidgetHostViewAura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use aura::WindowType Created 9 years, 1 month 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) 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698