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

Side by Side Diff: chrome/browser/extensions/api/alarms/alarms_api.cc

Issue 10553018: ContentSettings now uses the JSON Schema Compiler. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: incognito fix Created 8 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/content_settings/content_settings_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/alarms/alarms_api.h" 5 #include "chrome/browser/extensions/api/alarms/alarms_api.h"
6 6
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/api/alarms/alarm_manager.h" 9 #include "chrome/browser/extensions/api/alarms/alarm_manager.h"
10 #include "chrome/browser/extensions/extension_system.h" 10 #include "chrome/browser/extensions/extension_system.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 GetExtension()->location() == Extension::LOAD ? 112 GetExtension()->location() == Extension::LOAD ?
113 kDevDelayMinimum : kReleaseDelayMinimum), 113 kDevDelayMinimum : kReleaseDelayMinimum),
114 now_); 114 now_);
115 ExtensionSystem::Get(profile())->alarm_manager()->AddAlarm( 115 ExtensionSystem::Get(profile())->alarm_manager()->AddAlarm(
116 extension_id(), alarm); 116 extension_id(), alarm);
117 117
118 return true; 118 return true;
119 } 119 }
120 120
121 bool AlarmsGetFunction::RunImpl() { 121 bool AlarmsGetFunction::RunImpl() {
122 scoped_ptr<alarms::Get::Params> params( 122 scoped_ptr<alarms::Get::Params> params(alarms::Get::Params::Create(*args_));
123 alarms::Get::Params::Create(*args_));
124 EXTENSION_FUNCTION_VALIDATE(params.get()); 123 EXTENSION_FUNCTION_VALIDATE(params.get());
125 124
126 std::string name = params->name.get() ? *params->name : kDefaultAlarmName; 125 std::string name = params->name.get() ? *params->name : kDefaultAlarmName;
127 const Alarm* alarm = 126 const Alarm* alarm =
128 ExtensionSystem::Get(profile())->alarm_manager()->GetAlarm( 127 ExtensionSystem::Get(profile())->alarm_manager()->GetAlarm(
129 extension_id(), name); 128 extension_id(), name);
130 129
131 if (!alarm) { 130 if (!alarm) {
132 error_ = ExtensionErrorUtils::FormatErrorMessage(kAlarmNotFound, name); 131 error_ = ExtensionErrorUtils::FormatErrorMessage(kAlarmNotFound, name);
133 return false; 132 return false;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 return true; 170 return true;
172 } 171 }
173 172
174 bool AlarmsClearAllFunction::RunImpl() { 173 bool AlarmsClearAllFunction::RunImpl() {
175 ExtensionSystem::Get(profile())->alarm_manager()->RemoveAllAlarms( 174 ExtensionSystem::Get(profile())->alarm_manager()->RemoveAllAlarms(
176 extension_id()); 175 extension_id());
177 return true; 176 return true;
178 } 177 }
179 178
180 } // namespace extensions 179 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/content_settings/content_settings_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698