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

Side by Side Diff: ash/shelf/shelf_view.cc

Issue 2191363002: Reland of "Apply Shelf/Dock opacity animations for the Material Design style." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added ShelfBackgoundAnimator::Initialize(ShelfBackgroundAnimatorObserver*). Created 4 years, 4 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
« no previous file with comments | « ash/shelf/shelf_view.h ('k') | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/shelf/shelf_view.h" 5 #include "ash/shelf/shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/aura/wm_window_aura.h" 10 #include "ash/aura/wm_window_aura.h"
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 AnimateToIdealBounds(); 798 AnimateToIdealBounds();
799 return; 799 return;
800 } 800 }
801 801
802 IdealBounds ideal_bounds; 802 IdealBounds ideal_bounds;
803 CalculateIdealBounds(&ideal_bounds); 803 CalculateIdealBounds(&ideal_bounds);
804 views::ViewModelUtils::SetViewBoundsToIdealBounds(*view_model_); 804 views::ViewModelUtils::SetViewBoundsToIdealBounds(*view_model_);
805 overflow_button_->SetBoundsRect(ideal_bounds.overflow_bounds); 805 overflow_button_->SetBoundsRect(ideal_bounds.overflow_bounds);
806 } 806 }
807 807
808 void ShelfView::UpdateShelfItemBackground(int alpha) {
809 GetAppListButton()->SetBackgroundAlpha(alpha);
810 overflow_button_->SetBackgroundAlpha(alpha);
811 }
812
808 void ShelfView::UpdateAllButtonsVisibilityInOverflowMode() { 813 void ShelfView::UpdateAllButtonsVisibilityInOverflowMode() {
809 // The overflow button is not shown in overflow mode. 814 // The overflow button is not shown in overflow mode.
810 overflow_button_->SetVisible(false); 815 overflow_button_->SetVisible(false);
811 DCHECK_LT(last_visible_index_, view_model_->view_size()); 816 DCHECK_LT(last_visible_index_, view_model_->view_size());
812 for (int i = 0; i < view_model_->view_size(); ++i) { 817 for (int i = 0; i < view_model_->view_size(); ++i) {
813 bool visible = i >= first_visible_index_ && i <= last_visible_index_; 818 bool visible = i >= first_visible_index_ && i <= last_visible_index_;
814 // To track the dragging of |drag_view_| continuously, its visibility 819 // To track the dragging of |drag_view_| continuously, its visibility
815 // should be always true regardless of its position. 820 // should be always true regardless of its position.
816 if (dragged_off_from_overflow_to_shelf_ && 821 if (dragged_off_from_overflow_to_shelf_ &&
817 view_model_->view_at(i) == drag_view_) 822 view_model_->view_at(i) == drag_view_)
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
1908 1913
1909 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { 1914 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const {
1910 const gfx::Rect bounds = GetBoundsInScreen(); 1915 const gfx::Rect bounds = GetBoundsInScreen();
1911 int distance = shelf_->SelectValueForShelfAlignment( 1916 int distance = shelf_->SelectValueForShelfAlignment(
1912 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), 1917 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(),
1913 bounds.x() - coordinate.x()); 1918 bounds.x() - coordinate.x());
1914 return distance > 0 ? distance : 0; 1919 return distance > 0 ? distance : 0;
1915 } 1920 }
1916 1921
1917 } // namespace ash 1922 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_view.h ('k') | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698