Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/common/wm/window_cycle_list.h" | 5 #include "ash/common/wm/window_cycle_list.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "ash/common/wm/mru_window_tracker.h" | 10 #include "ash/common/wm/mru_window_tracker.h" |
| 11 #include "ash/common/wm/window_state.h" | 11 #include "ash/common/wm/window_state.h" |
| 12 #include "ash/common/wm_shell.h" | 12 #include "ash/common/wm_shell.h" |
| 13 #include "ash/common/wm_window.h" | 13 #include "ash/common/wm_window.h" |
| 14 #include "ash/public/cpp/shell_window_ids.h" | 14 #include "ash/public/cpp/shell_window_ids.h" |
| 15 #include "ash/root_window_controller.h" | 15 #include "ash/root_window_controller.h" |
| 16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 17 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
|
msw
2017/01/19 09:46:53
nit: this include may not be needed anymore
Evan Stade
2017/01/19 16:26:29
Done.
| |
| 18 #include "ui/accessibility/ax_node_data.h" | 18 #include "ui/accessibility/ax_node_data.h" |
| 19 #include "ui/compositor/scoped_layer_animation_settings.h" | 19 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 20 #include "ui/display/display.h" | 20 #include "ui/display/display.h" |
| 21 #include "ui/display/screen.h" | 21 #include "ui/display/screen.h" |
| 22 #include "ui/gfx/canvas.h" | 22 #include "ui/gfx/canvas.h" |
| 23 #include "ui/views/background.h" | 23 #include "ui/views/background.h" |
| 24 #include "ui/views/border.h" | 24 #include "ui/views/border.h" |
| 25 #include "ui/views/controls/label.h" | 25 #include "ui/views/controls/label.h" |
| 26 #include "ui/views/layout/box_layout.h" | 26 #include "ui/views/layout/box_layout.h" |
| 27 #include "ui/views/painter.h" | 27 #include "ui/views/painter.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 // |mirror_container_| owns |view|. | 240 // |mirror_container_| owns |view|. |
| 241 views::View* view = new WindowPreviewView(window); | 241 views::View* view = new WindowPreviewView(window); |
| 242 window_view_map_[window] = view; | 242 window_view_map_[window] = view; |
| 243 mirror_container_->AddChildView(view); | 243 mirror_container_->AddChildView(view); |
| 244 } | 244 } |
| 245 | 245 |
| 246 // The background needs to be painted to fill the layer, not the View, | 246 // The background needs to be painted to fill the layer, not the View, |
| 247 // because the layer animates bounds changes but the View's bounds change | 247 // because the layer animates bounds changes but the View's bounds change |
| 248 // immediately. | 248 // immediately. |
| 249 highlight_view_->set_background(new LayerFillBackgroundPainter( | 249 highlight_view_->set_background(new LayerFillBackgroundPainter( |
| 250 base::WrapUnique(views::Painter::CreateRoundRectWith1PxBorderPainter( | 250 views::Painter::CreateRoundRectWith1PxBorderPainter( |
| 251 SkColorSetA(SK_ColorWHITE, 0x4D), SkColorSetA(SK_ColorWHITE, 0x33), | 251 SkColorSetA(SK_ColorWHITE, 0x4D), SkColorSetA(SK_ColorWHITE, 0x33), |
| 252 kBackgroundCornerRadius)))); | 252 kBackgroundCornerRadius))); |
| 253 highlight_view_->SetPaintToLayer(true); | 253 highlight_view_->SetPaintToLayer(true); |
| 254 highlight_view_->layer()->SetFillsBoundsOpaquely(false); | 254 highlight_view_->layer()->SetFillsBoundsOpaquely(false); |
| 255 | 255 |
| 256 AddChildView(highlight_view_); | 256 AddChildView(highlight_view_); |
| 257 AddChildView(mirror_container_); | 257 AddChildView(mirror_container_); |
| 258 } | 258 } |
| 259 | 259 |
| 260 ~WindowCycleView() override {} | 260 ~WindowCycleView() override {} |
| 261 | 261 |
| 262 void SetTargetWindow(WmWindow* target) { | 262 void SetTargetWindow(WmWindow* target) { |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 552 widget->Init(params); | 552 widget->Init(params); |
| 553 | 553 |
| 554 screen_observer_.Add(display::Screen::GetScreen()); | 554 screen_observer_.Add(display::Screen::GetScreen()); |
| 555 widget->Show(); | 555 widget->Show(); |
| 556 widget->SetCapture(cycle_view_); | 556 widget->SetCapture(cycle_view_); |
| 557 widget->set_auto_release_capture(false); | 557 widget->set_auto_release_capture(false); |
| 558 cycle_ui_widget_ = widget; | 558 cycle_ui_widget_ = widget; |
| 559 } | 559 } |
| 560 | 560 |
| 561 } // namespace ash | 561 } // namespace ash |
| OLD | NEW |