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

Side by Side Diff: chrome/browser/ui/app_list/apps_model_builder.cc

Issue 25859005: Elim ActivateAppListItem, ChromeAppListItem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile fixes Created 7 years, 2 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 (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 "chrome/browser/ui/app_list/apps_model_builder.h" 5 #include "chrome/browser/ui/app_list/apps_model_builder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 int index = FindApp(highlight_app_id_); 301 int index = FindApp(highlight_app_id_);
302 if (index == -1) 302 if (index == -1)
303 return; 303 return;
304 304
305 model_->GetItemAt(index)->SetHighlighted(true); 305 model_->GetItemAt(index)->SetHighlighted(true);
306 highlighted_app_pending_ = false; 306 highlighted_app_pending_ = false;
307 } 307 }
308 308
309 ExtensionAppItem* AppsModelBuilder::GetAppAt(size_t index) { 309 ExtensionAppItem* AppsModelBuilder::GetAppAt(size_t index) {
310 DCHECK_LT(index, model_->item_count()); 310 DCHECK_LT(index, model_->item_count());
311 ChromeAppListItem* item = 311 return static_cast<ExtensionAppItem*>(model_->GetItemAt(index));
312 static_cast<ChromeAppListItem*>(model_->GetItemAt(index));
313 DCHECK_EQ(item->type(), ChromeAppListItem::TYPE_APP);
314
315 return static_cast<ExtensionAppItem*>(item);
316 } 312 }
317 313
318 void AppsModelBuilder::ListItemsAdded(size_t start, size_t count) { 314 void AppsModelBuilder::ListItemsAdded(size_t start, size_t count) {
319 } 315 }
320 316
321 void AppsModelBuilder::ListItemsRemoved(size_t start, size_t count) { 317 void AppsModelBuilder::ListItemsRemoved(size_t start, size_t count) {
322 } 318 }
323 319
324 void AppsModelBuilder::ListItemMoved(size_t index, size_t target_index) { 320 void AppsModelBuilder::ListItemMoved(size_t index, size_t target_index) {
325 if (ignore_changes_) 321 if (ignore_changes_)
326 return; 322 return;
327 323
328 ExtensionAppItem* prev = target_index > 0 ? GetAppAt(target_index - 1) : NULL; 324 ExtensionAppItem* prev = target_index > 0 ? GetAppAt(target_index - 1) : NULL;
329 ExtensionAppItem* next = target_index + 1 < model_->item_count() ? 325 ExtensionAppItem* next = target_index + 1 < model_->item_count() ?
330 GetAppAt(target_index + 1) : NULL; 326 GetAppAt(target_index + 1) : NULL;
331 GetAppAt(target_index)->Move(prev, next); 327 GetAppAt(target_index)->Move(prev, next);
332 } 328 }
333 329
334 void AppsModelBuilder::ListItemsChanged(size_t start, size_t count) { 330 void AppsModelBuilder::ListItemsChanged(size_t start, size_t count) {
335 NOTREACHED(); 331 NOTREACHED();
336 } 332 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_view_delegate.cc ('k') | chrome/browser/ui/app_list/chrome_app_list_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698