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

Unified Diff: chrome/browser/extensions/api/identity/identity_api.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
« 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
diff --git a/chrome/browser/extensions/api/identity/identity_api.cc b/chrome/browser/extensions/api/identity/identity_api.cc
index f3e5c2cbfd863c4e2258805b60b94590632fafb2..f989454d069ec843ea26454817585a4b3aa778cf 100644
--- a/chrome/browser/extensions/api/identity/identity_api.cc
+++ b/chrome/browser/extensions/api/identity/identity_api.cc
@@ -38,6 +38,7 @@ const char kInvalidRedirect[] = "Did not redirect to the right URL.";
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 @@ bool IdentityLaunchWebAuthFlowFunction::RunImpl() {
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