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

Side by Side Diff: chrome/browser/extensions/extension_toolbar_model.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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/extensions/extension_toolbar_model.h" 5 #include "chrome/browser/extensions/extension_toolbar_model.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" 8 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
9 #include "chrome/browser/extensions/browser_event_router.h" 9 #include "chrome/browser/extensions/browser_event_router.h"
10 #include "chrome/browser/extensions/extension_action.h" 10 #include "chrome/browser/extensions/extension_action.h"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 sorted.resize(positions.size(), NULL); 327 sorted.resize(positions.size(), NULL);
328 // The items that don't have explicit positions. 328 // The items that don't have explicit positions.
329 ExtensionList unsorted; 329 ExtensionList unsorted;
330 330
331 extensions::ExtensionActionManager* extension_action_manager = 331 extensions::ExtensionActionManager* extension_action_manager =
332 extensions::ExtensionActionManager::Get(service_->profile()); 332 extensions::ExtensionActionManager::Get(service_->profile());
333 333
334 // Create the lists. 334 // Create the lists.
335 for (ExtensionSet::const_iterator it = service_->extensions()->begin(); 335 for (ExtensionSet::const_iterator it = service_->extensions()->begin();
336 it != service_->extensions()->end(); ++it) { 336 it != service_->extensions()->end(); ++it) {
337 const Extension* extension = *it; 337 const Extension* extension = it->get();
338 if (!extension_action_manager->GetBrowserAction(*extension)) 338 if (!extension_action_manager->GetBrowserAction(*extension))
339 continue; 339 continue;
340 if (!extensions::ExtensionActionAPI::GetBrowserActionVisibility( 340 if (!extensions::ExtensionActionAPI::GetBrowserActionVisibility(
341 service_->extension_prefs(), extension->id())) { 341 service_->extension_prefs(), extension->id())) {
342 continue; 342 continue;
343 } 343 }
344 344
345 extensions::ExtensionIdList::const_iterator pos = 345 extensions::ExtensionIdList::const_iterator pos =
346 std::find(positions.begin(), positions.end(), extension->id()); 346 std::find(positions.begin(), positions.end(), extension->id());
347 if (pos != positions.end()) 347 if (pos != positions.end())
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 452
453 if (last_known_positions_.size() > pref_position_size) { 453 if (last_known_positions_.size() > pref_position_size) {
454 // Need to update pref because we have extra icons. But can't call 454 // Need to update pref because we have extra icons. But can't call
455 // UpdatePrefs() directly within observation closure. 455 // UpdatePrefs() directly within observation closure.
456 base::MessageLoop::current()->PostTask( 456 base::MessageLoop::current()->PostTask(
457 FROM_HERE, 457 FROM_HERE,
458 base::Bind(&ExtensionToolbarModel::UpdatePrefs, 458 base::Bind(&ExtensionToolbarModel::UpdatePrefs,
459 weak_ptr_factory_.GetWeakPtr())); 459 weak_ptr_factory_.GetWeakPtr()));
460 } 460 }
461 } 461 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_sync_bundle.cc ('k') | chrome/browser/extensions/installed_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698