Chromium Code Reviews| Index: content/public/browser/power_save_blocker.h |
| diff --git a/content/browser/power_save_blocker.h b/content/public/browser/power_save_blocker.h |
| similarity index 64% |
| rename from content/browser/power_save_blocker.h |
| rename to content/public/browser/power_save_blocker.h |
| index 53e5418078e442e01b16f9c620634e56b413b19f..caece595a7e897e306fe66d5f5ecb7d1fb1a2c5d 100644 |
| --- a/content/browser/power_save_blocker.h |
| +++ b/content/public/browser/power_save_blocker.h |
| @@ -2,14 +2,13 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CONTENT_BROWSER_POWER_SAVE_BLOCKER_H_ |
| -#define CONTENT_BROWSER_POWER_SAVE_BLOCKER_H_ |
| +#ifndef CONTENT_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_ |
| +#define CONTENT_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_ |
| #include <string> |
| -#include <vector> |
| #include "base/basictypes.h" |
| -#include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| #include "content/common/content_export.h" |
| namespace content { |
| @@ -33,30 +32,21 @@ class CONTENT_EXPORT PowerSaveBlocker { |
| kPowerSaveBlockPreventDisplaySleep, |
| }; |
| + virtual ~PowerSaveBlocker() {} |
| + |
| // Pass in the type of power save blocking desired. If multiple types of |
| // blocking are desired, instantiate one PowerSaveBlocker for each type. |
| // |reason| may be provided to the underlying system APIs on some platforms. |
| - PowerSaveBlocker(PowerSaveBlockerType type, const std::string& reason); |
| - ~PowerSaveBlocker(); |
| + static scoped_ptr<PowerSaveBlocker> Create(PowerSaveBlockerType type, |
| + const std::string& reason); |
|
jam
2013/01/11 01:24:30
nit: everything below this line isn't necessary fo
hashimoto
2013/01/11 08:39:44
Done.
hashimoto
2013/01/11 10:48:57
Btw, to prohibit instantiating the interface class
|
| - private: |
| - class Delegate; |
| - |
| - // Implementations of this class may need a second object with different |
| - // lifetime than the RAII container, or additional storage. This member is |
| - // here for that purpose. If not used, just define the class as an empty |
| - // RefCounted (or RefCountedThreadSafe) like so to make it compile: |
| - // class PowerSaveBlocker::Delegate |
| - // : public base::RefCounted<PowerSaveBlocker::Delegate> { |
| - // private: |
| - // friend class base::RefCounted<Delegate>; |
| - // ~Delegate() {} |
| - // }; |
| - scoped_refptr<Delegate> delegate_; |
| + protected: |
| + PowerSaveBlocker() {} |
| + private: |
| DISALLOW_COPY_AND_ASSIGN(PowerSaveBlocker); |
| }; |
| } // namespace content |
| -#endif // CONTENT_BROWSER_POWER_SAVE_BLOCKER_H_ |
| +#endif // CONTENT_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_ |