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

Unified Diff: chrome/browser/managed_mode/managed_user_registration_utility.cc

Issue 22409002: Remove managed user registration timeout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/managed_mode/managed_user_registration_utility.cc
diff --git a/chrome/browser/managed_mode/managed_user_registration_utility.cc b/chrome/browser/managed_mode/managed_user_registration_utility.cc
index cc4ea803ee6f4be14a8ca3c38704a9156e6b4dd7..d782fce71c5dea8670bd1e6c1c394081c84d5b92 100644
--- a/chrome/browser/managed_mode/managed_user_registration_utility.cc
+++ b/chrome/browser/managed_mode/managed_user_registration_utility.cc
@@ -6,7 +6,6 @@
#include "base/base64.h"
#include "base/bind.h"
-#include "base/command_line.h"
#include "base/memory/scoped_ptr.h"
#include "base/prefs/pref_service.h"
#include "base/rand_util.h"
@@ -20,16 +19,12 @@
#include "chrome/browser/signin/profile_oauth2_token_service.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/sync/glue/device_info.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "google_apis/gaia/gaia_urls.h"
#include "google_apis/gaia/google_service_auth_error.h"
using base::DictionaryValue;
-// How long to wait before aborting user registration. If this is changed, the
-// histogram limits in the BrowserOptionsHandler should also be updated.
-const int kRegistrationTimeoutMS = 30 * 1000;
const char kAcknowledged[] = "acknowledged";
const char kName[] = "name";
const char kMasterKey[] = "masterKey";
@@ -85,7 +80,6 @@ void ManagedUserRegistrationUtility::Register(
DCHECK(pending_managed_user_id_.empty());
callback_ = callback;
pending_managed_user_id_ = managed_user_id;
- StartRegistrationTimer();
const DictionaryValue* dict = prefs_->GetDictionary(prefs::kManagedUsers);
is_existing_managed_user_ = dict->HasKey(managed_user_id);
@@ -103,22 +97,6 @@ void ManagedUserRegistrationUtility::Register(
weak_ptr_factory_.GetWeakPtr(), info.name));
}
-void ManagedUserRegistrationUtility::StartRegistrationTimer() {
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kNoManagedUserRegistrationTimeout)) {
- return;
- }
-
- registration_timer_.Start(
- FROM_HERE,
- base::TimeDelta::FromMilliseconds(kRegistrationTimeoutMS),
- base::Bind(
- &ManagedUserRegistrationUtility::AbortPendingRegistration,
- weak_ptr_factory_.GetWeakPtr(),
- true, // Run the callback.
- GoogleServiceAuthError(GoogleServiceAuthError::CONNECTION_FAILED)));
-}
-
void ManagedUserRegistrationUtility::CancelPendingRegistration() {
AbortPendingRegistration(
false, // Don't run the callback. The error will be ignored.
@@ -181,7 +159,6 @@ void ManagedUserRegistrationUtility::AbortPendingRegistration(
void ManagedUserRegistrationUtility::CompleteRegistration(
bool run_callback,
const GoogleServiceAuthError& error) {
- registration_timer_.Stop();
if (callback_.is_null())
return;

Powered by Google App Engine
This is Rietveld 408576698