| 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 CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_ERROR_REPORTER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_ERROR_REPORTER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_ERROR_REPORTER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_ERROR_REPORTER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "ipc/ipc_sender.h" | 11 |
| 12 namespace content { |
| 13 class RenderFrameHost; |
| 14 } |
| 12 | 15 |
| 13 namespace chromeos { | 16 namespace chromeos { |
| 14 namespace launcher_search_provider { | 17 namespace launcher_search_provider { |
| 15 | 18 |
| 16 // A utility class which sends error message to developer console. | 19 // A utility class which sends error message to developer console. |
| 17 class ErrorReporter { | 20 class ErrorReporter { |
| 18 public: | 21 public: |
| 19 ErrorReporter(IPC::Sender* sender, const int routing_id); | 22 explicit ErrorReporter(content::RenderFrameHost* host); |
| 20 virtual ~ErrorReporter(); | 23 virtual ~ErrorReporter(); |
| 21 | 24 |
| 22 // Shows |message| as warning in the developer console of the extension. | 25 // Shows |message| as warning in the developer console of the extension. |
| 23 virtual void Warn(const std::string& message); | 26 virtual void Warn(const std::string& message); |
| 24 | 27 |
| 25 // Duplicate the instance. Since ErrorReporter is handled as scoped_ptr in the | 28 // Duplicate the instance. Since ErrorReporter is handled as scoped_ptr in the |
| 26 // code, we need this to duplicate error reporter to set it to each result. | 29 // code, we need this to duplicate error reporter to set it to each result. |
| 27 virtual scoped_ptr<ErrorReporter> Duplicate(); | 30 virtual scoped_ptr<ErrorReporter> Duplicate(); |
| 28 | 31 |
| 29 private: | 32 private: |
| 30 // Not owned. | 33 // Not owned. |
| 31 IPC::Sender* sender_; | 34 content::RenderFrameHost* host_; |
| 32 | |
| 33 const int routing_id_; | |
| 34 | 35 |
| 35 DISALLOW_COPY_AND_ASSIGN(ErrorReporter); | 36 DISALLOW_COPY_AND_ASSIGN(ErrorReporter); |
| 36 }; | 37 }; |
| 37 | 38 |
| 38 } // namespace launcher_search_provider | 39 } // namespace launcher_search_provider |
| 39 } // namespace chromeos | 40 } // namespace chromeos |
| 40 | 41 |
| 41 #endif // CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_ERROR_REPORTER_H_ | 42 #endif // CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_ERROR_REPORTER_H_ |
| OLD | NEW |