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

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: Rebase. Use ShellWindow::Set[Min|Max]imumSize. Update tests. 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 56ae403b2d0faff5ce3df1380f2e5920344ab3cd..8606edb7f7c3c7eb79ce30000e8f5e071dae2634 100644
--- a/apps/app_window_contents.cc
+++ b/apps/app_window_contents.cc
@@ -93,6 +93,15 @@ void AppWindowContents::NativeWindowChanged(
dictionary->SetBoolean("minimized", native_app_window->IsMinimized());
dictionary->SetBoolean("maximized", native_app_window->IsMaximized());
+ 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