OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
7 | 7 |
8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
9 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
10 #include "chrome/common/notification_observer.h" | 10 #include "chrome/common/notification_observer.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 } | 43 } |
44 | 44 |
45 ExtensionList::iterator begin() { | 45 ExtensionList::iterator begin() { |
46 return toolitems_.begin(); | 46 return toolitems_.begin(); |
47 } | 47 } |
48 | 48 |
49 ExtensionList::iterator end() { | 49 ExtensionList::iterator end() { |
50 return toolitems_.end(); | 50 return toolitems_.end(); |
51 } | 51 } |
52 | 52 |
| 53 // Utility functions for converting between an index into the list of |
| 54 // incognito-enabled browser actions, and the list of all browser actions. |
| 55 int IncognitoIndexToOriginal(int incognito_index); |
| 56 int OriginalIndexToIncognito(int original_index); |
| 57 |
53 private: | 58 private: |
54 // NotificationObserver implementation. | 59 // NotificationObserver implementation. |
55 virtual void Observe(NotificationType type, | 60 virtual void Observe(NotificationType type, |
56 const NotificationSource& source, | 61 const NotificationSource& source, |
57 const NotificationDetails& details); | 62 const NotificationDetails& details); |
58 | 63 |
59 // To be called after the extension service is ready; gets loaded extensions | 64 // To be called after the extension service is ready; gets loaded extensions |
60 // from the extension service and their saved order from the pref service | 65 // from the extension service and their saved order from the pref service |
61 // and constructs |toolitems_| from these data. | 66 // and constructs |toolitems_| from these data. |
62 void InitializeExtensionList(); | 67 void InitializeExtensionList(); |
(...skipping 16 matching lines...) Expand all Loading... |
79 // Keeps track of what the last extension to get disabled was. | 84 // Keeps track of what the last extension to get disabled was. |
80 std::string last_extension_removed_; | 85 std::string last_extension_removed_; |
81 | 86 |
82 // Keeps track of where the last extension to get disabled was in the list. | 87 // Keeps track of where the last extension to get disabled was in the list. |
83 size_t last_extension_removed_index_; | 88 size_t last_extension_removed_index_; |
84 | 89 |
85 NotificationRegistrar registrar_; | 90 NotificationRegistrar registrar_; |
86 }; | 91 }; |
87 | 92 |
88 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 93 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
OLD | NEW |