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

Unified Diff: ash/wm/workspace/phantom_window_controller.cc

Issue 10823025: Adding new maximize menu according to spec (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: git try Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/workspace/phantom_window_controller.h ('k') | ash/wm/workspace/snap_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/phantom_window_controller.cc
diff --git a/ash/wm/workspace/phantom_window_controller.cc b/ash/wm/workspace/phantom_window_controller.cc
index 99861fdb3bd2ff041b58e6622ee95e4d2db97402..656dc698439f1ee19a7f0a367405d7f6cdc05177 100644
--- a/ash/wm/workspace/phantom_window_controller.cc
+++ b/ash/wm/workspace/phantom_window_controller.cc
@@ -72,7 +72,9 @@ class EdgePainter : public views::Painter {
} // namespace
PhantomWindowController::PhantomWindowController(aura::Window* window)
- : window_(window) {
+ : window_(window),
+ phantom_below_window_(NULL),
+ phantom_widget_(NULL) {
}
PhantomWindowController::~PhantomWindowController() {
@@ -83,7 +85,7 @@ void PhantomWindowController::Show(const gfx::Rect& bounds) {
if (bounds == bounds_)
return;
bounds_ = bounds;
- if (!phantom_widget_.get()) {
+ if (!phantom_widget_) {
// Show the phantom at the bounds of the window. We'll animate to the target
// bounds.
start_bounds_ = window_->GetBoundsInScreen();
@@ -103,11 +105,12 @@ void PhantomWindowController::SetBounds(const gfx::Rect& bounds) {
}
void PhantomWindowController::Hide() {
- phantom_widget_.reset();
+ phantom_widget_->Close();
+ phantom_widget_ = NULL;
}
bool PhantomWindowController::IsShowing() const {
- return phantom_widget_.get() != NULL;
+ return phantom_widget_ != NULL;
}
void PhantomWindowController::AnimationProgressed(
@@ -117,11 +120,10 @@ void PhantomWindowController::AnimationProgressed(
}
void PhantomWindowController::CreatePhantomWidget(const gfx::Rect& bounds) {
- DCHECK(!phantom_widget_.get());
- phantom_widget_.reset(new views::Widget);
+ DCHECK(!phantom_widget_);
+ phantom_widget_ = new views::Widget;
views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
params.transparent = true;
- params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
// PhantomWindowController is used by FrameMaximizeButton to highlight the
// launcher button. Put the phantom in the same window as the launcher so that
// the phantom is visible.
@@ -139,7 +141,10 @@ void PhantomWindowController::CreatePhantomWidget(const gfx::Rect& bounds) {
views::Background::CreateBackgroundPainter(true, new EdgePainter));
phantom_widget_->SetContentsView(content_view);
phantom_widget_->SetBounds(bounds);
- phantom_widget_->StackAbove(window_);
+ if (phantom_below_window_)
+ phantom_widget_->StackBelow(phantom_below_window_);
+ else
+ phantom_widget_->StackAbove(window_);
phantom_widget_->Show();
// Fade the window in.
ui::Layer* layer = phantom_widget_->GetNativeWindow()->layer();
« no previous file with comments | « ash/wm/workspace/phantom_window_controller.h ('k') | ash/wm/workspace/snap_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698