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

Unified Diff: chrome/browser/ui/extensions/shell_window.cc

Issue 11193049: Add the app.windows.getBounds method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge from trunk 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
Index: chrome/browser/ui/extensions/shell_window.cc
diff --git a/chrome/browser/ui/extensions/shell_window.cc b/chrome/browser/ui/extensions/shell_window.cc
index e15731934b9c19c8d614463d37015ea9232bbf92..7413de3ca15d59a37f9454bda1ec61630c4cc734 100644
--- a/chrome/browser/ui/extensions/shell_window.cc
+++ b/chrome/browser/ui/extensions/shell_window.cc
@@ -464,8 +464,28 @@ void ShellWindow::AddMessageToDevToolsConsole(ConsoleMessageLevel level,
rvh->GetRoutingID(), level, message));
}
-void ShellWindow::SaveWindowPosition()
-{
+void ShellWindow::SendBoundsUpdate() {
+ if (!native_window_ || !web_contents_)
+ return;
+ gfx::Rect bounds = native_window_->GetBounds();
+ content::RenderViewHost* rvh = web_contents_->GetRenderViewHost();
+ ListValue args;
+ DictionaryValue* update = new DictionaryValue();
+ args.Append(update);
+ update->SetInteger("left", bounds.x());
+ update->SetInteger("top", bounds.y());
+ update->SetInteger("width", bounds.width());
+ update->SetInteger("height", bounds.height());
+ rvh->Send(new ExtensionMsg_MessageInvoke(rvh->GetRoutingID(),
+ extension_->id(),
+ "updateAppWindowBounds",
+ args,
+ GURL(),
+ false));
+}
+
+void ShellWindow::SaveWindowPosition() {
+ SendBoundsUpdate();
if (window_key_.empty())
return;

Powered by Google App Engine
This is Rietveld 408576698