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

Side by Side Diff: components/password_manager/core/browser/log_manager.h

Issue 1415533013: Fix password manager internals renderer reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Separate dummy log manager Created 5 years, 1 month 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 2015 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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOG_MANAGER_H_
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOG_MANAGER_H_
7
8 #include <string>
9 #include "base/callback.h"
10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12
13 namespace password_manager {
14
15 class LogRouter;
16
17 // This interface is used by the password management code to receive and display
18 // logs about progress of actions like saving a password.
19 class LogManager {
20 public:
21 virtual ~LogManager() = default;
22
23 // This method is called by a LogRouter, after the LogManager registers with
24 // one. If |router_can_be_used| is true, logs can be sent to LogRouter after
25 // the return from OnLogRouterAvailabilityChanged and will reach at least one
26 // LogReceiver instance. If |router_can_be_used| is false, no logs should be
27 // sent to the LogRouter.
28 virtual void OnLogRouterAvailabilityChanged(bool router_can_be_used) = 0;
29
30 // Forward |text| for display to the LogRouter (if registered with one).
31 virtual void LogSavePasswordProgress(const std::string& text) const = 0;
32
33 // Returns true if logs recorded via LogSavePasswordProgress will be
34 // displayed, and false otherwise.
35 virtual bool IsLoggingActive() const = 0;
36
37 // Returns the production code implementation of LogManager. If |log_router|
38 // is null, the manager will do nothing. |notification_callback| will be
39 // called every time the activity status of logging changes, with the argument
40 // indicating that logging is active (true) or inactive (false).
41 static scoped_ptr<LogManager> Create(
42 LogRouter* log_router,
43 base::Callback<void(bool)> notification_callback);
44 };
45
46 } // namespace password_manager
47
48 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOG_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698