OLD | NEW |
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; |
29 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 30 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
30 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 31 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
31 params.parent = | 32 params.parent = |
32 Shell::GetContainer(root_window, ash::kShellWindowId_OverlayContainer); | 33 Shell::GetContainer(root_window, ash::kShellWindowId_OverlayContainer); |
33 widget->set_focus_on_creation(false); | 34 widget->set_focus_on_creation(false); |
34 widget->Init(params); | 35 widget->Init(params); |
35 views::ImageButton* button = new views::ImageButton(listener); | 36 views::ImageButton* button = new views::ImageButton(listener); |
36 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 37 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
37 button->SetImage(views::CustomButton::STATE_NORMAL, | 38 button->SetImage(views::CustomButton::STATE_NORMAL, |
38 rb.GetImageSkiaNamed(IDR_AURA_WINDOW_OVERVIEW_CLOSE)); | 39 rb.GetImageSkiaNamed(IDR_AURA_WINDOW_OVERVIEW_CLOSE)); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 166 settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
166 ScopedTransformOverviewWindow::kTransitionMilliseconds)); | 167 ScopedTransformOverviewWindow::kTransitionMilliseconds)); |
167 close_button_->GetNativeWindow()->SetTransform(close_button_transform); | 168 close_button_->GetNativeWindow()->SetTransform(close_button_transform); |
168 } else { | 169 } else { |
169 close_button_->GetNativeWindow()->SetTransform(close_button_transform); | 170 close_button_->GetNativeWindow()->SetTransform(close_button_transform); |
170 } | 171 } |
171 } | 172 } |
172 } | 173 } |
173 | 174 |
174 } // namespace ash | 175 } // namespace ash |
OLD | NEW |