| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOG_MANAGER_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOG_MANAGER_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOG_MANAGER_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOG_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/callback.h" | 11 #include "base/callback.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 | 13 |
| 14 namespace password_manager { | 14 namespace password_manager { |
| 15 | 15 |
| 16 class LogRouter; | 16 class LogRouter; |
| 17 | 17 |
| 18 // This interface is used by the password management code to receive and display | 18 // This interface is used by the password management code to receive and display |
| 19 // logs about progress of actions like saving a password. | 19 // logs about progress of actions like saving a password. |
| 20 class LogManager { | 20 class LogManager { |
| 21 public: | 21 public: |
| 22 virtual ~LogManager() = default; | 22 virtual ~LogManager() = default; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 // Forward |text| for display to the LogRouter (if registered with one). | 35 // Forward |text| for display to the LogRouter (if registered with one). |
| 36 virtual void LogSavePasswordProgress(const std::string& text) const = 0; | 36 virtual void LogSavePasswordProgress(const std::string& text) const = 0; |
| 37 | 37 |
| 38 // Returns true if logs recorded via LogSavePasswordProgress will be | 38 // Returns true if logs recorded via LogSavePasswordProgress will be |
| 39 // displayed, and false otherwise. | 39 // displayed, and false otherwise. |
| 40 virtual bool IsLoggingActive() const = 0; | 40 virtual bool IsLoggingActive() const = 0; |
| 41 | 41 |
| 42 // Returns the production code implementation of LogManager. If |log_router| | 42 // Returns the production code implementation of LogManager. If |log_router| |
| 43 // is null, the manager will do nothing. |notification_callback| will be | 43 // is null, the manager will do nothing. |notification_callback| will be |
| 44 // called every time the activity status of logging changes. | 44 // called every time the activity status of logging changes. |
| 45 static scoped_ptr<LogManager> Create(LogRouter* log_router, | 45 static std::unique_ptr<LogManager> Create( |
| 46 base::Closure notification_callback); | 46 LogRouter* log_router, |
| 47 base::Closure notification_callback); |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 } // namespace password_manager | 50 } // namespace password_manager |
| 50 | 51 |
| 51 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOG_MANAGER_H_ | 52 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOG_MANAGER_H_ |
| OLD | NEW |