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

Unified Diff: apps/app_window_contents.cc

Issue 25449002: Add chrome.app.window.[get|set][Min|Max][Width|Height] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase Created 7 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: apps/app_window_contents.cc
diff --git a/apps/app_window_contents.cc b/apps/app_window_contents.cc
index 4f11a10e680439f8163f41e22cbcb60c5d02d8cf..f0d3667cdbddd44ef6c90a08a6afb4e16ff3baf2 100644
--- a/apps/app_window_contents.cc
+++ b/apps/app_window_contents.cc
@@ -94,6 +94,15 @@ void AppWindowContents::NativeWindowChanged(
dictionary->SetBoolean("maximized", native_app_window->IsMaximized());
dictionary->SetBoolean("alwaysOnTop", native_app_window->IsAlwaysOnTop());
+ const ShellWindow::SizeConstraints& size_constraints =
+ host_->size_constraints();
+ gfx::Size min_size = size_constraints.GetMinimumSize();
+ gfx::Size max_size = size_constraints.GetMaximumSize();
+ dictionary->SetInteger("minWidth", min_size.width());
+ dictionary->SetInteger("minHeight", min_size.height());
+ dictionary->SetInteger("maxWidth", max_size.width());
+ dictionary->SetInteger("maxHeight", max_size.height());
+
content::RenderViewHost* rvh = web_contents_->GetRenderViewHost();
rvh->Send(new ExtensionMsg_MessageInvoke(rvh->GetRoutingID(),
host_->extension_id(),

Powered by Google App Engine
This is Rietveld 408576698