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

Side by Side Diff: ash/wm/overview/window_selector_window.cc

Issue 286733002: [Refactor] Consolidate the logic for whether a widget can be activated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/overview/window_selector_window.h" 5 #include "ash/wm/overview/window_selector_window.h"
6 6
7 #include "ash/screen_util.h" 7 #include "ash/screen_util.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/wm/overview/scoped_transform_overview_window.h" 10 #include "ash/wm/overview/scoped_transform_overview_window.h"
11 #include "grit/ash_resources.h" 11 #include "grit/ash_resources.h"
12 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
13 #include "ui/base/resource/resource_bundle.h" 13 #include "ui/base/resource/resource_bundle.h"
14 #include "ui/compositor/scoped_layer_animation_settings.h" 14 #include "ui/compositor/scoped_layer_animation_settings.h"
15 #include "ui/gfx/rect.h" 15 #include "ui/gfx/rect.h"
16 #include "ui/gfx/transform.h" 16 #include "ui/gfx/transform.h"
17 #include "ui/views/controls/button/image_button.h" 17 #include "ui/views/controls/button/image_button.h"
18 #include "ui/views/widget/widget.h" 18 #include "ui/views/widget/widget.h"
19 19
20 namespace ash { 20 namespace ash {
21 21
22 namespace { 22 namespace {
23 23
24 views::Widget* CreateCloseWindowButton(aura::Window* root_window, 24 views::Widget* CreateCloseWindowButton(aura::Window* root_window,
25 views::ButtonListener* listener) { 25 views::ButtonListener* listener) {
26 views::Widget* widget = new views::Widget; 26 views::Widget* widget = new views::Widget;
27 views::Widget::InitParams params; 27 views::Widget::InitParams params;
28 params.type = views::Widget::InitParams::TYPE_POPUP; 28 params.type = views::Widget::InitParams::TYPE_POPUP;
29 params.can_activate = false;
30 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 29 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
31 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 30 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
32 params.parent = 31 params.parent =
33 Shell::GetContainer(root_window, ash::kShellWindowId_OverlayContainer); 32 Shell::GetContainer(root_window, ash::kShellWindowId_OverlayContainer);
34 widget->set_focus_on_creation(false); 33 widget->set_focus_on_creation(false);
35 widget->Init(params); 34 widget->Init(params);
36 views::ImageButton* button = new views::ImageButton(listener); 35 views::ImageButton* button = new views::ImageButton(listener);
37 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 36 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
38 button->SetImage(views::CustomButton::STATE_NORMAL, 37 button->SetImage(views::CustomButton::STATE_NORMAL,
39 rb.GetImageSkiaNamed(IDR_AURA_WINDOW_OVERVIEW_CLOSE)); 38 rb.GetImageSkiaNamed(IDR_AURA_WINDOW_OVERVIEW_CLOSE));
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds( 165 settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
167 ScopedTransformOverviewWindow::kTransitionMilliseconds)); 166 ScopedTransformOverviewWindow::kTransitionMilliseconds));
168 close_button_->GetNativeWindow()->SetTransform(close_button_transform); 167 close_button_->GetNativeWindow()->SetTransform(close_button_transform);
169 } else { 168 } else {
170 close_button_->GetNativeWindow()->SetTransform(close_button_transform); 169 close_button_->GetNativeWindow()->SetTransform(close_button_transform);
171 } 170 }
172 } 171 }
173 } 172 }
174 173
175 } // namespace ash 174 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698