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_MENU_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 void set_title(std::string new_title) { title_ = new_title; } | 113 void set_title(std::string new_title) { title_ = new_title; } |
114 void set_contexts(ContextList contexts) { contexts_ = contexts; } | 114 void set_contexts(ContextList contexts) { contexts_ = contexts; } |
115 void set_type(Type type) { type_ = type; } | 115 void set_type(Type type) { type_ = type; } |
116 void set_document_url_patterns(const ExtensionExtent& patterns) { | 116 void set_document_url_patterns(const ExtensionExtent& patterns) { |
117 document_url_patterns_ = patterns; | 117 document_url_patterns_ = patterns; |
118 } | 118 } |
119 void set_target_url_patterns(const ExtensionExtent& patterns) { | 119 void set_target_url_patterns(const ExtensionExtent& patterns) { |
120 target_url_patterns_ = patterns; | 120 target_url_patterns_ = patterns; |
121 } | 121 } |
122 | 122 |
123 // Returns the title with any instances of %s replaced by |selection|. The | 123 // Returns the title with any instances of %s replaced by |selection|. |
124 // result will be no longer than |max_length|. | 124 string16 TitleWithReplacement(const string16& selection) const; |
125 string16 TitleWithReplacement(const string16& selection, | |
126 size_t max_length) const; | |
127 | 125 |
128 // Set the checked state to |checked|. Returns true if successful. | 126 // Set the checked state to |checked|. Returns true if successful. |
129 bool SetChecked(bool checked); | 127 bool SetChecked(bool checked); |
130 | 128 |
131 protected: | 129 protected: |
132 friend class ExtensionMenuManager; | 130 friend class ExtensionMenuManager; |
133 | 131 |
134 // Takes ownership of |item| and sets its parent_id_. | 132 // Takes ownership of |item| and sets its parent_id_. |
135 void AddChild(ExtensionMenuItem* item); | 133 void AddChild(ExtensionMenuItem* item); |
136 | 134 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 std::map<ExtensionMenuItem::Id, ExtensionMenuItem*> items_by_id_; | 263 std::map<ExtensionMenuItem::Id, ExtensionMenuItem*> items_by_id_; |
266 | 264 |
267 NotificationRegistrar registrar_; | 265 NotificationRegistrar registrar_; |
268 | 266 |
269 ExtensionIconManager icon_manager_; | 267 ExtensionIconManager icon_manager_; |
270 | 268 |
271 DISALLOW_COPY_AND_ASSIGN(ExtensionMenuManager); | 269 DISALLOW_COPY_AND_ASSIGN(ExtensionMenuManager); |
272 }; | 270 }; |
273 | 271 |
274 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ | 272 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ |
OLD | NEW |