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

Side by Side Diff: chrome/browser/ui/webui/signin/inline_login_handler.cc

Issue 120343004: Reland r242290, r241609, r242134. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 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/signin/inline_login_handler.h"
6
7 #include "base/bind.h"
8 #include "base/values.h"
9 #include "chrome/browser/browser_process.h"
10 #include "content/public/browser/web_ui.h"
11 #include "google_apis/gaia/gaia_urls.h"
12
13 InlineLoginHandler::InlineLoginHandler() {}
14
15 InlineLoginHandler::~InlineLoginHandler() {}
16
17 void InlineLoginHandler::RegisterMessages() {
18 web_ui()->RegisterMessageCallback("initialize",
19 base::Bind(&InlineLoginHandler::HandleInitializeMessage,
20 base::Unretained(this)));
21 web_ui()->RegisterMessageCallback("completeLogin",
22 base::Bind(&InlineLoginHandler::HandleCompleteLoginMessage,
23 base::Unretained(this)));
24 }
25
26 void InlineLoginHandler::HandleInitializeMessage(const base::ListValue* args) {
27 base::DictionaryValue params;
28
29 const std::string& app_locale = g_browser_process->GetApplicationLocale();
30 params.SetString("hl", app_locale);
31 GaiaUrls* gaiaUrls = GaiaUrls::GetInstance();
32 params.SetString("gaiaUrl", gaiaUrls->gaia_url().spec());
33 params.SetInteger("authMode", kDefaultAuthMode);
34
35 SetExtraInitParams(params);
36
37 web_ui()->CallJavascriptFunction("inline.login.loadAuthExtension", params);
38 }
39
40 void InlineLoginHandler::HandleCompleteLoginMessage(
41 const base::ListValue* args) {
42 CompleteLogin(args);
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698