Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: chrome/browser/extensions/extension_menu_manager.h

Issue 3035053: Merge 54514 - Set a max limit on extension items' labels in context menus.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/479/src/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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|. 123 // Returns the title with any instances of %s replaced by |selection|. The
124 string16 TitleWithReplacement(const string16& selection) const; 124 // result will be no longer than |max_length|.
125 string16 TitleWithReplacement(const string16& selection,
126 size_t max_length) const;
125 127
126 // Set the checked state to |checked|. Returns true if successful. 128 // Set the checked state to |checked|. Returns true if successful.
127 bool SetChecked(bool checked); 129 bool SetChecked(bool checked);
128 130
129 protected: 131 protected:
130 friend class ExtensionMenuManager; 132 friend class ExtensionMenuManager;
131 133
132 // Takes ownership of |item| and sets its parent_id_. 134 // Takes ownership of |item| and sets its parent_id_.
133 void AddChild(ExtensionMenuItem* item); 135 void AddChild(ExtensionMenuItem* item);
134 136
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 std::map<ExtensionMenuItem::Id, ExtensionMenuItem*> items_by_id_; 265 std::map<ExtensionMenuItem::Id, ExtensionMenuItem*> items_by_id_;
264 266
265 NotificationRegistrar registrar_; 267 NotificationRegistrar registrar_;
266 268
267 ExtensionIconManager icon_manager_; 269 ExtensionIconManager icon_manager_;
268 270
269 DISALLOW_COPY_AND_ASSIGN(ExtensionMenuManager); 271 DISALLOW_COPY_AND_ASSIGN(ExtensionMenuManager);
270 }; 272 };
271 273
272 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_ 274 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MENU_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_function_dispatcher.cc ('k') | chrome/browser/extensions/extension_menu_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698