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

Unified Diff: chrome/browser/extensions/api/app_window/app_window_api.cc

Issue 11369039: Add setBounds method and browsertest for get/set bounds to app window API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 1 month 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/app_window/app_window_api.cc
diff --git a/chrome/browser/extensions/api/app_window/app_window_api.cc b/chrome/browser/extensions/api/app_window/app_window_api.cc
index 6ac4b8179e72ffc29339a7fbb68133115e9c531b..e10cee835a3f432c17cb868992d77dad91888631 100644
--- a/chrome/browser/extensions/api/app_window/app_window_api.cc
+++ b/chrome/browser/extensions/api/app_window/app_window_api.cc
@@ -209,6 +209,13 @@ bool AppWindowCreateFunction::RunImpl() {
result->Set("injectTitlebar",
base::Value::CreateBooleanValue(inject_html_titlebar));
result->Set("id", base::Value::CreateStringValue(shell_window->window_key()));
+ DictionaryValue* boundsValue = new DictionaryValue();
+ gfx::Rect bounds = shell_window->GetBaseWindow()->GetBounds();
+ boundsValue->SetInteger("left", bounds.x());
+ boundsValue->SetInteger("top", bounds.y());
+ boundsValue->SetInteger("width", bounds.width());
+ boundsValue->SetInteger("height", bounds.height());
+ result->Set("bounds", boundsValue);
SetResult(result);
if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) {

Powered by Google App Engine
This is Rietveld 408576698