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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "apps/app_window_contents.h" 5 #include "apps/app_window_contents.h"
6 6
7 #include "apps/ui/native_app_window.h" 7 #include "apps/ui/native_app_window.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/common/extensions/api/app_window.h" 10 #include "chrome/common/extensions/api/app_window.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 update.top.reset(new int(bounds.y())); 87 update.top.reset(new int(bounds.y()));
88 update.width.reset(new int(bounds.width())); 88 update.width.reset(new int(bounds.width()));
89 update.height.reset(new int(bounds.height())); 89 update.height.reset(new int(bounds.height()));
90 dictionary->Set("bounds", update.ToValue().release()); 90 dictionary->Set("bounds", update.ToValue().release());
91 dictionary->SetBoolean("fullscreen", 91 dictionary->SetBoolean("fullscreen",
92 native_app_window->IsFullscreenOrPending()); 92 native_app_window->IsFullscreenOrPending());
93 dictionary->SetBoolean("minimized", native_app_window->IsMinimized()); 93 dictionary->SetBoolean("minimized", native_app_window->IsMinimized());
94 dictionary->SetBoolean("maximized", native_app_window->IsMaximized()); 94 dictionary->SetBoolean("maximized", native_app_window->IsMaximized());
95 dictionary->SetBoolean("alwaysOnTop", native_app_window->IsAlwaysOnTop()); 95 dictionary->SetBoolean("alwaysOnTop", native_app_window->IsAlwaysOnTop());
96 96
97 const ShellWindow::SizeConstraints& size_constraints =
98 host_->size_constraints();
99 gfx::Size min_size = size_constraints.GetMinimumSize();
100 gfx::Size max_size = size_constraints.GetMaximumSize();
101 dictionary->SetInteger("minWidth", min_size.width());
102 dictionary->SetInteger("minHeight", min_size.height());
103 dictionary->SetInteger("maxWidth", max_size.width());
104 dictionary->SetInteger("maxHeight", max_size.height());
105
97 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); 106 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost();
98 rvh->Send(new ExtensionMsg_MessageInvoke(rvh->GetRoutingID(), 107 rvh->Send(new ExtensionMsg_MessageInvoke(rvh->GetRoutingID(),
99 host_->extension_id(), 108 host_->extension_id(),
100 "app.window", 109 "app.window",
101 "updateAppWindowProperties", 110 "updateAppWindowProperties",
102 args, 111 args,
103 false)); 112 false));
104 } 113 }
105 114
106 void AppWindowContents::NativeWindowClosed() { 115 void AppWindowContents::NativeWindowClosed() {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 content::RenderViewHost* rvh) { 177 content::RenderViewHost* rvh) {
169 DCHECK(rvh); 178 DCHECK(rvh);
170 content::BrowserThread::PostTask( 179 content::BrowserThread::PostTask(
171 content::BrowserThread::IO, FROM_HERE, 180 content::BrowserThread::IO, FROM_HERE,
172 base::Bind(&content::ResourceDispatcherHost::BlockRequestsForRoute, 181 base::Bind(&content::ResourceDispatcherHost::BlockRequestsForRoute,
173 base::Unretained(content::ResourceDispatcherHost::Get()), 182 base::Unretained(content::ResourceDispatcherHost::Get()),
174 rvh->GetProcess()->GetID(), rvh->GetRoutingID())); 183 rvh->GetProcess()->GetID(), rvh->GetRoutingID()));
175 } 184 }
176 185
177 } // namespace apps 186 } // namespace apps
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698