OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_WEBUI_WELCOME_WIN10_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_WELCOME_WIN10_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_WELCOME_WIN10_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_WELCOME_WIN10_HANDLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 void RegisterMessages() override; | 29 void RegisterMessages() override; |
30 | 30 |
31 private: | 31 private: |
32 // Handlers for javascript calls. | 32 // Handlers for javascript calls. |
33 void HandleGetPinnedToTaskbarState(const base::ListValue* args); | 33 void HandleGetPinnedToTaskbarState(const base::ListValue* args); |
34 void HandleSetDefaultBrowser(const base::ListValue* args); | 34 void HandleSetDefaultBrowser(const base::ListValue* args); |
35 void HandleContinue(const base::ListValue* args); | 35 void HandleContinue(const base::ListValue* args); |
36 | 36 |
37 void StartIsPinnedToTaskbarCheck(); | 37 void StartIsPinnedToTaskbarCheck(); |
38 | 38 |
39 // Callback for mojom::ShellHandler's call to IsPinnedToTaskbar(). | 39 // Callback for chrome::mojom::ShellHandler's call to IsPinnedToTaskbar(). |
40 void OnIsPinnedToTaskbarResult(bool succeeded, bool is_pinned_to_taskbar); | 40 void OnIsPinnedToTaskbarResult(bool succeeded, bool is_pinned_to_taskbar); |
41 | 41 |
42 // Sets the internal result and optionally call | 42 // Sets the internal result and optionally call |
43 // SendPinnedToTaskbarStateResult() in the case that | 43 // SendPinnedToTaskbarStateResult() in the case that |
44 // |pinned_state_callback_id_| is not empty. | 44 // |pinned_state_callback_id_| is not empty. |
45 void OnIsPinnedToTaskbarDetermined(bool is_pinned_to_taskbar); | 45 void OnIsPinnedToTaskbarDetermined(bool is_pinned_to_taskbar); |
46 | 46 |
47 // Returns the result to the getPinnedToTaskbarState() javascript call via the | 47 // Returns the result to the getPinnedToTaskbarState() javascript call via the |
48 // promise. | 48 // promise. |
49 void SendPinnedToTaskbarStateResult(); | 49 void SendPinnedToTaskbarStateResult(); |
50 | 50 |
51 std::unique_ptr<content::UtilityProcessMojoClient<mojom::ShellHandler>> | 51 std::unique_ptr< |
| 52 content::UtilityProcessMojoClient<chrome::mojom::ShellHandler>> |
52 client_; | 53 client_; |
53 base::OneShotTimer timer_; | 54 base::OneShotTimer timer_; |
54 | 55 |
55 // Acts as a cache to hold the taskbar pinned state of Chrome. It has no value | 56 // Acts as a cache to hold the taskbar pinned state of Chrome. It has no value |
56 // until this state is determined. | 57 // until this state is determined. |
57 base::Optional<bool> pinned_state_result_; | 58 base::Optional<bool> pinned_state_result_; |
58 | 59 |
59 // The callback id used to return the result to the getPinnedToTaskbarState() | 60 // The callback id used to return the result to the getPinnedToTaskbarState() |
60 // javascript call. This id is empty until we receive the call; thus this | 61 // javascript call. This id is empty until we receive the call; thus this |
61 // variable is used to determine if the result should be sent to the caller | 62 // variable is used to determine if the result should be sent to the caller |
62 // when it is received, or wait for the call to happen. | 63 // when it is received, or wait for the call to happen. |
63 std::string pinned_state_callback_id_; | 64 std::string pinned_state_callback_id_; |
64 | 65 |
65 DISALLOW_COPY_AND_ASSIGN(WelcomeWin10Handler); | 66 DISALLOW_COPY_AND_ASSIGN(WelcomeWin10Handler); |
66 }; | 67 }; |
67 | 68 |
68 #endif // CHROME_BROWSER_UI_WEBUI_WELCOME_WIN10_HANDLER_H_ | 69 #endif // CHROME_BROWSER_UI_WEBUI_WELCOME_WIN10_HANDLER_H_ |
OLD | NEW |