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

Side by Side Diff: chrome/browser/extensions/extension_idle_api.h

Issue 10071035: RefCounted types should not have public destructors, chrome/browser/extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile fix Created 8 years, 7 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_IDLE_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_IDLE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_IDLE_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_IDLE_API_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/idle.h" 9 #include "chrome/browser/idle.h"
10 #include "chrome/browser/extensions/extension_function.h" 10 #include "chrome/browser/extensions/extension_function.h"
11 11
12 class Profile; 12 class Profile;
13 13
14 // Event router class for events related to the idle API. 14 // Event router class for events related to the idle API.
15 class ExtensionIdleEventRouter { 15 class ExtensionIdleEventRouter {
16 public: 16 public:
17 static void OnIdleStateChange(Profile* profile, 17 static void OnIdleStateChange(Profile* profile,
18 IdleState idleState); 18 IdleState idleState);
19 private: 19 private:
20 DISALLOW_COPY_AND_ASSIGN(ExtensionIdleEventRouter); 20 DISALLOW_COPY_AND_ASSIGN(ExtensionIdleEventRouter);
21 }; 21 };
22 22
23 // Implementation of the chrome.idle.queryState API. 23 // Implementation of the chrome.idle.queryState API.
24 class ExtensionIdleQueryStateFunction : public AsyncExtensionFunction { 24 class ExtensionIdleQueryStateFunction : public AsyncExtensionFunction {
25 public: 25 public:
26 DECLARE_EXTENSION_FUNCTION_NAME("idle.queryState")
27
28 protected:
29 virtual ~ExtensionIdleQueryStateFunction() {}
30
31 // ExtensionFunction:
26 virtual bool RunImpl() OVERRIDE; 32 virtual bool RunImpl() OVERRIDE;
27 DECLARE_EXTENSION_FUNCTION_NAME("idle.queryState")
28 33
29 private: 34 private:
30 void IdleStateCallback(int threshold, IdleState state); 35 void IdleStateCallback(int threshold, IdleState state);
31 }; 36 };
32 37
33 // Class used for caching answers from CalculateIdleState. 38 // Class used for caching answers from CalculateIdleState.
34 class ExtensionIdleCache { 39 class ExtensionIdleCache {
35 public: 40 public:
36 static IdleState CalculateIdleState(int threshold); 41 static IdleState CalculateIdleState(int threshold);
37 static void UpdateCache(int threshold, IdleState state); 42 static void UpdateCache(int threshold, IdleState state);
(...skipping 30 matching lines...) Expand all
68 // |threshold| is threshold parameter of the query. 73 // |threshold| is threshold parameter of the query.
69 // |state| is result of the query. 74 // |state| is result of the query.
70 // |moment| is moment in time this method is called. 75 // |moment| is moment in time this method is called.
71 static void Update(int threshold, IdleState state, double moment); 76 static void Update(int threshold, IdleState state, double moment);
72 77
73 static int get_min_threshold(); 78 static int get_min_threshold();
74 static double get_throttle_interval(); 79 static double get_throttle_interval();
75 80
76 static CacheData cached_data; 81 static CacheData cached_data;
77 }; 82 };
83
78 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_IDLE_API_H_ 84 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_IDLE_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_font_settings_api.h ('k') | chrome/browser/extensions/extension_idle_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698