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

Side by Side Diff: ash/wm/custom_frame_view_ash.cc

Issue 10911172: Changes launcher so that when animating hidden the background doesn't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge 2 trunk Created 8 years, 3 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
« no previous file with comments | « no previous file | ash/wm/shelf_layout_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/wm/custom_frame_view_ash.h" 5 #include "ash/wm/custom_frame_view_ash.h"
6 6
7 #include "ash/wm/frame_painter.h" 7 #include "ash/wm/frame_painter.h"
8 #include "ash/wm/workspace/frame_maximize_button.h" 8 #include "ash/wm/workspace/frame_maximize_button.h"
9 #include "grit/ui_resources.h" 9 #include "grit/ui_resources.h"
10 #include "grit/ui_strings.h" // Accessibility names 10 #include "grit/ui_strings.h" // Accessibility names
11 #include "ui/base/l10n/l10n_util.h" 11 #include "ui/base/l10n/l10n_util.h"
12 #include "ui/base/resource/resource_bundle.h" 12 #include "ui/base/resource/resource_bundle.h"
13 #include "ui/compositor/layer_animator.h"
13 #include "ui/gfx/font.h" 14 #include "ui/gfx/font.h"
14 #include "ui/gfx/image/image.h" 15 #include "ui/gfx/image/image.h"
15 #include "ui/gfx/rect.h" 16 #include "ui/gfx/rect.h"
16 #include "ui/gfx/size.h" 17 #include "ui/gfx/size.h"
17 #include "ui/views/controls/button/image_button.h" 18 #include "ui/views/controls/button/image_button.h"
18 #include "ui/views/widget/native_widget_aura.h" 19 #include "ui/views/widget/native_widget_aura.h"
19 #include "ui/views/widget/widget.h" 20 #include "ui/views/widget/widget.h"
20 #include "ui/views/widget/widget_delegate.h" 21 #include "ui/views/widget/widget_delegate.h"
21 22
22 namespace { 23 namespace {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 139 }
139 140
140 gfx::Size CustomFrameViewAsh::GetMinimumSize() { 141 gfx::Size CustomFrameViewAsh::GetMinimumSize() {
141 return frame_painter_->GetMinimumSize(this); 142 return frame_painter_->GetMinimumSize(this);
142 } 143 }
143 144
144 //////////////////////////////////////////////////////////////////////////////// 145 ////////////////////////////////////////////////////////////////////////////////
145 // views::ButtonListener overrides: 146 // views::ButtonListener overrides:
146 void CustomFrameViewAsh::ButtonPressed(views::Button* sender, 147 void CustomFrameViewAsh::ButtonPressed(views::Button* sender,
147 const ui::Event& event) { 148 const ui::Event& event) {
149 if (event.IsShiftDown())
150 ui::LayerAnimator::set_slow_animation_mode(true);
148 if (sender == maximize_button_) { 151 if (sender == maximize_button_) {
149 // The maximize button may move out from under the cursor. 152 // The maximize button may move out from under the cursor.
150 ResetWindowControls(); 153 ResetWindowControls();
151 if (frame_->IsMaximized()) 154 if (frame_->IsMaximized())
152 frame_->Restore(); 155 frame_->Restore();
153 else 156 else
154 frame_->Maximize(); 157 frame_->Maximize();
155 // |this| may be deleted - some windows delete their frames on maximize. 158 // |this| may be deleted - some windows delete their frames on maximize.
156 } else if (sender == close_button_) { 159 } else if (sender == close_button_) {
157 frame_->Close(); 160 frame_->Close();
158 } 161 }
162 if (event.IsShiftDown())
163 ui::LayerAnimator::set_slow_animation_mode(false);
159 } 164 }
160 165
161 //////////////////////////////////////////////////////////////////////////////// 166 ////////////////////////////////////////////////////////////////////////////////
162 // CustomFrameViewAsh, private: 167 // CustomFrameViewAsh, private:
163 168
164 int CustomFrameViewAsh::NonClientTopBorderHeight() const { 169 int CustomFrameViewAsh::NonClientTopBorderHeight() const {
165 // Reserve enough space to see the buttons, including any offset from top and 170 // Reserve enough space to see the buttons, including any offset from top and
166 // reserving space for the separator line. 171 // reserving space for the separator line.
167 return close_button_->bounds().bottom() + 172 return close_button_->bounds().bottom() +
168 frame_painter_->HeaderContentSeparatorSize(); 173 frame_painter_->HeaderContentSeparatorSize();
169 } 174 }
170 175
171 } // namespace ash 176 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/shelf_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698