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

Side by Side Diff: ui/app_list/folder_image.h

Issue 953743003: FolderImage: Const correctness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | ui/app_list/folder_image.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 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 #ifndef UI_APP_LIST_FOLDER_IMAGE_H_ 5 #ifndef UI_APP_LIST_FOLDER_IMAGE_H_
6 #define UI_APP_LIST_FOLDER_IMAGE_H_ 6 #define UI_APP_LIST_FOLDER_IMAGE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 29 matching lines...) Expand all
40 explicit FolderImage(AppListItemList* item_list); 40 explicit FolderImage(AppListItemList* item_list);
41 ~FolderImage() override; 41 ~FolderImage() override;
42 42
43 // Generates the folder's icon from the icons of the items in the item list, 43 // Generates the folder's icon from the icons of the items in the item list,
44 // and notifies observers that the icon has changed. 44 // and notifies observers that the icon has changed.
45 void UpdateIcon(); 45 void UpdateIcon();
46 46
47 const gfx::ImageSkia& icon() const { return icon_; } 47 const gfx::ImageSkia& icon() const { return icon_; }
48 48
49 // Returns the icon of one of the top items with |item_index|. 49 // Returns the icon of one of the top items with |item_index|.
50 const gfx::ImageSkia& GetTopIcon(size_t item_index); 50 const gfx::ImageSkia& GetTopIcon(size_t item_index) const;
51 51
52 // Calculates the top item icons' bounds inside |folder_icon_bounds|. 52 // Calculates the top item icons' bounds inside |folder_icon_bounds|.
53 // Returns the bounds of top item icons in sequence of top left, top right, 53 // Returns the bounds of top item icons in sequence of top left, top right,
54 // bottom left, bottom right. 54 // bottom left, bottom right.
55 static std::vector<gfx::Rect> GetTopIconsBounds( 55 static std::vector<gfx::Rect> GetTopIconsBounds(
56 const gfx::Rect& folder_icon_bounds); 56 const gfx::Rect& folder_icon_bounds);
57 57
58 // Returns the target icon bounds for |item| to fly back to its parent folder 58 // Returns the target icon bounds for |item| to fly back to its parent folder
59 // icon in animation UI. If |item| is one of the top item icon, this will 59 // icon in animation UI. If |item| is one of the top item icon, this will
60 // match its corresponding top item icon in the folder icon. Otherwise, 60 // match its corresponding top item icon in the folder icon. Otherwise,
61 // the target icon bounds is centered at the |folder_icon_bounds| with 61 // the target icon bounds is centered at the |folder_icon_bounds| with
62 // the same size of the top item icon. 62 // the same size of the top item icon.
63 // The Rect returned is in the same coordinates of |folder_icon_bounds|. 63 // The Rect returned is in the same coordinates of |folder_icon_bounds|.
64 gfx::Rect GetTargetIconRectInFolderForItem( 64 gfx::Rect GetTargetIconRectInFolderForItem(
65 AppListItem* item, 65 AppListItem* item,
66 const gfx::Rect& folder_icon_bounds); 66 const gfx::Rect& folder_icon_bounds) const;
67 67
68 void AddObserver(FolderImageObserver* observer); 68 void AddObserver(FolderImageObserver* observer);
69 void RemoveObserver(FolderImageObserver* observer); 69 void RemoveObserver(FolderImageObserver* observer);
70 70
71 // AppListItemObserver overrides: 71 // AppListItemObserver overrides:
72 void ItemIconChanged() override; 72 void ItemIconChanged() override;
73 73
74 // AppListItemListObserver overrides: 74 // AppListItemListObserver overrides:
75 void OnListItemAdded(size_t index, AppListItem* item) override; 75 void OnListItemAdded(size_t index, AppListItem* item) override;
76 void OnListItemRemoved(size_t index, AppListItem* item) override; 76 void OnListItemRemoved(size_t index, AppListItem* item) override;
(...skipping 15 matching lines...) Expand all
92 92
93 // Top items for generating folder icon. 93 // Top items for generating folder icon.
94 std::vector<AppListItem*> top_items_; 94 std::vector<AppListItem*> top_items_;
95 95
96 ObserverList<FolderImageObserver> observers_; 96 ObserverList<FolderImageObserver> observers_;
97 }; 97 };
98 98
99 } // namespace app_list 99 } // namespace app_list
100 100
101 #endif // UI_APP_LIST_FOLDER_IMAGE_H_ 101 #endif // UI_APP_LIST_FOLDER_IMAGE_H_
OLDNEW
« no previous file with comments | « no previous file | ui/app_list/folder_image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698