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

Side by Side Diff: extensions/browser/api/idle/idle_manager.h

Issue 2025103003: ExtensionFunction: don't pass ownership of base::Value by raw pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « extensions/browser/api/hid/hid_api.cc ('k') | extensions/browser/api/idle/idle_manager.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 #ifndef EXTENSIONS_BROWSER_API_IDLE_IDLE_MANAGER_H_ 5 #ifndef EXTENSIONS_BROWSER_API_IDLE_IDLE_MANAGER_H_
6 #define EXTENSIONS_BROWSER_API_IDLE_IDLE_MANAGER_H_ 6 #define EXTENSIONS_BROWSER_API_IDLE_IDLE_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory>
9 #include <string> 10 #include <string>
10 11
11 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
12 #include "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
15 #include "base/scoped_observer.h" 16 #include "base/scoped_observer.h"
16 #include "base/threading/thread_checker.h" 17 #include "base/threading/thread_checker.h"
17 #include "base/timer/timer.h" 18 #include "base/timer/timer.h"
18 #include "components/keyed_service/core/keyed_service.h" 19 #include "components/keyed_service/core/keyed_service.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 void OnExtensionUnloaded(content::BrowserContext* browser_context, 84 void OnExtensionUnloaded(content::BrowserContext* browser_context,
84 const Extension* extension, 85 const Extension* extension,
85 UnloadedExtensionInfo::Reason reason) override; 86 UnloadedExtensionInfo::Reason reason) override;
86 87
87 // EventRouter::Observer implementation. 88 // EventRouter::Observer implementation.
88 void OnListenerAdded(const EventListenerInfo& details) override; 89 void OnListenerAdded(const EventListenerInfo& details) override;
89 void OnListenerRemoved(const EventListenerInfo& details) override; 90 void OnListenerRemoved(const EventListenerInfo& details) override;
90 91
91 void QueryState(int threshold, QueryStateCallback notify); 92 void QueryState(int threshold, QueryStateCallback notify);
92 void SetThreshold(const std::string& extension_id, int threshold); 93 void SetThreshold(const std::string& extension_id, int threshold);
93 static base::StringValue* CreateIdleValue(ui::IdleState idle_state); 94 static std::unique_ptr<base::StringValue> CreateIdleValue(
95 ui::IdleState idle_state);
94 96
95 // Override default event class. Callee assumes ownership. Used for testing. 97 // Override default event class. Callee assumes ownership. Used for testing.
96 void SetEventDelegateForTest(std::unique_ptr<EventDelegate> event_delegate); 98 void SetEventDelegateForTest(std::unique_ptr<EventDelegate> event_delegate);
97 99
98 // Override default idle time calculations. Callee assumes ownership. Used 100 // Override default idle time calculations. Callee assumes ownership. Used
99 // for testing. 101 // for testing.
100 void SetIdleTimeProviderForTest( 102 void SetIdleTimeProviderForTest(
101 std::unique_ptr<IdleTimeProvider> idle_provider); 103 std::unique_ptr<IdleTimeProvider> idle_provider);
102 104
103 private: 105 private:
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 extension_registry_observer_; 142 extension_registry_observer_;
141 143
142 base::WeakPtrFactory<IdleManager> weak_factory_; 144 base::WeakPtrFactory<IdleManager> weak_factory_;
143 145
144 DISALLOW_COPY_AND_ASSIGN(IdleManager); 146 DISALLOW_COPY_AND_ASSIGN(IdleManager);
145 }; 147 };
146 148
147 } // namespace extensions 149 } // namespace extensions
148 150
149 #endif // EXTENSIONS_BROWSER_API_IDLE_IDLE_MANAGER_H_ 151 #endif // EXTENSIONS_BROWSER_API_IDLE_IDLE_MANAGER_H_
OLDNEW
« no previous file with comments | « extensions/browser/api/hid/hid_api.cc ('k') | extensions/browser/api/idle/idle_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698