Chromium Code Reviews| Index: chrome/browser/chromeos/launcher_search_provider/error_reporter.cc |
| diff --git a/chrome/browser/chromeos/launcher_search_provider/error_reporter.cc b/chrome/browser/chromeos/launcher_search_provider/error_reporter.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..99237afcf943c959a03e046d7c49d09d24cee673 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/launcher_search_provider/error_reporter.cc |
| @@ -0,0 +1,30 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/chromeos/launcher_search_provider/error_reporter.h" |
| + |
| +#include "content/public/common/console_message_level.h" |
| +#include "extensions/common/extension_messages.h" |
| + |
| +namespace chromeos { |
| +namespace launcher_search_provider { |
| + |
| +ErrorReporter::ErrorReporter(IPC::Sender* sender, const int routing_id) |
| + : sender_(sender), routing_id_(routing_id) { |
| +} |
| + |
| +ErrorReporter::~ErrorReporter() { |
| +} |
| + |
| +void ErrorReporter::Warn(const std::string& message) { |
| + if (sender_ == nullptr) |
|
Matt Giuca
2015/05/05 04:25:30
DCHECK(sender);
The only time sender should be nu
yawano
2015/05/07 06:24:55
Done.
|
| + return; |
| + |
| + sender_->Send(new ExtensionMsg_AddMessageToConsole( |
| + routing_id_, content::ConsoleMessageLevel::CONSOLE_MESSAGE_LEVEL_WARNING, |
| + message)); |
| +} |
| + |
| +} // namespace launcher_search_provider |
| +} // namespace chromeos |