| 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 #include "components/password_manager/core/browser/log_manager.h" | 5 #include "components/password_manager/core/browser/log_manager.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" |
| 8 #include "components/password_manager/core/browser/log_router.h" | 9 #include "components/password_manager/core/browser/log_router.h" |
| 9 | 10 |
| 10 namespace password_manager { | 11 namespace password_manager { |
| 11 | 12 |
| 12 namespace { | 13 namespace { |
| 13 | 14 |
| 14 class LogManagerImpl : public LogManager { | 15 class LogManagerImpl : public LogManager { |
| 15 public: | 16 public: |
| 16 LogManagerImpl(LogRouter* log_router, base::Closure notification_callback); | 17 LogManagerImpl(LogRouter* log_router, base::Closure notification_callback); |
| 17 | 18 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 log_router_->ProcessLog(text); | 80 log_router_->ProcessLog(text); |
| 80 } | 81 } |
| 81 | 82 |
| 82 bool LogManagerImpl::IsLoggingActive() const { | 83 bool LogManagerImpl::IsLoggingActive() const { |
| 83 return can_use_log_router_ && !is_suspended_; | 84 return can_use_log_router_ && !is_suspended_; |
| 84 } | 85 } |
| 85 | 86 |
| 86 } // namespace | 87 } // namespace |
| 87 | 88 |
| 88 // static | 89 // static |
| 89 scoped_ptr<LogManager> LogManager::Create(LogRouter* log_router, | 90 std::unique_ptr<LogManager> LogManager::Create( |
| 90 base::Closure notification_callback) { | 91 LogRouter* log_router, |
| 91 return make_scoped_ptr(new LogManagerImpl(log_router, notification_callback)); | 92 base::Closure notification_callback) { |
| 93 return base::WrapUnique( |
| 94 new LogManagerImpl(log_router, notification_callback)); |
| 92 } | 95 } |
| 93 | 96 |
| 94 } // namespace password_manager | 97 } // namespace password_manager |
| OLD | NEW |