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/common/wm/overview/window_selector.h" | 5 #include "ash/common/wm/overview/window_selector.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "base/command_line.h" | 30 #include "base/command_line.h" |
31 #include "base/metrics/histogram_macros.h" | 31 #include "base/metrics/histogram_macros.h" |
32 #include "third_party/skia/include/core/SkPath.h" | 32 #include "third_party/skia/include/core/SkPath.h" |
33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
34 #include "ui/compositor/scoped_layer_animation_settings.h" | 34 #include "ui/compositor/scoped_layer_animation_settings.h" |
35 #include "ui/display/screen.h" | 35 #include "ui/display/screen.h" |
36 #include "ui/events/event.h" | 36 #include "ui/events/event.h" |
37 #include "ui/gfx/canvas.h" | 37 #include "ui/gfx/canvas.h" |
38 #include "ui/gfx/paint_vector_icon.h" | 38 #include "ui/gfx/paint_vector_icon.h" |
39 #include "ui/gfx/skia_util.h" | 39 #include "ui/gfx/skia_util.h" |
40 #include "ui/gfx/vector_icons_public.h" | 40 #include "ui/vector_icons/vector_icons.h" |
41 #include "ui/views/border.h" | 41 #include "ui/views/border.h" |
42 #include "ui/views/controls/image_view.h" | 42 #include "ui/views/controls/image_view.h" |
43 #include "ui/views/controls/textfield/textfield.h" | 43 #include "ui/views/controls/textfield/textfield.h" |
44 #include "ui/views/layout/box_layout.h" | 44 #include "ui/views/layout/box_layout.h" |
45 | 45 |
46 namespace ash { | 46 namespace ash { |
47 | 47 |
48 namespace { | 48 namespace { |
49 | 49 |
50 // The amount of padding surrounding the text in the text filtering textbox. | 50 // The amount of padding surrounding the text in the text filtering textbox. |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 &restoring_minimized_windows_, true); | 286 &restoring_minimized_windows_, true); |
287 | 287 |
288 // Do not call PrepareForOverview until all items are added to window_list_ | 288 // Do not call PrepareForOverview until all items are added to window_list_ |
289 // as we don't want to cause any window updates until all windows in | 289 // as we don't want to cause any window updates until all windows in |
290 // overview are observed. See http://crbug.com/384495. | 290 // overview are observed. See http://crbug.com/384495. |
291 for (std::unique_ptr<WindowGrid>& window_grid : grid_list_) { | 291 for (std::unique_ptr<WindowGrid>& window_grid : grid_list_) { |
292 window_grid->PrepareForOverview(); | 292 window_grid->PrepareForOverview(); |
293 window_grid->PositionWindows(true); | 293 window_grid->PositionWindows(true); |
294 } | 294 } |
295 | 295 |
296 search_image_ = | 296 search_image_ = gfx::CreateVectorIcon(ui::kSearchIcon, kTextFilterIconSize, |
297 gfx::CreateVectorIcon(gfx::VectorIconId::OMNIBOX_SEARCH, | 297 kTextFilterIconColor); |
298 kTextFilterIconSize, kTextFilterIconColor); | |
299 WmWindow* root_window = shell->GetPrimaryRootWindow(); | 298 WmWindow* root_window = shell->GetPrimaryRootWindow(); |
300 text_filter_widget_.reset(CreateTextFilter(this, root_window, search_image_, | 299 text_filter_widget_.reset(CreateTextFilter(this, root_window, search_image_, |
301 &text_filter_bottom_)); | 300 &text_filter_bottom_)); |
302 } | 301 } |
303 | 302 |
304 DCHECK(!grid_list_.empty()); | 303 DCHECK(!grid_list_.empty()); |
305 UMA_HISTOGRAM_COUNTS_100("Ash.WindowSelector.Items", num_items_); | 304 UMA_HISTOGRAM_COUNTS_100("Ash.WindowSelector.Items", num_items_); |
306 | 305 |
307 shell->AddActivationObserver(this); | 306 shell->AddActivationObserver(this); |
308 | 307 |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 for (size_t i = 0; i <= grid_list_.size() && | 675 for (size_t i = 0; i <= grid_list_.size() && |
677 grid_list_[selected_grid_index_]->Move(direction, animate); | 676 grid_list_[selected_grid_index_]->Move(direction, animate); |
678 i++) { | 677 i++) { |
679 selected_grid_index_ = | 678 selected_grid_index_ = |
680 (selected_grid_index_ + display_direction + grid_list_.size()) % | 679 (selected_grid_index_ + display_direction + grid_list_.size()) % |
681 grid_list_.size(); | 680 grid_list_.size(); |
682 } | 681 } |
683 } | 682 } |
684 | 683 |
685 } // namespace ash | 684 } // namespace ash |
OLD | NEW |