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

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

Issue 2401853005: Adding client code for new Windows 10 First Run Experience (Closed)
Patch Set: Using Polymer dom-bind Created 4 years, 2 months 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/welcome_win10_handler.h"
6
7 #include <string>
8
9 #include "base/bind.h"
10 #include "chrome/browser/shell_integration.h"
11 #include "chrome/common/url_constants.h"
12 #include "content/public/browser/web_contents.h"
13
14 WelcomeWin10Handler::WelcomeWin10Handler(content::WebUI* web_ui) {}
michaelpg 2016/10/22 03:19:01 don't take an unused parameter
Patrick Monette 2016/10/24 20:49:39 Removed. As an aside, it's a bit weird that web_u
15
16 WelcomeWin10Handler::~WelcomeWin10Handler() = default;
17
18 void WelcomeWin10Handler::HandleSetDefaultBrowser(const base::ListValue* args) {
michaelpg 2016/10/22 03:19:01 order by header file declaration (ie public, then
Patrick Monette 2016/10/24 20:49:40 Done.
19 (new shell_integration::DefaultBrowserWorker(
20 shell_integration::DefaultWebClientWorkerCallback()))
21 ->StartSetAsDefault();
22 }
23
24 void WelcomeWin10Handler::HandleContinue(const base::ListValue* args) {
25 web_ui()->GetWebContents()->GetController().LoadURL(
26 GURL(chrome::kChromeUINewTabURL), content::Referrer(),
27 ui::PageTransition::PAGE_TRANSITION_LINK, std::string());
28 }
29
30 // Override from WebUIMessageHandler.
31 void WelcomeWin10Handler::RegisterMessages() {
32 web_ui()->RegisterMessageCallback(
33 "handleSetDefaultBrowser",
34 base::Bind(&WelcomeWin10Handler::HandleSetDefaultBrowser,
35 base::Unretained(this)));
36 web_ui()->RegisterMessageCallback(
37 "handleContinue",
38 base::Bind(&WelcomeWin10Handler::HandleContinue, base::Unretained(this)));
39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698