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

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

Issue 505913002: Remove implicit conversions from scoped_refptr to T* in chrome/browser/ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 base::Unretained(this))); 97 base::Unretained(this)));
98 } 98 }
99 99
100 void ExtensionAppModelBuilder::OnProfilePreferenceChanged() { 100 void ExtensionAppModelBuilder::OnProfilePreferenceChanged() {
101 extensions::ExtensionSet extensions; 101 extensions::ExtensionSet extensions;
102 controller_->GetApps(profile_, &extensions); 102 controller_->GetApps(profile_, &extensions);
103 103
104 for (extensions::ExtensionSet::const_iterator app = extensions.begin(); 104 for (extensions::ExtensionSet::const_iterator app = extensions.begin();
105 app != extensions.end(); ++app) { 105 app != extensions.end(); ++app) {
106 bool should_display = 106 bool should_display =
107 extensions::ui_util::ShouldDisplayInAppLauncher(*app, profile_); 107 extensions::ui_util::ShouldDisplayInAppLauncher(app->get(), profile_);
108 bool does_display = GetExtensionAppItem((*app)->id()) != NULL; 108 bool does_display = GetExtensionAppItem((*app)->id()) != NULL;
109 109
110 if (should_display == does_display) 110 if (should_display == does_display)
111 continue; 111 continue;
112 112
113 if (should_display) { 113 if (should_display) {
114 InsertApp(CreateAppItem((*app)->id(), 114 InsertApp(CreateAppItem((*app)->id(),
115 "", 115 "",
116 gfx::ImageSkia(), 116 gfx::ImageSkia(),
117 (*app)->is_platform_app())); 117 (*app)->is_platform_app()));
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 if (extension_registry_) 278 if (extension_registry_)
279 extension_registry_->AddObserver(this); 279 extension_registry_->AddObserver(this);
280 } 280 }
281 281
282 void ExtensionAppModelBuilder::PopulateApps() { 282 void ExtensionAppModelBuilder::PopulateApps() {
283 extensions::ExtensionSet extensions; 283 extensions::ExtensionSet extensions;
284 controller_->GetApps(profile_, &extensions); 284 controller_->GetApps(profile_, &extensions);
285 285
286 for (extensions::ExtensionSet::const_iterator app = extensions.begin(); 286 for (extensions::ExtensionSet::const_iterator app = extensions.begin();
287 app != extensions.end(); ++app) { 287 app != extensions.end(); ++app) {
288 if (!extensions::ui_util::ShouldDisplayInAppLauncher(*app, profile_)) 288 if (!extensions::ui_util::ShouldDisplayInAppLauncher(app->get(), profile_))
289 continue; 289 continue;
290 InsertApp(CreateAppItem((*app)->id(), 290 InsertApp(CreateAppItem((*app)->id(),
291 "", 291 "",
292 gfx::ImageSkia(), 292 gfx::ImageSkia(),
293 (*app)->is_platform_app())); 293 (*app)->is_platform_app()));
294 } 294 }
295 } 295 }
296 296
297 void ExtensionAppModelBuilder::InsertApp(scoped_ptr<ExtensionAppItem> app) { 297 void ExtensionAppModelBuilder::InsertApp(scoped_ptr<ExtensionAppItem> app) {
298 if (service_) { 298 if (service_) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 app_list::AppListItem* item = item_list->item_at(idx + 1); 361 app_list::AppListItem* item = item_list->item_at(idx + 1);
362 if (item->GetItemType() == ExtensionAppItem::kItemType) { 362 if (item->GetItemType() == ExtensionAppItem::kItemType) {
363 next = static_cast<ExtensionAppItem*>(item); 363 next = static_cast<ExtensionAppItem*>(item);
364 break; 364 break;
365 } 365 }
366 } 366 }
367 // item->Move will call set_position, overriding the item's position. 367 // item->Move will call set_position, overriding the item's position.
368 if (prev || next) 368 if (prev || next)
369 static_cast<ExtensionAppItem*>(item)->Move(prev, next); 369 static_cast<ExtensionAppItem*>(item)->Move(prev, next);
370 } 370 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/recommended_apps.cc » ('j') | chrome/browser/ui/bookmarks/bookmark_utils.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698