| OLD | NEW |
| 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/extensions/extension_install_prompt.h" | 5 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 return; | 487 return; |
| 488 } | 488 } |
| 489 | 489 |
| 490 const Extension::OAuth2Info& oauth2_info = extension_->oauth2_info(); | 490 const Extension::OAuth2Info& oauth2_info = extension_->oauth2_info(); |
| 491 if (oauth2_info.client_id.empty() || | 491 if (oauth2_info.client_id.empty() || |
| 492 oauth2_info.scopes.empty()) { | 492 oauth2_info.scopes.empty()) { |
| 493 ShowConfirmation(); | 493 ShowConfirmation(); |
| 494 return; | 494 return; |
| 495 } | 495 } |
| 496 | 496 |
| 497 Profile* profile = install_ui_->profile(); | 497 Profile* profile = install_ui_->profile()->GetOriginalProfile(); |
| 498 TokenService* token_service = TokenServiceFactory::GetForProfile(profile); | 498 TokenService* token_service = TokenServiceFactory::GetForProfile(profile); |
| 499 | 499 |
| 500 token_flow_.reset(new OAuth2MintTokenFlow( | 500 token_flow_.reset(new OAuth2MintTokenFlow( |
| 501 profile->GetRequestContext(), | 501 profile->GetRequestContext(), |
| 502 this, | 502 this, |
| 503 OAuth2MintTokenFlow::Parameters( | 503 OAuth2MintTokenFlow::Parameters( |
| 504 token_service->GetOAuth2LoginRefreshToken(), | 504 token_service->GetOAuth2LoginRefreshToken(), |
| 505 extension_->id(), | 505 extension_->id(), |
| 506 oauth2_info.client_id, | 506 oauth2_info.client_id, |
| 507 oauth2_info.scopes, | 507 oauth2_info.scopes, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 Browser* browser) { | 557 Browser* browser) { |
| 558 // |browser| can be NULL in unit tests. | 558 // |browser| can be NULL in unit tests. |
| 559 if (!browser) | 559 if (!browser) |
| 560 return new ExtensionInstallPrompt(NULL, NULL, NULL); | 560 return new ExtensionInstallPrompt(NULL, NULL, NULL); |
| 561 gfx::NativeWindow parent = | 561 gfx::NativeWindow parent = |
| 562 browser->window() ? browser->window()->GetNativeWindow() : NULL; | 562 browser->window() ? browser->window()->GetNativeWindow() : NULL; |
| 563 return new ExtensionInstallPrompt(parent, browser, browser->profile()); | 563 return new ExtensionInstallPrompt(parent, browser, browser->profile()); |
| 564 } | 564 } |
| 565 | 565 |
| 566 } // namespace chrome | 566 } // namespace chrome |
| OLD | NEW |