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