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

Unified Diff: chrome/browser/extensions/api/identity/identity_api.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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/identity/identity_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/identity/identity_api.cc
===================================================================
--- chrome/browser/extensions/api/identity/identity_api.cc (revision 162714)
+++ chrome/browser/extensions/api/identity/identity_api.cc (working copy)
@@ -38,6 +38,7 @@
namespace GetAuthToken = extensions::api::experimental_identity::GetAuthToken;
namespace LaunchWebAuthFlow =
extensions::api::experimental_identity::LaunchWebAuthFlow;
+namespace identity = extensions::api::experimental_identity;
IdentityGetAuthTokenFunction::IdentityGetAuthTokenFunction()
: interactive_(false) {}
@@ -225,15 +226,28 @@
scoped_ptr<LaunchWebAuthFlow::Params> params(
LaunchWebAuthFlow::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
+ const identity::WebAuthFlowDetails& details = params->details;
- GURL auth_url(params->details.url);
+ GURL auth_url(details.url);
WebAuthFlow::Mode mode =
- params->details.interactive.get() && *params->details.interactive ?
+ details.interactive && *details.interactive ?
WebAuthFlow::INTERACTIVE : WebAuthFlow::SILENT;
+ // The bounds attributes are optional, but using 0 when they're not available
+ // does the right thing.
+ gfx::Rect initial_bounds;
+ if (details.width)
+ initial_bounds.set_width(*details.width);
+ if (details.height)
+ initial_bounds.set_height(*details.height);
+ if (details.left)
+ initial_bounds.set_x(*details.left);
+ if (details.top)
+ initial_bounds.set_y(*details.top);
+
AddRef(); // Balanced in OnAuthFlowSuccess/Failure.
auth_flow_.reset(new WebAuthFlow(
- this, profile(), GetExtension()->id(), auth_url, mode));
+ this, profile(), GetExtension()->id(), auth_url, mode, initial_bounds));
auth_flow_->Start();
return true;
}
« no previous file with comments | « no previous file | chrome/browser/extensions/api/identity/identity_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698