Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: chrome/browser/ui/webui/welcome_win10_handler.h

Issue 2449853008: Determine the Win10-specific Welcome page variant to display (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
9 #include <string>
10
8 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/timer/timer.h"
13 #include "chrome/common/shell_handler_win.mojom.h"
14 #include "content/public/browser/utility_process_mojo_client.h"
9 #include "content/public/browser/web_ui_message_handler.h" 15 #include "content/public/browser/web_ui_message_handler.h"
10 16
11 namespace base { 17 namespace base {
12 class ListValue; 18 class ListValue;
13 } 19 }
14 20
15 // Handles actions on the Windows 10 specific Welcome page. 21 // Handles actions on the Windows 10 specific Welcome page.
16 class WelcomeWin10Handler : public content::WebUIMessageHandler { 22 class WelcomeWin10Handler : public content::WebUIMessageHandler {
17 public: 23 public:
18 WelcomeWin10Handler(); 24 WelcomeWin10Handler();
19 ~WelcomeWin10Handler() override; 25 ~WelcomeWin10Handler() override;
20 26
21 // content::WebUIMessageHandler: 27 // content::WebUIMessageHandler:
22 void RegisterMessages() override; 28 void RegisterMessages() override;
23 29
24 private: 30 private:
31 // Handlers for javascript calls.
32 void HandleIsPinnedToTaskbar(const base::ListValue* args);
25 void HandleSetDefaultBrowser(const base::ListValue* args); 33 void HandleSetDefaultBrowser(const base::ListValue* args);
26 void HandleContinue(const base::ListValue* args); 34 void HandleContinue(const base::ListValue* args);
27 35
36 // Called when the pinned state is received from the utility process.
tmartino 2016/10/28 15:18:04 The relationship between this method and OnIsPinne
Patrick Monette 2016/10/28 21:21:37 Done.
37 void OnIsPinnedToTaskbarResult(const std::string& callback_id,
38 bool succeeded,
39 bool is_pinned_to_taskbar);
40
41 // Returns the |is_pinned_to_taskbar| state to the calling javascript via
42 // the promise.
43 void OnIsPinnedToTaskbarDetermined(const std::string& callback_id,
44 bool is_pinned_to_taskbar);
45
46 std::unique_ptr<content::UtilityProcessMojoClient<mojom::ShellHandler>>
47 client_;
48 base::OneShotTimer timer_;
49
28 DISALLOW_COPY_AND_ASSIGN(WelcomeWin10Handler); 50 DISALLOW_COPY_AND_ASSIGN(WelcomeWin10Handler);
29 }; 51 };
30 52
31 #endif // CHROME_BROWSER_UI_WEBUI_WELCOME_WIN10_HANDLER_H_ 53 #endif // CHROME_BROWSER_UI_WEBUI_WELCOME_WIN10_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698