| OLD | NEW |
| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 // Items that have explicit positions. | 329 // Items that have explicit positions. |
| 330 ExtensionList sorted; | 330 ExtensionList sorted; |
| 331 sorted.resize(positions.size(), NULL); | 331 sorted.resize(positions.size(), NULL); |
| 332 // The items that don't have explicit positions. | 332 // The items that don't have explicit positions. |
| 333 ExtensionList unsorted; | 333 ExtensionList unsorted; |
| 334 | 334 |
| 335 extensions::ExtensionActionManager* extension_action_manager = | 335 extensions::ExtensionActionManager* extension_action_manager = |
| 336 extensions::ExtensionActionManager::Get(profile_); | 336 extensions::ExtensionActionManager::Get(profile_); |
| 337 | 337 |
| 338 // Create the lists. | 338 // Create the lists. |
| 339 for (ExtensionSet::const_iterator it = service->extensions()->begin(); | 339 for (extensions::ExtensionSet::const_iterator it = |
| 340 service->extensions()->begin(); |
| 340 it != service->extensions()->end(); ++it) { | 341 it != service->extensions()->end(); ++it) { |
| 341 const Extension* extension = it->get(); | 342 const Extension* extension = it->get(); |
| 342 if (!extension_action_manager->GetBrowserAction(*extension)) | 343 if (!extension_action_manager->GetBrowserAction(*extension)) |
| 343 continue; | 344 continue; |
| 344 if (!extensions::ExtensionActionAPI::GetBrowserActionVisibility( | 345 if (!extensions::ExtensionActionAPI::GetBrowserActionVisibility( |
| 345 extension_prefs_, extension->id())) { | 346 extension_prefs_, extension->id())) { |
| 346 continue; | 347 continue; |
| 347 } | 348 } |
| 348 | 349 |
| 349 extensions::ExtensionIdList::const_iterator pos = | 350 extensions::ExtensionIdList::const_iterator pos = |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 const extensions::Extension* extension) { | 462 const extensions::Extension* extension) { |
| 462 ObserverListBase<Observer>::Iterator it(observers_); | 463 ObserverListBase<Observer>::Iterator it(observers_); |
| 463 Observer* obs = NULL; | 464 Observer* obs = NULL; |
| 464 while ((obs = it.GetNext()) != NULL) { | 465 while ((obs = it.GetNext()) != NULL) { |
| 465 // Stop after first popup since it should only show in the active window. | 466 // Stop after first popup since it should only show in the active window. |
| 466 if (obs->BrowserActionShowPopup(extension)) | 467 if (obs->BrowserActionShowPopup(extension)) |
| 467 return true; | 468 return true; |
| 468 } | 469 } |
| 469 return false; | 470 return false; |
| 470 } | 471 } |
| OLD | NEW |