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

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

Issue 657333002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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/extension_app_model_builder.h" 5 #include "chrome/browser/ui/app_list/extension_app_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/bind.h" 10 #include "base/bind.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 continue; 278 continue;
279 InsertApp(CreateAppItem((*app)->id(), 279 InsertApp(CreateAppItem((*app)->id(),
280 "", 280 "",
281 gfx::ImageSkia(), 281 gfx::ImageSkia(),
282 (*app)->is_platform_app())); 282 (*app)->is_platform_app()));
283 } 283 }
284 } 284 }
285 285
286 void ExtensionAppModelBuilder::InsertApp(scoped_ptr<ExtensionAppItem> app) { 286 void ExtensionAppModelBuilder::InsertApp(scoped_ptr<ExtensionAppItem> app) {
287 if (service_) { 287 if (service_) {
288 service_->AddItem(app.PassAs<app_list::AppListItem>()); 288 service_->AddItem(app.Pass());
289 return; 289 return;
290 } 290 }
291 model_->AddItem(app.PassAs<app_list::AppListItem>()); 291 model_->AddItem(app.Pass());
292 } 292 }
293 293
294 ExtensionAppItem* ExtensionAppModelBuilder::GetExtensionAppItem( 294 ExtensionAppItem* ExtensionAppModelBuilder::GetExtensionAppItem(
295 const std::string& extension_id) { 295 const std::string& extension_id) {
296 app_list::AppListItem* item = model_->FindItem(extension_id); 296 app_list::AppListItem* item = model_->FindItem(extension_id);
297 LOG_IF(ERROR, item && 297 LOG_IF(ERROR, item &&
298 item->GetItemType() != ExtensionAppItem::kItemType) 298 item->GetItemType() != ExtensionAppItem::kItemType)
299 << "App Item matching id: " << extension_id 299 << "App Item matching id: " << extension_id
300 << " has incorrect type: '" << item->GetItemType() << "'"; 300 << " has incorrect type: '" << item->GetItemType() << "'";
301 return static_cast<ExtensionAppItem*>(item); 301 return static_cast<ExtensionAppItem*>(item);
(...skipping 23 matching lines...) Expand all
325 app_list::AppListItem* item = item_list->item_at(idx + 1); 325 app_list::AppListItem* item = item_list->item_at(idx + 1);
326 if (item->GetItemType() == ExtensionAppItem::kItemType) { 326 if (item->GetItemType() == ExtensionAppItem::kItemType) {
327 next = static_cast<ExtensionAppItem*>(item); 327 next = static_cast<ExtensionAppItem*>(item);
328 break; 328 break;
329 } 329 }
330 } 330 }
331 // item->Move will call set_position, overriding the item's position. 331 // item->Move will call set_position, overriding the item's position.
332 if (prev || next) 332 if (prev || next)
333 static_cast<ExtensionAppItem*>(item)->Move(prev, next); 333 static_cast<ExtensionAppItem*>(item)->Move(prev, next);
334 } 334 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_syncable_service.cc ('k') | chrome/browser/ui/app_list/search/app_search_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698