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

Side by Side Diff: ui/app_list/app_list_folder_item.cc

Issue 148403007: Protect AppListItemList Add/Remove and fix sync bugs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/app_list_folder_item.h" 5 #include "ui/app_list/app_list_folder_item.h"
6 6
7 #include "base/guid.h"
7 #include "ui/app_list/app_list_constants.h" 8 #include "ui/app_list/app_list_constants.h"
8 #include "ui/app_list/app_list_item_list.h" 9 #include "ui/app_list/app_list_item_list.h"
9 #include "ui/gfx/canvas.h" 10 #include "ui/gfx/canvas.h"
10 #include "ui/gfx/image/canvas_image_source.h" 11 #include "ui/gfx/image/canvas_image_source.h"
11 #include "ui/gfx/image/image_skia_operations.h" 12 #include "ui/gfx/image/image_skia_operations.h"
12 13
13 namespace app_list { 14 namespace app_list {
14 15
15 namespace { 16 namespace {
16 17
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 top_icon_bounds.push_back(bottom_left); 138 top_icon_bounds.push_back(bottom_left);
138 139
139 // Get the bottom right icon bounds. 140 // Get the bottom right icon bounds.
140 gfx::Rect bottom_right( 141 gfx::Rect bottom_right(
141 right_x, bottom_y, kItemIconDimension, kItemIconDimension); 142 right_x, bottom_y, kItemIconDimension, kItemIconDimension);
142 top_icon_bounds.push_back(bottom_right); 143 top_icon_bounds.push_back(bottom_right);
143 144
144 return top_icon_bounds; 145 return top_icon_bounds;
145 } 146 }
146 147
148 std::string AppListFolderItem::GenerateId() {
149 return base::GenerateGUID();
150 }
151
147 const char* AppListFolderItem::GetItemType() const { 152 const char* AppListFolderItem::GetItemType() const {
148 return AppListFolderItem::kItemType; 153 return AppListFolderItem::kItemType;
149 } 154 }
150 155
151 ui::MenuModel* AppListFolderItem::GetContextMenuModel() { 156 ui::MenuModel* AppListFolderItem::GetContextMenuModel() {
152 // TODO(stevenjb/jennyz): Implement. 157 // TODO(stevenjb/jennyz): Implement.
153 return NULL; 158 return NULL;
154 } 159 }
155 160
156 void AppListFolderItem::ItemIconChanged() { 161 void AppListFolderItem::ItemIconChanged() {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 for (size_t i = 0; 201 for (size_t i = 0;
197 i < kNumFolderTopItems && i < item_list_->item_count(); ++i) { 202 i < kNumFolderTopItems && i < item_list_->item_count(); ++i) {
198 AppListItem* item = item_list_->item_at(i); 203 AppListItem* item = item_list_->item_at(i);
199 item->AddObserver(this); 204 item->AddObserver(this);
200 top_items_.push_back(item); 205 top_items_.push_back(item);
201 } 206 }
202 UpdateIcon(); 207 UpdateIcon();
203 } 208 }
204 209
205 } // namespace app_list 210 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698