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

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

Issue 894203004: Add a proper shadow to the experimental app list search box. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@make_doodle_clickable
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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/contents_view.h" 5 #include "ui/app_list/views/contents_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 default_contents_bounds.bottom_right().OffsetFromOrigin()); 462 default_contents_bounds.bottom_right().OffsetFromOrigin());
463 return gfx::Size(bottom_right.x(), bottom_right.y()); 463 return gfx::Size(bottom_right.x(), bottom_right.y());
464 } 464 }
465 465
466 void ContentsView::Layout() { 466 void ContentsView::Layout() {
467 // The search box is contained in a widget so set the bounds of the widget 467 // The search box is contained in a widget so set the bounds of the widget
468 // rather than the SearchBoxView. In athena, the search box widget will be the 468 // rather than the SearchBoxView. In athena, the search box widget will be the
469 // same as the app list widget so don't move it. 469 // same as the app list widget so don't move it.
470 views::Widget* search_box_widget = GetSearchBoxView()->GetWidget(); 470 views::Widget* search_box_widget = GetSearchBoxView()->GetWidget();
471 if (search_box_widget && search_box_widget != GetWidget()) { 471 if (search_box_widget && search_box_widget != GetWidget()) {
472 search_box_widget->SetBounds( 472 gfx::Rect search_box_bounds = GetSearchBoxBoundsForState(GetActiveState());
473 ConvertRectToWidget(GetSearchBoxBoundsForState(GetActiveState()))); 473 search_box_widget->SetBounds(ConvertRectToWidget(
474 GetSearchBoxView()->GetViewBoundsForSearchBoxContentsBounds(
475 search_box_bounds)));
Matt Giuca 2015/02/03 07:29:23 Would have looked funnier as a giant nested expres
calamity 2015/02/04 03:37:01 Acknowledged.
474 } 476 }
475 477
476 // Immediately finish all current animations. 478 // Immediately finish all current animations.
477 pagination_model_.FinishAnimation(); 479 pagination_model_.FinishAnimation();
478 480
479 // Move the current view onto the screen, and all other views off screen to 481 // Move the current view onto the screen, and all other views off screen to
480 // the left. (Since we are not animating, we don't need to be careful about 482 // the left. (Since we are not animating, we don't need to be careful about
481 // which side we place the off-screen views onto.) 483 // which side we place the off-screen views onto.)
482 gfx::Rect rect(GetDefaultContentsBounds()); 484 gfx::Rect rect(GetDefaultContentsBounds());
483 // Custom pages are aligned to the top of the window, not under the search 485 // Custom pages are aligned to the top of the window, not under the search
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 } 536 }
535 537
536 void ContentsView::TransitionStarted() { 538 void ContentsView::TransitionStarted() {
537 } 539 }
538 540
539 void ContentsView::TransitionChanged() { 541 void ContentsView::TransitionChanged() {
540 UpdatePageBounds(); 542 UpdatePageBounds();
541 } 543 }
542 544
543 } // namespace app_list 545 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698