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 "chrome/browser/extensions/extension_browser_event_router.h" | 7 #include "chrome/browser/extensions/extension_browser_event_router.h" |
8 #include "chrome/browser/extensions/extension_prefs.h" | 8 #include "chrome/browser/extensions/extension_prefs.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_tab_helper.h" | 10 #include "chrome/browser/extensions/extension_tab_helper.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 DCHECK(service_); | 31 DCHECK(service_); |
32 | 32 |
33 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 33 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
34 content::Source<Profile>(service_->profile())); | 34 content::Source<Profile>(service_->profile())); |
35 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 35 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
36 content::Source<Profile>(service_->profile())); | 36 content::Source<Profile>(service_->profile())); |
37 registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, | 37 registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, |
38 content::Source<Profile>(service_->profile())); | 38 content::Source<Profile>(service_->profile())); |
39 registrar_.Add( | 39 registrar_.Add( |
40 this, chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED, | 40 this, chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED, |
41 content::Source<ExtensionPrefs>(service_->extension_prefs())); | 41 content::Source<extensions::ExtensionPrefs>(service_->extension_prefs())); |
42 | 42 |
43 visible_icon_count_ = prefs_->GetInteger(prefs::kExtensionToolbarSize); | 43 visible_icon_count_ = prefs_->GetInteger(prefs::kExtensionToolbarSize); |
44 } | 44 } |
45 | 45 |
46 ExtensionToolbarModel::~ExtensionToolbarModel() { | 46 ExtensionToolbarModel::~ExtensionToolbarModel() { |
47 } | 47 } |
48 | 48 |
49 void ExtensionToolbarModel::AddObserver(Observer* observer) { | 49 void ExtensionToolbarModel::AddObserver(Observer* observer) { |
50 observers_.AddObserver(observer); | 50 observers_.AddObserver(observer); |
51 } | 51 } |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 int incognito_index = 0, i = 0; | 289 int incognito_index = 0, i = 0; |
290 for (ExtensionList::iterator iter = begin(); iter != end(); | 290 for (ExtensionList::iterator iter = begin(); iter != end(); |
291 ++iter, ++i) { | 291 ++iter, ++i) { |
292 if (original_index == i) | 292 if (original_index == i) |
293 break; | 293 break; |
294 if (service_->IsIncognitoEnabled((*iter)->id())) | 294 if (service_->IsIncognitoEnabled((*iter)->id())) |
295 ++incognito_index; | 295 ++incognito_index; |
296 } | 296 } |
297 return incognito_index; | 297 return incognito_index; |
298 } | 298 } |
OLD | NEW |