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

Side by Side Diff: chrome/browser/extensions/api/feedback_private/single_log_source_factory.h

Issue 2840103002: Add new API function: feedbackPrivate.readLogSource (Closed)
Patch Set: Add proper ifdefs for non-CrOS platforms Created 3 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
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_SINGLE_LOG_SOURCE_FACTORY _H_
6 #define CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_SINGLE_LOG_SOURCE_FACTORY _H_
7
8 #include <memory>
9
10 #include "base/callback.h"
11 #include "chrome/browser/chromeos/system_logs/single_log_source.h"
12
13 namespace extensions {
14
15 // Provides a way to override the creation of a new SingleLogSource during
16 // testing.
17 class SingleLogSourceFactory {
18 public:
19 using CreateCallback =
20 base::Callback<std::unique_ptr<system_logs::SingleLogSource>(
21 system_logs::SingleLogSource::SupportedSource)>;
22
23 // Returns a SingleLogSource with source type of |type|. The caller must take
24 // ownership of the returned object.
25 static std::unique_ptr<system_logs::SingleLogSource> CreateSingleLogSource(
26 system_logs::SingleLogSource::SupportedSource type);
27
28 // Pass in a callback that gets executed instead of the default behavior of
29 // CreateSingleLogSource. Does not take ownership of |callback|. When done
30 // testing, call this function again with |callback|=nullptr to restore the
31 // default behavior.
32 static void SetForTesting(CreateCallback* callback);
33 };
34
35 } // namespace extensions
36
37 #endif // CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_SINGLE_LOG_SOURCE_FACT ORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698