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

Side by Side Diff: extensions/browser/event_router.cc

Issue 2037703004: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 "extensions/browser/event_router.h" 5 #include "extensions/browser/event_router.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <tuple> 9 #include <tuple>
10 #include <utility> 10 #include <utility>
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 events.insert(event); 399 events.insert(event);
400 } 400 }
401 return events; 401 return events;
402 } 402 }
403 403
404 void EventRouter::SetRegisteredEvents(const std::string& extension_id, 404 void EventRouter::SetRegisteredEvents(const std::string& extension_id,
405 const std::set<std::string>& events) { 405 const std::set<std::string>& events) {
406 ListValue* events_value = new ListValue; 406 ListValue* events_value = new ListValue;
407 for (std::set<std::string>::const_iterator iter = events.begin(); 407 for (std::set<std::string>::const_iterator iter = events.begin();
408 iter != events.end(); ++iter) { 408 iter != events.end(); ++iter) {
409 events_value->Append(new base::StringValue(*iter)); 409 events_value->AppendString(*iter);
410 } 410 }
411 extension_prefs_->UpdateExtensionPref( 411 extension_prefs_->UpdateExtensionPref(
412 extension_id, kRegisteredEvents, events_value); 412 extension_id, kRegisteredEvents, events_value);
413 } 413 }
414 414
415 void EventRouter::AddFilterToEvent(const std::string& event_name, 415 void EventRouter::AddFilterToEvent(const std::string& event_name,
416 const std::string& extension_id, 416 const std::string& extension_id,
417 const DictionaryValue* filter) { 417 const DictionaryValue* filter) {
418 ExtensionPrefs::ScopedDictionaryUpdate update( 418 ExtensionPrefs::ScopedDictionaryUpdate update(
419 extension_prefs_, extension_id, kFilteredEvents); 419 extension_prefs_, extension_id, kFilteredEvents);
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 const std::string& extension_id, 906 const std::string& extension_id,
907 const GURL& listener_url, 907 const GURL& listener_url,
908 content::BrowserContext* browser_context) 908 content::BrowserContext* browser_context)
909 : event_name(event_name), 909 : event_name(event_name),
910 extension_id(extension_id), 910 extension_id(extension_id),
911 listener_url(listener_url), 911 listener_url(listener_url),
912 browser_context(browser_context) { 912 browser_context(browser_context) {
913 } 913 }
914 914
915 } // namespace extensions 915 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/web_request/web_request_api_helpers.cc ('k') | extensions/browser/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698