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

Unified Diff: chrome/browser/extensions/api/identity/web_auth_flow.cc

Issue 11221002: Merge 162639 - Implement size and position support for launchWebAuthFlow. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1271/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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/identity/web_auth_flow.cc
===================================================================
--- chrome/browser/extensions/api/identity/web_auth_flow.cc (revision 162714)
+++ chrome/browser/extensions/api/identity/web_auth_flow.cc (working copy)
@@ -48,11 +48,13 @@
Profile* profile,
const std::string& extension_id,
const GURL& provider_url,
- Mode mode)
+ Mode mode,
+ const gfx::Rect& initial_bounds)
: delegate_(delegate),
profile_(profile),
provider_url_(provider_url),
mode_(mode),
+ initial_bounds_(initial_bounds),
contents_(NULL),
tab_contents_(NULL) {
InitValidRedirectUrlPrefixes(extension_id);
@@ -110,8 +112,9 @@
// Pass ownership of WebContents to TabContents.
tab_contents_ = TabContents::Factory::CreateTabContents(contents_);
contents_ = NULL;
- Browser* browser = new Browser(Browser::CreateParams(
- Browser::TYPE_POPUP, profile_));
+ Browser::CreateParams browser_params(Browser::TYPE_POPUP, profile_);
+ browser_params.initial_bounds = initial_bounds_;
+ Browser* browser = new Browser(browser_params);
chrome::NavigateParams params(browser, tab_contents_);
params.disposition = CURRENT_TAB;
params.window_action = chrome::NavigateParams::SHOW_WINDOW;
@@ -170,6 +173,8 @@
break;
case content::NOTIFICATION_WEB_CONTENTS_DESTROYED: {
// User closed the auth flow window; report a failure.
+ contents_ = NULL;
+ tab_contents_ = NULL;
ReportResult(GURL());
}
break;

Powered by Google App Engine
This is Rietveld 408576698