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

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

Issue 666153002: Standardize usage of virtual/override/final in chrome/browser/extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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/alarm_manager.h" 5 #include "chrome/browser/extensions/api/alarms/alarm_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 21 matching lines...) Expand all
32 32
33 // The minimum period between polling for alarms to run. 33 // The minimum period between polling for alarms to run.
34 const base::TimeDelta kDefaultMinPollPeriod() { 34 const base::TimeDelta kDefaultMinPollPeriod() {
35 return base::TimeDelta::FromDays(1); 35 return base::TimeDelta::FromDays(1);
36 } 36 }
37 37
38 class DefaultAlarmDelegate : public AlarmManager::Delegate { 38 class DefaultAlarmDelegate : public AlarmManager::Delegate {
39 public: 39 public:
40 explicit DefaultAlarmDelegate(content::BrowserContext* context) 40 explicit DefaultAlarmDelegate(content::BrowserContext* context)
41 : browser_context_(context) {} 41 : browser_context_(context) {}
42 virtual ~DefaultAlarmDelegate() {} 42 ~DefaultAlarmDelegate() override {}
43 43
44 virtual void OnAlarm(const std::string& extension_id, 44 void OnAlarm(const std::string& extension_id, const Alarm& alarm) override {
45 const Alarm& alarm) override {
46 scoped_ptr<base::ListValue> args(new base::ListValue()); 45 scoped_ptr<base::ListValue> args(new base::ListValue());
47 args->Append(alarm.js_alarm->ToValue().release()); 46 args->Append(alarm.js_alarm->ToValue().release());
48 scoped_ptr<Event> event(new Event(alarms::OnAlarm::kEventName, 47 scoped_ptr<Event> event(new Event(alarms::OnAlarm::kEventName,
49 args.Pass())); 48 args.Pass()));
50 EventRouter::Get(browser_context_) 49 EventRouter::Get(browser_context_)
51 ->DispatchEventToExtension(extension_id, event.Pass()); 50 ->DispatchEventToExtension(extension_id, event.Pass());
52 } 51 }
53 52
54 private: 53 private:
55 content::BrowserContext* browser_context_; 54 content::BrowserContext* browser_context_;
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 if (create_info.period_in_minutes.get()) { 461 if (create_info.period_in_minutes.get()) {
463 js_alarm->period_in_minutes.reset( 462 js_alarm->period_in_minutes.reset(
464 new double(*create_info.period_in_minutes)); 463 new double(*create_info.period_in_minutes));
465 } 464 }
466 } 465 }
467 466
468 Alarm::~Alarm() { 467 Alarm::~Alarm() {
469 } 468 }
470 469
471 } // namespace extensions 470 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/alarms/alarm_manager.h ('k') | chrome/browser/extensions/api/alarms/alarms_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698