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

Side by Side Diff: ui/app_list/views/search_result_page_view.cc

Issue 889593003: Animate the app list search box shadow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_animations
Patch Set: Created 5 years, 10 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
OLDNEW
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 "ui/app_list/views/search_result_page_view.h" 5 #include "ui/app_list/views/search_result_page_view.h"
6 6
7 #include "ui/app_list/app_list_constants.h" 7 #include "ui/app_list/app_list_constants.h"
8 #include "ui/app_list/app_list_switches.h" 8 #include "ui/app_list/app_list_switches.h"
9 #include "ui/app_list/app_list_view_delegate.h" 9 #include "ui/app_list/app_list_view_delegate.h"
10 #include "ui/app_list/views/app_list_main_view.h" 10 #include "ui/app_list/views/app_list_main_view.h"
11 #include "ui/app_list/views/search_box_view.h"
11 #include "ui/app_list/views/search_result_list_view.h" 12 #include "ui/app_list/views/search_result_list_view.h"
12 #include "ui/app_list/views/search_result_tile_item_list_view.h" 13 #include "ui/app_list/views/search_result_tile_item_list_view.h"
13 #include "ui/views/background.h" 14 #include "ui/views/background.h"
14 #include "ui/views/layout/box_layout.h" 15 #include "ui/views/layout/box_layout.h"
15 #include "ui/views/layout/fill_layout.h" 16 #include "ui/views/layout/fill_layout.h"
16 #include "ui/views/shadow_border.h" 17 #include "ui/views/shadow_border.h"
17 18
18 namespace app_list { 19 namespace app_list {
19 20
20 namespace { 21 namespace {
(...skipping 19 matching lines...) Expand all
40 void ChildPreferredSizeChanged(views::View* child) override { 41 void ChildPreferredSizeChanged(views::View* child) override {
41 Layout(); 42 Layout();
42 PreferredSizeChanged(); 43 PreferredSizeChanged();
43 } 44 }
44 }; 45 };
45 46
46 } // namespace 47 } // namespace
47 48
48 SearchResultPageView::SearchResultPageView() : selected_index_(0) { 49 SearchResultPageView::SearchResultPageView() : selected_index_(0) {
49 if (switches::IsExperimentalAppListEnabled()) { 50 if (switches::IsExperimentalAppListEnabled()) {
50 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 51 gfx::ShadowValue shadow = SearchBoxView::GetShadowForZHeight(1);
51 kExperimentalWindowPadding, 52 scoped_ptr<views::Border> border(new views::ShadowBorder(shadow));
52 kTopPadding, kGroupSpacing)); 53
54 gfx::Insets insets = gfx::Insets(kTopPadding, kExperimentalWindowPadding, 0,
55 kExperimentalWindowPadding);
56 insets += -border->GetInsets();
57
58 views::BoxLayout* layout =
59 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, kGroupSpacing);
60 layout->set_inside_border_insets(insets);
61
62 SetLayoutManager(layout);
53 } else { 63 } else {
54 SetLayoutManager(new views::FillLayout); 64 SetLayoutManager(new views::FillLayout);
55 } 65 }
56 } 66 }
57 67
58 SearchResultPageView::~SearchResultPageView() { 68 SearchResultPageView::~SearchResultPageView() {
59 } 69 }
60 70
61 void SearchResultPageView::AddSearchResultContainerView( 71 void SearchResultPageView::AddSearchResultContainerView(
62 AppListModel::SearchResults* results_model, 72 AppListModel::SearchResults* results_model,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 return index >= 0 && index < static_cast<int>(result_container_views_.size()); 129 return index >= 0 && index < static_cast<int>(result_container_views_.size());
120 } 130 }
121 131
122 void SearchResultPageView::ChildPreferredSizeChanged(views::View* child) { 132 void SearchResultPageView::ChildPreferredSizeChanged(views::View* child) {
123 DCHECK(!result_container_views_.empty()); 133 DCHECK(!result_container_views_.empty());
124 Layout(); 134 Layout();
125 SetSelectedIndex(0); 135 SetSelectedIndex(0);
126 } 136 }
127 137
128 } // namespace app_list 138 } // namespace app_list
OLDNEW
« ui/app_list/views/search_box_view.cc ('K') | « ui/app_list/views/search_box_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698