OLD | NEW |
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/signin/chrome_signin_client.h" | 5 #include "chrome/browser/signin/chrome_signin_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/memory/ptr_util.h" |
12 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
14 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
15 #include "chrome/browser/content_settings/cookie_settings_factory.h" | 16 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
16 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 17 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
17 #include "chrome/browser/profiles/profile_attributes_entry.h" | 18 #include "chrome/browser/profiles/profile_attributes_entry.h" |
18 #include "chrome/browser/profiles/profile_attributes_storage.h" | 19 #include "chrome/browser/profiles/profile_attributes_storage.h" |
19 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
20 #include "chrome/browser/profiles/profile_metrics.h" | 21 #include "chrome/browser/profiles/profile_metrics.h" |
21 #include "chrome/browser/profiles/profile_window.h" | 22 #include "chrome/browser/profiles/profile_window.h" |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 #else | 379 #else |
379 // Don't bother if we don't have any kind of network connection. | 380 // Don't bother if we don't have any kind of network connection. |
380 if (net::NetworkChangeNotifier::IsOffline()) { | 381 if (net::NetworkChangeNotifier::IsOffline()) { |
381 delayed_callbacks_.push_back(callback); | 382 delayed_callbacks_.push_back(callback); |
382 } else { | 383 } else { |
383 callback.Run(); | 384 callback.Run(); |
384 } | 385 } |
385 #endif | 386 #endif |
386 } | 387 } |
387 | 388 |
388 GaiaAuthFetcher* ChromeSigninClient::CreateGaiaAuthFetcher( | 389 std::unique_ptr<GaiaAuthFetcher> ChromeSigninClient::CreateGaiaAuthFetcher( |
389 GaiaAuthConsumer* consumer, | 390 GaiaAuthConsumer* consumer, |
390 const std::string& source, | 391 const std::string& source, |
391 net::URLRequestContextGetter* getter) { | 392 net::URLRequestContextGetter* getter) { |
392 return new GaiaAuthFetcher(consumer, source, getter); | 393 return base::MakeUnique<GaiaAuthFetcher>(consumer, source, getter); |
393 } | 394 } |
394 | 395 |
395 void ChromeSigninClient::MaybeFetchSigninTokenHandle() { | 396 void ChromeSigninClient::MaybeFetchSigninTokenHandle() { |
396 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 397 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
397 // We get a "handle" that can be used to reference the signin token on the | 398 // We get a "handle" that can be used to reference the signin token on the |
398 // server. We fetch this if we don't have one so that later we can check | 399 // server. We fetch this if we don't have one so that later we can check |
399 // it to know if the signin token to which it is attached has been revoked | 400 // it to know if the signin token to which it is attached has been revoked |
400 // and thus distinguish between a password mismatch due to the password | 401 // and thus distinguish between a password mismatch due to the password |
401 // being changed and the user simply mis-typing it. | 402 // being changed and the user simply mis-typing it. |
402 if (profiles::IsLockAvailable(profile_)) { | 403 if (profiles::IsLockAvailable(profile_)) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 return; | 460 return; |
460 entry->LockForceSigninProfile(true); | 461 entry->LockForceSigninProfile(true); |
461 } | 462 } |
462 | 463 |
463 void ChromeSigninClient::ShowUserManager(const base::FilePath& profile_path) { | 464 void ChromeSigninClient::ShowUserManager(const base::FilePath& profile_path) { |
464 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 465 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
465 UserManager::Show(profile_path, profiles::USER_MANAGER_NO_TUTORIAL, | 466 UserManager::Show(profile_path, profiles::USER_MANAGER_NO_TUTORIAL, |
466 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); | 467 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); |
467 #endif | 468 #endif |
468 } | 469 } |
OLD | NEW |