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

Side by Side Diff: chrome/browser/extensions/menu_manager.cc

Issue 10809094: Context Menus now uses the JSON Schema Compiler. (Closed) Base URL: http://git.chromium.org/chromium/src.git@json_functions_as_properties
Patch Set: adjust to new json_function_as_parameters mods Created 8 years, 5 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
OLDNEW
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/menu_manager.h" 5 #include "chrome/browser/extensions/menu_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 if (!properties.GetList(target_url_patterns_key, &list)) 261 if (!properties.GetList(target_url_patterns_key, &list))
262 return false; 262 return false;
263 if (!target_url_patterns_.Populate( 263 if (!target_url_patterns_.Populate(
264 *list, URLPattern::SCHEME_ALL, true, error)) { 264 *list, URLPattern::SCHEME_ALL, true, error)) {
265 return false; 265 return false;
266 } 266 }
267 } 267 }
268 return true; 268 return true;
269 } 269 }
270 270
271 bool MenuItem::PopulateURLPatterns(ListValue* document_url_patterns,
272 ListValue* target_url_patterns,
273 std::string* error) {
not at google - send to devlin 2012/07/26 04:16:20 When you convert these to taking vectors, you coul
chebert 2012/07/27 01:28:24 Done.
274 if (document_url_patterns) {
275 if (!document_url_patterns_.Populate(
276 *document_url_patterns, URLPattern::SCHEME_ALL, true, error)) {
277 return false;
278 }
279 }
280 if (target_url_patterns) {
281 if (!target_url_patterns_.Populate(
282 *target_url_patterns, URLPattern::SCHEME_ALL, true, error)) {
283 return false;
284 }
285 }
286 return true;
287 }
288
271 MenuManager::MenuManager(Profile* profile) 289 MenuManager::MenuManager(Profile* profile)
272 : profile_(profile) { 290 : profile_(profile) {
273 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 291 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
274 content::Source<Profile>(profile)); 292 content::Source<Profile>(profile));
275 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 293 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
276 content::Source<Profile>(profile)); 294 content::Source<Profile>(profile));
277 295
278 StateStore* store = ExtensionSystem::Get(profile_)->state_store(); 296 StateStore* store = ExtensionSystem::Get(profile_)->state_store();
279 if (store) 297 if (store)
280 store->RegisterKey(kContextMenusKey); 298 store->RegisterKey(kContextMenusKey);
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 if (uid < other.uid) 835 if (uid < other.uid)
818 return true; 836 return true;
819 if (uid == other.uid) 837 if (uid == other.uid)
820 return string_uid < other.string_uid; 838 return string_uid < other.string_uid;
821 } 839 }
822 } 840 }
823 return false; 841 return false;
824 } 842 }
825 843
826 } // namespace extensions 844 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698