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 <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.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 { | |
18 class ListValue; | |
19 } | |
20 | |
21 namespace app_list { | 17 namespace app_list { |
22 | 18 |
23 // A class which sends API events to the custom launcher page. | 19 // A class which sends API events to the custom launcher page. |
24 class LauncherPageEventDispatcher { | 20 class LauncherPageEventDispatcher { |
25 public: | 21 public: |
26 LauncherPageEventDispatcher(Profile* profile, | 22 LauncherPageEventDispatcher(Profile* profile, |
27 const std::string& extension_id); | 23 const std::string& extension_id); |
28 ~LauncherPageEventDispatcher(); | 24 ~LauncherPageEventDispatcher(); |
29 | 25 |
30 void ProgressChanged(double progress); | 26 void ProgressChanged(double progress); |
31 void PopSubpage(); | 27 void PopSubpage(); |
32 | 28 |
33 private: | 29 private: |
34 // Dispatches |event| to |extension_id_|. | 30 // Dispatches |event| to |extension_id_|. |
35 void DispatchEvent(std::unique_ptr<extensions::Event> event); | 31 void DispatchEvent(std::unique_ptr<extensions::Event> event); |
36 | 32 |
37 Profile* profile_; | 33 Profile* profile_; |
38 std::string extension_id_; | 34 std::string extension_id_; |
39 | 35 |
40 DISALLOW_COPY_AND_ASSIGN(LauncherPageEventDispatcher); | 36 DISALLOW_COPY_AND_ASSIGN(LauncherPageEventDispatcher); |
41 }; | 37 }; |
42 | 38 |
43 } // namespace app_list | 39 } // namespace app_list |
44 | 40 |
45 #endif // CHROME_BROWSER_UI_APP_LIST_LAUNCHER_PAGE_EVENT_DISPATCHER_H_ | 41 #endif // CHROME_BROWSER_UI_APP_LIST_LAUNCHER_PAGE_EVENT_DISPATCHER_H_ |
OLD | NEW |