| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/extensions/extension_prefs.h" | 7 #include "chrome/browser/extensions/extension_prefs.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/common/chrome_notification_types.h" | 11 #include "chrome/common/chrome_notification_types.h" |
| 12 #include "chrome/common/extensions/extension.h" | 12 #include "chrome/common/extensions/extension.h" |
| 13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 14 #include "content/common/notification_service.h" | 14 #include "content/public/browser/notification_details.h" |
| 15 #include "content/public/browser/notification_source.h" |
| 15 | 16 |
| 16 ExtensionToolbarModel::ExtensionToolbarModel(ExtensionService* service) | 17 ExtensionToolbarModel::ExtensionToolbarModel(ExtensionService* service) |
| 17 : service_(service), | 18 : service_(service), |
| 18 prefs_(service->profile()->GetPrefs()), | 19 prefs_(service->profile()->GetPrefs()), |
| 19 extensions_initialized_(false) { | 20 extensions_initialized_(false) { |
| 20 DCHECK(service_); | 21 DCHECK(service_); |
| 21 | 22 |
| 22 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 23 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
| 23 content::Source<Profile>(service_->profile())); | 24 content::Source<Profile>(service_->profile())); |
| 24 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 25 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 int incognito_index = 0, i = 0; | 251 int incognito_index = 0, i = 0; |
| 251 for (ExtensionList::iterator iter = begin(); iter != end(); | 252 for (ExtensionList::iterator iter = begin(); iter != end(); |
| 252 ++iter, ++i) { | 253 ++iter, ++i) { |
| 253 if (original_index == i) | 254 if (original_index == i) |
| 254 break; | 255 break; |
| 255 if (service_->IsIncognitoEnabled((*iter)->id())) | 256 if (service_->IsIncognitoEnabled((*iter)->id())) |
| 256 ++incognito_index; | 257 ++incognito_index; |
| 257 } | 258 } |
| 258 return incognito_index; | 259 return incognito_index; |
| 259 } | 260 } |
| OLD | NEW |