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

Side by Side Diff: chrome/browser/sync/sync_global_error.cc

Issue 11618024: [signin] Support for CrOS and OAuth2AccessTokenConsumer services. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor fixes Created 8 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
« no previous file with comments | « chrome/browser/sync/sync_global_error.h ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/sync/sync_global_error.h" 5 #include "chrome/browser/sync/sync_global_error.h"
6 6
7 #include "base/utf_string_conversions.h"
7 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/api/sync/profile_sync_service_observer.h" 9 #include "chrome/browser/api/sync/profile_sync_service_observer.h"
10 #include "chrome/browser/signin/about_signin_internals.h"
11 #include "chrome/browser/signin/about_signin_internals_factory.h"
9 #include "chrome/browser/sync/profile_sync_service.h" 12 #include "chrome/browser/sync/profile_sync_service.h"
10 #include "chrome/browser/sync/sync_ui_util.h" 13 #include "chrome/browser/sync/sync_ui_util.h"
11 #include "chrome/browser/ui/browser.h" 14 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/browser_commands.h" 15 #include "chrome/browser/ui/browser_commands.h"
13 #include "chrome/browser/ui/chrome_pages.h" 16 #include "chrome/browser/ui/chrome_pages.h"
14 #include "chrome/browser/ui/global_error/global_error_service.h" 17 #include "chrome/browser/ui/global_error/global_error_service.h"
15 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 18 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
16 #include "chrome/browser/ui/webui/signin/login_ui_service.h" 19 #include "chrome/browser/ui/webui/signin/login_ui_service.h"
17 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" 20 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
18 #include "chrome/common/url_constants.h" 21 #include "chrome/common/url_constants.h"
22 #include "google_apis/gaia/gaia_constants.h"
19 #include "google_apis/gaia/google_service_auth_error.h" 23 #include "google_apis/gaia/google_service_auth_error.h"
20 #include "grit/chromium_strings.h" 24 #include "grit/chromium_strings.h"
21 #include "grit/generated_resources.h" 25 #include "grit/generated_resources.h"
22 #include "ui/base/l10n/l10n_util.h" 26 #include "ui/base/l10n/l10n_util.h"
23 27
24 typedef GoogleServiceAuthError AuthError; 28 typedef GoogleServiceAuthError AuthError;
25 29
26 SyncGlobalError::SyncGlobalError(ProfileSyncService* service, 30 SyncGlobalError::SyncGlobalError(ProfileSyncService* service,
27 SigninManager* signin) 31 SigninManager* signin)
28 : service_(service), 32 : service_(service),
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 bubble_accept_label != bubble_accept_label_) { 129 bubble_accept_label != bubble_accept_label_) {
126 menu_label_ = menu_label; 130 menu_label_ = menu_label;
127 bubble_message_ = bubble_message; 131 bubble_message_ = bubble_message;
128 bubble_accept_label_ = bubble_accept_label; 132 bubble_accept_label_ = bubble_accept_label;
129 133
130 // Profile can be NULL during tests. 134 // Profile can be NULL during tests.
131 Profile* profile = service_->profile(); 135 Profile* profile = service_->profile();
132 if (profile) { 136 if (profile) {
133 GlobalErrorServiceFactory::GetForProfile( 137 GlobalErrorServiceFactory::GetForProfile(
134 profile)->NotifyErrorsChanged(this); 138 profile)->NotifyErrorsChanged(this);
139
140 // Also push these errors to the about:signin-internals page.
141 string16 consolidated_error_msg = menu_label_;
142 consolidated_error_msg.append(bubble_message_.c_str());
143 NotifyTokenFailureOccurred(consolidated_error_msg);
135 } 144 }
136 } 145 }
137 } 146 }
138 147
139 bool SyncGlobalError::HasCustomizedSyncMenuItem() { 148 bool SyncGlobalError::HasCustomizedSyncMenuItem() {
140 return !menu_label_.empty(); 149 return !menu_label_.empty();
141 } 150 }
151
152 // TODO(vishwath): Ensure that it's not incorrect to be overwriting
153 // regular token fetch status for the syncservice token.
154 void SyncGlobalError::NotifyTokenFailureOccurred(const string16& error_msg) {
155 DCHECK(service_->profile());
156 AboutSigninInternalsFactory::GetForProfile(service_->profile())->
157 NotifyTokenReceivedFailure(GaiaConstants::kSyncService,
158 UTF16ToUTF8(error_msg));
159 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/sync_global_error.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698