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

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

Issue 11186036: Implement size and position support for launchWebAuthFlow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit tests 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
diff --git a/chrome/browser/extensions/api/identity/web_auth_flow.cc b/chrome/browser/extensions/api/identity/web_auth_flow.cc
index 0a08e7ed94cbd50c568eeaf2dc3e279a377dda8e..2a5ea29d5afefa8b60227d6bd566f48d38934027 100644
--- a/chrome/browser/extensions/api/identity/web_auth_flow.cc
+++ b/chrome/browser/extensions/api/identity/web_auth_flow.cc
@@ -48,11 +48,13 @@ WebAuthFlow::WebAuthFlow(
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 @@ void WebAuthFlow::ShowAuthFlowPopup() {
// 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 @@ void WebAuthFlow::Observe(int type,
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