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

Side by Side Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 297853006: Make sure auth error reporting handles guest mode correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 7 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
« no previous file with comments | « chrome/browser/ui/views/profiles/new_avatar_button.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/views/profiles/profile_chooser_view.h" 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/lifetime/application_lifetime.h" 10 #include "chrome/browser/lifetime/application_lifetime.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 gfx::ImageSkia CreateSquarePlaceholderImage(int size) { 94 gfx::ImageSkia CreateSquarePlaceholderImage(int size) {
95 SkBitmap bitmap; 95 SkBitmap bitmap;
96 bitmap.setConfig(SkBitmap::kA8_Config, size, size); 96 bitmap.setConfig(SkBitmap::kA8_Config, size, size);
97 bitmap.allocPixels(); 97 bitmap.allocPixels();
98 bitmap.eraseARGB(0, 0, 0, 0); 98 bitmap.eraseARGB(0, 0, 0, 0);
99 return gfx::ImageSkia::CreateFrom1xBitmap(bitmap); 99 return gfx::ImageSkia::CreateFrom1xBitmap(bitmap);
100 } 100 }
101 101
102 bool HasAuthError(Profile* profile) { 102 bool HasAuthError(Profile* profile) {
103 SigninErrorController* error = 103 const SigninErrorController* error =
104 ProfileOAuth2TokenServiceFactory::GetForProfile(profile)-> 104 profiles::GetSigninErrorController(profile);
105 signin_error_controller();
106 return error && error->HasError(); 105 return error && error->HasError();
107 } 106 }
108 107
109 std::string GetAuthErrorAccountId(Profile* profile) { 108 std::string GetAuthErrorAccountId(Profile* profile) {
110 SigninErrorController* error = 109 const SigninErrorController* error =
111 ProfileOAuth2TokenServiceFactory::GetForProfile(profile)-> 110 profiles::GetSigninErrorController(profile);
112 signin_error_controller();
113 if (!error) 111 if (!error)
114 return std::string(); 112 return std::string();
115 113
116 return error->error_account_id(); 114 return error->error_account_id();
117 } 115 }
118 116
119 std::string GetAuthErrorUsername(Profile* profile) { 117 std::string GetAuthErrorUsername(Profile* profile) {
120 SigninErrorController* error = 118 const SigninErrorController* error =
121 ProfileOAuth2TokenServiceFactory::GetForProfile(profile)-> 119 profiles::GetSigninErrorController(profile);
122 signin_error_controller();
123 if (!error) 120 if (!error)
124 return std::string(); 121 return std::string();
125 122
126 return error->error_username(); 123 return error->error_username();
127 } 124 }
128 125
129 // BackgroundColorHoverButton ------------------------------------------------- 126 // BackgroundColorHoverButton -------------------------------------------------
130 127
131 // A custom button that allows for setting a background color when hovered over. 128 // A custom button that allows for setting a background color when hovered over.
132 class BackgroundColorHoverButton : public views::LabelButton { 129 class BackgroundColorHoverButton : public views::LabelButton {
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 layout->StartRowWithPadding( 1417 layout->StartRowWithPadding(
1421 1, 0, 0, views::kUnrelatedControlVerticalSpacing); 1418 1, 0, 0, views::kUnrelatedControlVerticalSpacing);
1422 layout->AddView(end_preview_and_relaunch_button_); 1419 layout->AddView(end_preview_and_relaunch_button_);
1423 1420
1424 TitleCard* title_card = new TitleCard( 1421 TitleCard* title_card = new TitleCard(
1425 IDS_PROFILES_END_PREVIEW, this, &end_preview_cancel_button_); 1422 IDS_PROFILES_END_PREVIEW, this, &end_preview_cancel_button_);
1426 return TitleCard::AddPaddedTitleCard( 1423 return TitleCard::AddPaddedTitleCard(
1427 view, title_card, kFixedAccountRemovalViewWidth); 1424 view, title_card, kFixedAccountRemovalViewWidth);
1428 } 1425 }
1429 1426
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/profiles/new_avatar_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698