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

Side by Side Diff: chrome/browser/extensions/extension_install_prompt.cc

Issue 10983042: Revert 158590 - Extensions: Fix a crash installing an app w/ oauth2 scopes in incognito. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 | « no previous file | 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/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
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()->GetOriginalProfile(); 497 Profile* profile = install_ui_->profile();
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698