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

Side by Side Diff: chrome/browser/extensions/api/declarative/declarative_api.cc

Issue 10977073: Delete some unused code found by -Wunused-function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: leiz Created 8 years, 2 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) 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/api/declarative/declarative_api.h" 5 #include "chrome/browser/extensions/api/declarative/declarative_api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/task_runner_util.h" 9 #include "base/task_runner_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "chrome/browser/extensions/api/declarative/rules_registry_service.h" 11 #include "chrome/browser/extensions/api/declarative/rules_registry_service.h"
12 #include "chrome/browser/extensions/extension_system_factory.h" 12 #include "chrome/browser/extensions/extension_system_factory.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/common/extensions/api/events.h" 14 #include "chrome/common/extensions/api/events.h"
15 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
16 16
17 using extensions::api::events::Rule; 17 using extensions::api::events::Rule;
18 18
19 namespace AddRules = extensions::api::events::Event::AddRules; 19 namespace AddRules = extensions::api::events::Event::AddRules;
20 namespace GetRules = extensions::api::events::Event::GetRules; 20 namespace GetRules = extensions::api::events::Event::GetRules;
21 namespace RemoveRules = extensions::api::events::Event::RemoveRules; 21 namespace RemoveRules = extensions::api::events::Event::RemoveRules;
22 22
23 namespace {
24
25 // Adds all entries from |list| to |out|. Assumes that all entries of |list|
26 // are strings. Returns true if successful.
27 bool AddAllStringValues(ListValue* list, std::vector<std::string>* out) {
28 for (ListValue::iterator i = list->begin(); i != list->end(); ++i) {
29 std::string value;
30 if (!(*i)->GetAsString(&value))
31 return false;
32 out->push_back(value);
33 }
34 return true;
35 }
36
37 } // namespace
38
39 namespace extensions { 23 namespace extensions {
40 24
41 RulesFunction::RulesFunction() : rules_registry_(NULL) {} 25 RulesFunction::RulesFunction() : rules_registry_(NULL) {}
42 26
43 RulesFunction::~RulesFunction() {} 27 RulesFunction::~RulesFunction() {}
44 28
45 bool RulesFunction::HasPermission() { 29 bool RulesFunction::HasPermission() {
46 std::string event_name; 30 std::string event_name;
47 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &event_name)); 31 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &event_name));
48 return extension_->HasAPIPermission(event_name); 32 return extension_->HasAPIPermission(event_name);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 error_ = rules_registry_->GetAllRules(extension_id(), &rules); 100 error_ = rules_registry_->GetAllRules(extension_id(), &rules);
117 } 101 }
118 102
119 if (error_.empty()) 103 if (error_.empty())
120 results_ = GetRules::Results::Create(rules); 104 results_ = GetRules::Results::Create(rules);
121 105
122 return error_.empty(); 106 return error_.empty();
123 } 107 }
124 108
125 } // namespace extensions 109 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698