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

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

Issue 2679133003: [ash-md] Wired in the Shelf color to be derived from the Wallpaper. (Closed)
Patch Set: Addressed nits. Created 3 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
« no previous file with comments | « ash/common/shelf/shelf_view.h ('k') | ash/common/shelf/shelf_widget.h » ('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/common/shelf/shelf_view.h" 5 #include "ash/common/shelf/shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/common/ash_constants.h" 10 #include "ash/common/ash_constants.h"
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 AnimateToIdealBounds(); 747 AnimateToIdealBounds();
748 return; 748 return;
749 } 749 }
750 750
751 IdealBounds ideal_bounds; 751 IdealBounds ideal_bounds;
752 CalculateIdealBounds(&ideal_bounds); 752 CalculateIdealBounds(&ideal_bounds);
753 views::ViewModelUtils::SetViewBoundsToIdealBounds(*view_model_); 753 views::ViewModelUtils::SetViewBoundsToIdealBounds(*view_model_);
754 overflow_button_->SetBoundsRect(ideal_bounds.overflow_bounds); 754 overflow_button_->SetBoundsRect(ideal_bounds.overflow_bounds);
755 } 755 }
756 756
757 void ShelfView::UpdateShelfItemBackground(int alpha) { 757 void ShelfView::UpdateShelfItemBackground(SkColor color) {
758 GetAppListButton()->SetBackgroundAlpha(alpha); 758 GetAppListButton()->UpdateShelfItemBackground(color);
759 overflow_button_->SetBackgroundAlpha(alpha); 759 overflow_button_->UpdateShelfItemBackground(color);
760 } 760 }
761 761
762 void ShelfView::UpdateAllButtonsVisibilityInOverflowMode() { 762 void ShelfView::UpdateAllButtonsVisibilityInOverflowMode() {
763 // The overflow button is not shown in overflow mode. 763 // The overflow button is not shown in overflow mode.
764 overflow_button_->SetVisible(false); 764 overflow_button_->SetVisible(false);
765 DCHECK_LT(last_visible_index_, view_model_->view_size()); 765 DCHECK_LT(last_visible_index_, view_model_->view_size());
766 for (int i = 0; i < view_model_->view_size(); ++i) { 766 for (int i = 0; i < view_model_->view_size(); ++i) {
767 bool visible = i >= first_visible_index_ && i <= last_visible_index_; 767 bool visible = i >= first_visible_index_ && i <= last_visible_index_;
768 // To track the dragging of |drag_view_| continuously, its visibility 768 // To track the dragging of |drag_view_| continuously, its visibility
769 // should be always true regardless of its position. 769 // should be always true regardless of its position.
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 1776
1777 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { 1777 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const {
1778 const gfx::Rect bounds = GetBoundsInScreen(); 1778 const gfx::Rect bounds = GetBoundsInScreen();
1779 int distance = wm_shelf_->SelectValueForShelfAlignment( 1779 int distance = wm_shelf_->SelectValueForShelfAlignment(
1780 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), 1780 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(),
1781 bounds.x() - coordinate.x()); 1781 bounds.x() - coordinate.x());
1782 return distance > 0 ? distance : 0; 1782 return distance > 0 ? distance : 0;
1783 } 1783 }
1784 1784
1785 } // namespace ash 1785 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_view.h ('k') | ash/common/shelf/shelf_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698