| 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 "chrome/browser/chromeos/launcher_search_provider/error_reporter.h" | 5 #include "chrome/browser/chromeos/launcher_search_provider/error_reporter.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" |
| 7 #include "content/public/browser/render_frame_host.h" | 8 #include "content/public/browser/render_frame_host.h" |
| 8 #include "content/public/common/console_message_level.h" | 9 #include "content/public/common/console_message_level.h" |
| 9 | 10 |
| 10 namespace chromeos { | 11 namespace chromeos { |
| 11 namespace launcher_search_provider { | 12 namespace launcher_search_provider { |
| 12 | 13 |
| 13 ErrorReporter::ErrorReporter(content::RenderFrameHost* host) : host_(host) { | 14 ErrorReporter::ErrorReporter(content::RenderFrameHost* host) : host_(host) { |
| 14 } | 15 } |
| 15 | 16 |
| 16 ErrorReporter::~ErrorReporter() { | 17 ErrorReporter::~ErrorReporter() { |
| 17 } | 18 } |
| 18 | 19 |
| 19 void ErrorReporter::Warn(const std::string& message) { | 20 void ErrorReporter::Warn(const std::string& message) { |
| 20 DCHECK(host_); | 21 DCHECK(host_); |
| 21 | 22 |
| 22 host_->AddMessageToConsole( | 23 host_->AddMessageToConsole( |
| 23 content::ConsoleMessageLevel::CONSOLE_MESSAGE_LEVEL_WARNING, message); | 24 content::ConsoleMessageLevel::CONSOLE_MESSAGE_LEVEL_WARNING, message); |
| 24 } | 25 } |
| 25 | 26 |
| 26 scoped_ptr<ErrorReporter> ErrorReporter::Duplicate() { | 27 std::unique_ptr<ErrorReporter> ErrorReporter::Duplicate() { |
| 27 return make_scoped_ptr(new ErrorReporter(host_)); | 28 return base::WrapUnique(new ErrorReporter(host_)); |
| 28 } | 29 } |
| 29 | 30 |
| 30 } // namespace launcher_search_provider | 31 } // namespace launcher_search_provider |
| 31 } // namespace chromeos | 32 } // namespace chromeos |
| OLD | NEW |