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

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

Issue 485073002: Migrate signin error messages to the new avatar bubble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed cros error Created 6 years, 4 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 | Annotate | Revision Log
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_impl.h" 5 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h"
6 6
7 #include <string> 7 #include <string>
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"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/signin/about_signin_internals_factory.h" 15 #include "chrome/browser/signin/about_signin_internals_factory.h"
16 #include "chrome/browser/signin/chrome_signin_client_factory.h" 16 #include "chrome/browser/signin/chrome_signin_client_factory.h"
17 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 17 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
18 #include "chrome/browser/signin/signin_manager_factory.h" 18 #include "chrome/browser/signin/signin_manager_factory.h"
19 #include "chrome/browser/sync/profile_sync_service.h" 19 #include "chrome/browser/sync/profile_sync_service.h"
20 #include "chrome/browser/sync/profile_sync_service_factory.h" 20 #include "chrome/browser/sync/profile_sync_service_factory.h"
21 #include "chrome/browser/ui/browser_finder.h" 21 #include "chrome/browser/ui/browser_finder.h"
22 #include "chrome/browser/ui/browser_window.h" 22 #include "chrome/browser/ui/browser_window.h"
23 #include "chrome/browser/ui/sync/one_click_signin_helper.h" 23 #include "chrome/browser/ui/sync/one_click_signin_helper.h"
24 #include "chrome/browser/ui/sync/one_click_signin_histogram.h" 24 #include "chrome/browser/ui/sync/one_click_signin_histogram.h"
25 #include "chrome/browser/ui/tabs/tab_strip_model.h" 25 #include "chrome/browser/ui/tabs/tab_strip_model.h"
26 #include "chrome/browser/ui/webui/signin/inline_login_ui.h" 26 #include "chrome/browser/ui/webui/signin/inline_login_ui.h"
27 #include "chrome/browser/ui/webui/signin/login_ui_service.h"
28 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
27 #include "chrome/common/url_constants.h" 29 #include "chrome/common/url_constants.h"
28 #include "components/signin/core/browser/about_signin_internals.h" 30 #include "components/signin/core/browser/about_signin_internals.h"
29 #include "components/signin/core/browser/profile_oauth2_token_service.h" 31 #include "components/signin/core/browser/profile_oauth2_token_service.h"
30 #include "components/signin/core/browser/signin_error_controller.h" 32 #include "components/signin/core/browser/signin_error_controller.h"
31 #include "components/signin/core/browser/signin_oauth_helper.h" 33 #include "components/signin/core/browser/signin_oauth_helper.h"
32 #include "components/signin/core/common/profile_management_switches.h" 34 #include "components/signin/core/common/profile_management_switches.h"
33 #include "content/public/browser/storage_partition.h" 35 #include "content/public/browser/storage_partition.h"
34 #include "content/public/browser/web_ui.h" 36 #include "content/public/browser/web_ui.h"
35 #include "google_apis/gaia/gaia_auth_fetcher.h" 37 #include "google_apis/gaia/gaia_auth_fetcher.h"
36 #include "google_apis/gaia/gaia_auth_util.h" 38 #include "google_apis/gaia/gaia_auth_util.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 confirm_untrusted_signin_); 376 confirm_untrusted_signin_);
375 377
376 web_ui()->CallJavascriptFunction("inline.login.closeDialog"); 378 web_ui()->CallJavascriptFunction("inline.login.closeDialog");
377 } 379 }
378 380
379 void InlineLoginHandlerImpl::HandleLoginError(const std::string& error_msg) { 381 void InlineLoginHandlerImpl::HandleLoginError(const std::string& error_msg) {
380 SyncStarterCallback(OneClickSigninSyncStarter::SYNC_SETUP_FAILURE); 382 SyncStarterCallback(OneClickSigninSyncStarter::SYNC_SETUP_FAILURE);
381 383
382 Browser* browser = GetDesktopBrowser(); 384 Browser* browser = GetDesktopBrowser();
383 if (browser && !error_msg.empty()) { 385 if (browser && !error_msg.empty()) {
384 VLOG(1) << "InlineLoginHandlerImpl::HandleLoginError shows error message: " 386 LoginUIServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))->
385 << error_msg; 387 DisplayLoginResult(browser, base::UTF8ToUTF16(error_msg));
386 OneClickSigninHelper::ShowSigninErrorBubble(browser, error_msg);
387 } 388 }
388 } 389 }
389 390
390 Browser* InlineLoginHandlerImpl::GetDesktopBrowser() { 391 Browser* InlineLoginHandlerImpl::GetDesktopBrowser() {
391 Browser* browser = chrome::FindBrowserWithWebContents( 392 Browser* browser = chrome::FindBrowserWithWebContents(
392 web_ui()->GetWebContents()); 393 web_ui()->GetWebContents());
393 if (!browser) { 394 if (!browser) {
394 browser = chrome::FindLastActiveWithProfile( 395 browser = chrome::FindLastActiveWithProfile(
395 Profile::FromWebUI(web_ui()), chrome::GetActiveDesktop()); 396 Profile::FromWebUI(web_ui()), chrome::GetActiveDesktop());
396 } 397 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 } 439 }
439 } 440 }
440 441
441 if (show_account_management) { 442 if (show_account_management) {
442 browser->window()->ShowAvatarBubbleFromAvatarButton( 443 browser->window()->ShowAvatarBubbleFromAvatarButton(
443 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, 444 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT,
444 signin::ManageAccountsParams()); 445 signin::ManageAccountsParams());
445 } 446 }
446 } 447 }
447 } 448 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/profiles/profile_chooser_view.cc ('k') | chrome/browser/ui/webui/signin/login_ui_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698