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

Side by Side Diff: chrome/browser/ui/webui/sync_setup_handler.cc

Issue 10911203: Show proper title for spinner dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/resources/sync_setup_overlay.html ('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/ui/webui/sync_setup_handler.h" 5 #include "chrome/browser/ui/webui/sync_setup_handler.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 create_account + UTF8ToUTF16("</a>"); 277 create_account + UTF8ToUTF16("</a>");
278 localized_strings->SetString("createAccountLinkHTML", 278 localized_strings->SetString("createAccountLinkHTML",
279 GetStringFUTF16(IDS_SYNC_CREATE_ACCOUNT_PREFIX, create_account)); 279 GetStringFUTF16(IDS_SYNC_CREATE_ACCOUNT_PREFIX, create_account));
280 280
281 string16 sync_benefits_url( 281 string16 sync_benefits_url(
282 UTF8ToUTF16(google_util::StringAppendGoogleLocaleParam( 282 UTF8ToUTF16(google_util::StringAppendGoogleLocaleParam(
283 chrome::kSyncLearnMoreURL))); 283 chrome::kSyncLearnMoreURL)));
284 localized_strings->SetString("promoLearnMoreURL", sync_benefits_url); 284 localized_strings->SetString("promoLearnMoreURL", sync_benefits_url);
285 285
286 static OptionsStringResource resources[] = { 286 static OptionsStringResource resources[] = {
287 { "syncSetupConfigureTitle", IDS_SYNC_SETUP_CONFIGURE_TITLE }, 287 { "syncSetupConfigureTitle", IDS_SYNC_SETUP_CONFIGURE_TITLE },
Nicolas Zea 2012/09/11 12:58:30 is this still used or can it be removed?
kochi 2012/09/11 13:40:12 This is still used for the "Advanced sync configur
288 { "syncSetupSpinnerTitle", IDS_SYNC_SETUP_SPINNER_TITLE },
288 { "syncSetupTimeoutTitle", IDS_SYNC_SETUP_TIME_OUT_TITLE }, 289 { "syncSetupTimeoutTitle", IDS_SYNC_SETUP_TIME_OUT_TITLE },
289 { "syncSetupTimeoutContent", IDS_SYNC_SETUP_TIME_OUT_CONTENT }, 290 { "syncSetupTimeoutContent", IDS_SYNC_SETUP_TIME_OUT_CONTENT },
290 { "cannotBeBlank", IDS_SYNC_CANNOT_BE_BLANK }, 291 { "cannotBeBlank", IDS_SYNC_CANNOT_BE_BLANK },
291 { "emailLabel", IDS_SYNC_LOGIN_EMAIL_NEW_LINE }, 292 { "emailLabel", IDS_SYNC_LOGIN_EMAIL_NEW_LINE },
292 { "passwordLabel", IDS_SYNC_LOGIN_PASSWORD_NEW_LINE }, 293 { "passwordLabel", IDS_SYNC_LOGIN_PASSWORD_NEW_LINE },
293 { "invalidCredentials", IDS_SYNC_INVALID_USER_CREDENTIALS }, 294 { "invalidCredentials", IDS_SYNC_INVALID_USER_CREDENTIALS },
294 { "signin", IDS_SYNC_SIGNIN }, 295 { "signin", IDS_SYNC_SIGNIN },
295 { "couldNotConnect", IDS_SYNC_LOGIN_COULD_NOT_CONNECT }, 296 { "couldNotConnect", IDS_SYNC_LOGIN_COULD_NOT_CONNECT },
296 { "unrecoverableError", IDS_SYNC_UNRECOVERABLE_ERROR }, 297 { "unrecoverableError", IDS_SYNC_UNRECOVERABLE_ERROR },
297 { "errorLearnMore", IDS_LEARN_MORE }, 298 { "errorLearnMore", IDS_LEARN_MORE },
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 return false; 584 return false;
584 } 585 }
585 586
586 // Notify services that login UI is now active. 587 // Notify services that login UI is now active.
587 GetLoginUIService()->SetLoginUI(this); 588 GetLoginUIService()->SetLoginUI(this);
588 service->SetSetupInProgress(true); 589 service->SetSetupInProgress(true);
589 590
590 return true; 591 return true;
591 } 592 }
592 593
593 // TODO(kochi): Handle error conditions (timeout, other failures).
594 // http://crbug.com/128692
595 void SyncSetupHandler::DisplaySpinner() { 594 void SyncSetupHandler::DisplaySpinner() {
596 configuring_sync_ = true; 595 configuring_sync_ = true;
597 StringValue page("spinner"); 596 StringValue page("spinner");
598 DictionaryValue args; 597 DictionaryValue args;
599 598
600 const int kTimeoutSec = 30; 599 const int kTimeoutSec = 30;
601 DCHECK(!backend_start_timer_.get()); 600 DCHECK(!backend_start_timer_.get());
602 backend_start_timer_.reset(new base::OneShotTimer<SyncSetupHandler>()); 601 backend_start_timer_.reset(new base::OneShotTimer<SyncSetupHandler>());
603 backend_start_timer_->Start(FROM_HERE, 602 backend_start_timer_->Start(FROM_HERE,
604 base::TimeDelta::FromSeconds(kTimeoutSec), 603 base::TimeDelta::FromSeconds(kTimeoutSec),
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 if (i != current_profile_index && AreUserNamesEqual( 1087 if (i != current_profile_index && AreUserNamesEqual(
1089 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { 1088 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) {
1090 *error_message = l10n_util::GetStringUTF16( 1089 *error_message = l10n_util::GetStringUTF16(
1091 IDS_SYNC_USER_NAME_IN_USE_ERROR); 1090 IDS_SYNC_USER_NAME_IN_USE_ERROR);
1092 return false; 1091 return false;
1093 } 1092 }
1094 } 1093 }
1095 1094
1096 return true; 1095 return true;
1097 } 1096 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/sync_setup_overlay.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698