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

Side by Side Diff: chrome/browser/chromeos/launcher_search_provider/error_reporter.cc

Issue 1060733003: Support custom icon in search result. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP: Add API test. Created 5 years, 7 months 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 #include "chrome/browser/chromeos/launcher_search_provider/error_reporter.h"
6
7 #include "chrome/browser/chromeos/launcher_search_provider/test_util.h"
8 #include "content/public/common/console_message_level.h"
9 #include "extensions/common/extension_messages.h"
10 #include "extensions/common/value_builder.h"
11
12 namespace chromeos {
13 namespace launcher_search_provider {
14
15 ErrorReporter::ErrorReporter(IPC::Sender* sender,
16 const int routing_id,
17 Profile* profile)
18 : sender_(sender), routing_id_(routing_id), profile_(profile) {
19 }
20
21 void ErrorReporter::Warn(const std::string& message) {
22 if (sender_ == nullptr)
23 return;
24
25 sender_->Send(new ExtensionMsg_AddMessageToConsole(
26 routing_id_, content::ConsoleMessageLevel::CONSOLE_MESSAGE_LEVEL_WARNING,
27 message));
28
29 // Sends warning message to test extension.
30 TestUtil::SendMessageToTestExtension(
31 profile_, extensions::DictionaryBuilder()
32 .Set("functionName", "ErrorReporter::Warn")
33 .Set("message", message)
34 .ToJSON());
35 }
36
37 } // namespace launcher_search_provider
38 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698