| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/optional.h" | 12 #include "base/optional.h" |
| 13 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
| 14 #include "content/public/browser/web_ui_message_handler.h" | 14 #include "content/public/browser/web_ui_message_handler.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class ListValue; | 17 class ListValue; |
| 18 } | 18 } |
| 19 | 19 |
| 20 // Handles actions on the Windows 10 specific Welcome page. | 20 // Handles actions on the Windows 10 specific Welcome page. |
| 21 class WelcomeWin10Handler : public content::WebUIMessageHandler { | 21 class WelcomeWin10Handler : public content::WebUIMessageHandler { |
| 22 public: | 22 public: |
| 23 WelcomeWin10Handler(); | 23 explicit WelcomeWin10Handler(bool inline_style_variant); |
| 24 ~WelcomeWin10Handler() override; | 24 ~WelcomeWin10Handler() override; |
| 25 | 25 |
| 26 // content::WebUIMessageHandler: | 26 // content::WebUIMessageHandler: |
| 27 void RegisterMessages() override; | 27 void RegisterMessages() override; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 // Handlers for javascript calls. | 30 // Handlers for javascript calls. |
| 31 void HandleGetPinnedToTaskbarState(const base::ListValue* args); | 31 void HandleGetPinnedToTaskbarState(const base::ListValue* args); |
| 32 void HandleSetDefaultBrowser(const base::ListValue* args); | 32 void HandleSetDefaultBrowser(const base::ListValue* args); |
| 33 void HandleContinue(const base::ListValue* args); | 33 void HandleContinue(const base::ListValue* args); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 51 // Acts as a cache to hold the taskbar pinned state of Chrome. It has no value | 51 // Acts as a cache to hold the taskbar pinned state of Chrome. It has no value |
| 52 // until this state is determined. | 52 // until this state is determined. |
| 53 base::Optional<bool> pinned_state_result_; | 53 base::Optional<bool> pinned_state_result_; |
| 54 | 54 |
| 55 // The callback id used to return the result to the getPinnedToTaskbarState() | 55 // The callback id used to return the result to the getPinnedToTaskbarState() |
| 56 // javascript call. This id is empty until we receive the call; thus this | 56 // javascript call. This id is empty until we receive the call; thus this |
| 57 // variable is used to determine if the result should be sent to the caller | 57 // variable is used to determine if the result should be sent to the caller |
| 58 // when it is received, or wait for the call to happen. | 58 // when it is received, or wait for the call to happen. |
| 59 std::string pinned_state_callback_id_; | 59 std::string pinned_state_callback_id_; |
| 60 | 60 |
| 61 // Indicates if the inline style variant is displayed. |
| 62 bool inline_style_variant_; |
| 63 |
| 61 base::WeakPtrFactory<WelcomeWin10Handler> weak_ptr_factory_; | 64 base::WeakPtrFactory<WelcomeWin10Handler> weak_ptr_factory_; |
| 62 | 65 |
| 63 DISALLOW_COPY_AND_ASSIGN(WelcomeWin10Handler); | 66 DISALLOW_COPY_AND_ASSIGN(WelcomeWin10Handler); |
| 64 }; | 67 }; |
| 65 | 68 |
| 66 #endif // CHROME_BROWSER_UI_WEBUI_WELCOME_WIN10_HANDLER_H_ | 69 #endif // CHROME_BROWSER_UI_WEBUI_WELCOME_WIN10_HANDLER_H_ |
| OLD | NEW |