| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions/extension_webstore_private_api.h" | 5 #include "chrome/browser/extensions/extension_webstore_private_api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 if (cmdline->HasSwitch(switches::kAppsGalleryReturnTokens) && | 80 if (cmdline->HasSwitch(switches::kAppsGalleryReturnTokens) && |
| 81 token_service->HasTokenForService(GaiaConstants::kGaiaService)) { | 81 token_service->HasTokenForService(GaiaConstants::kGaiaService)) { |
| 82 dictionary->SetString(kTokenKey, | 82 dictionary->SetString(kTokenKey, |
| 83 token_service->GetTokenForService( | 83 token_service->GetTokenForService( |
| 84 GaiaConstants::kGaiaService)); | 84 GaiaConstants::kGaiaService)); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 return dictionary; | 87 return dictionary; |
| 88 } | 88 } |
| 89 | 89 |
| 90 // If |profile| is not off the record, returns it. Otherwise returns the real | 90 // If |profile| is not incognito, returns it. Otherwise returns the real |
| 91 // (not off the record) default profile. | 91 // (not incognito) default profile. |
| 92 Profile* GetDefaultProfile(Profile* profile) { | 92 Profile* GetDefaultProfile(Profile* profile) { |
| 93 if (!profile->IsOffTheRecord()) | 93 if (!profile->IsOffTheRecord()) |
| 94 return profile; | 94 return profile; |
| 95 else | 95 else |
| 96 return g_browser_process->profile_manager()->GetDefaultProfile(); | 96 return g_browser_process->profile_manager()->GetDefaultProfile(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace | 99 } // namespace |
| 100 | 100 |
| 101 // static | 101 // static |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 } | 316 } |
| 317 | 317 |
| 318 DCHECK(waiting_for_token_); | 318 DCHECK(waiting_for_token_); |
| 319 | 319 |
| 320 result_.reset(CreateLoginResult(GetDefaultProfile(profile_))); | 320 result_.reset(CreateLoginResult(GetDefaultProfile(profile_))); |
| 321 SendResponse(true); | 321 SendResponse(true); |
| 322 | 322 |
| 323 // Matches the AddRef in RunImpl(). | 323 // Matches the AddRef in RunImpl(). |
| 324 Release(); | 324 Release(); |
| 325 } | 325 } |
| OLD | NEW |