OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UI_APP_LIST_LAUNCHER_PAGE_EVENT_DISPATCHER_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_LAUNCHER_PAGE_EVENT_DISPATCHER_H_ |
6 #define CHROME_BROWSER_UI_APP_LIST_LAUNCHER_PAGE_EVENT_DISPATCHER_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_LAUNCHER_PAGE_EVENT_DISPATCHER_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 #include "extensions/browser/event_router.h" | 12 #include "extensions/browser/event_router.h" |
13 #include "extensions/browser/extension_event_histogram_value.h" | 13 #include "extensions/browser/extension_event_histogram_value.h" |
14 | 14 |
15 class Profile; | 15 class Profile; |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class ListValue; | 18 class ListValue; |
19 } | 19 } |
20 | 20 |
21 namespace app_list { | 21 namespace app_list { |
22 | 22 |
23 // A class which sends API events to the custom launcher page. | 23 // A class which sends API events to the custom launcher page. |
24 class LauncherPageEventDispatcher { | 24 class LauncherPageEventDispatcher { |
25 public: | 25 public: |
26 LauncherPageEventDispatcher(Profile* profile, | 26 LauncherPageEventDispatcher(Profile* profile, |
27 const std::string& extension_id); | 27 const std::string& extension_id); |
28 ~LauncherPageEventDispatcher(); | 28 ~LauncherPageEventDispatcher(); |
29 | 29 |
30 void ProgressChanged(double progress); | 30 void ProgressChanged(double progress); |
31 void PopSubpage(); | 31 void PopSubpage(); |
32 | 32 |
33 private: | 33 private: |
34 // Dispatches |event| to |extension_id_|. | 34 // Dispatches |event| to |extension_id_|. |
35 void DispatchEvent(scoped_ptr<extensions::Event> event); | 35 void DispatchEvent(std::unique_ptr<extensions::Event> event); |
36 | 36 |
37 Profile* profile_; | 37 Profile* profile_; |
38 std::string extension_id_; | 38 std::string extension_id_; |
39 | 39 |
40 DISALLOW_COPY_AND_ASSIGN(LauncherPageEventDispatcher); | 40 DISALLOW_COPY_AND_ASSIGN(LauncherPageEventDispatcher); |
41 }; | 41 }; |
42 | 42 |
43 } // namespace app_list | 43 } // namespace app_list |
44 | 44 |
45 #endif // CHROME_BROWSER_UI_APP_LIST_LAUNCHER_PAGE_EVENT_DISPATCHER_H_ | 45 #endif // CHROME_BROWSER_UI_APP_LIST_LAUNCHER_PAGE_EVENT_DISPATCHER_H_ |
OLD | NEW |