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

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

Issue 2023763013: Properly handle dialogClose message in password separated sign in flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 #include "chrome/browser/ui/webui/signin/inline_login_handler.h" 5 #include "chrome/browser/ui/webui/signin/inline_login_handler.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 web_ui()->RegisterMessageCallback("completeLogin", 53 web_ui()->RegisterMessageCallback("completeLogin",
54 base::Bind(&InlineLoginHandler::HandleCompleteLoginMessage, 54 base::Bind(&InlineLoginHandler::HandleCompleteLoginMessage,
55 base::Unretained(this))); 55 base::Unretained(this)));
56 web_ui()->RegisterMessageCallback( 56 web_ui()->RegisterMessageCallback(
57 "switchToFullTab", 57 "switchToFullTab",
58 base::Bind(&InlineLoginHandler::HandleSwitchToFullTabMessage, 58 base::Bind(&InlineLoginHandler::HandleSwitchToFullTabMessage,
59 base::Unretained(this))); 59 base::Unretained(this)));
60 web_ui()->RegisterMessageCallback("navigationButtonClicked", 60 web_ui()->RegisterMessageCallback("navigationButtonClicked",
61 base::Bind(&InlineLoginHandler::HandleNavigationButtonClicked, 61 base::Bind(&InlineLoginHandler::HandleNavigationButtonClicked,
62 base::Unretained(this))); 62 base::Unretained(this)));
63 web_ui()->RegisterMessageCallback("dialogClose",
64 base::Bind(&InlineLoginHandler::HandleDialogClose,
65 base::Unretained(this)));
63 } 66 }
64 67
65 void InlineLoginHandler::HandleInitializeMessage(const base::ListValue* args) { 68 void InlineLoginHandler::HandleInitializeMessage(const base::ListValue* args) {
66 content::WebContents* contents = web_ui()->GetWebContents(); 69 content::WebContents* contents = web_ui()->GetWebContents();
67 content::StoragePartition* partition = 70 content::StoragePartition* partition =
68 content::BrowserContext::GetStoragePartitionForSite( 71 content::BrowserContext::GetStoragePartitionForSite(
69 contents->GetBrowserContext(), signin::GetSigninPartitionURL()); 72 contents->GetBrowserContext(), signin::GetSigninPartitionURL());
70 if (partition) { 73 if (partition) {
71 const GURL& current_url = web_ui()->GetWebContents()->GetURL(); 74 const GURL& current_url = web_ui()->GetWebContents()->GetURL();
72 75
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 web_ui()->CallJavascriptFunction("inline.login.closeDialog"); 272 web_ui()->CallJavascriptFunction("inline.login.closeDialog");
270 } 273 }
271 274
272 void InlineLoginHandler::HandleNavigationButtonClicked( 275 void InlineLoginHandler::HandleNavigationButtonClicked(
273 const base::ListValue* args) { 276 const base::ListValue* args) {
274 Browser* browser = GetDesktopBrowser(web_ui()); 277 Browser* browser = GetDesktopBrowser(web_ui());
275 DCHECK(browser); 278 DCHECK(browser);
276 279
277 browser->signin_view_controller()->delegate()->PerformNavigation(); 280 browser->signin_view_controller()->delegate()->PerformNavigation();
278 } 281 }
282
283 void InlineLoginHandler::HandleDialogClose(const base::ListValue* args) {
284 Browser* browser = GetDesktopBrowser(web_ui());
285 DCHECK(browser);
286
287 browser->CloseModalSigninWindow();
288 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/signin/inline_login_handler.h ('k') | chrome/browser/ui/webui/signin/inline_login_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698