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

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: 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 8d546a47c12c4ce8c75cf875a2386698f8502ad6..9f3ee046e8a6ac30055f670e17de81d71bb0156b 100644
--- a/chrome/browser/ui/extensions/shell_window.cc
+++ b/chrome/browser/ui/extensions/shell_window.cc
@@ -465,8 +465,26 @@ void ShellWindow::AddMessageToDevToolsConsole(ConsoleMessageLevel level,
rvh->GetRoutingID(), level, message));
}
-void ShellWindow::SaveWindowPosition()
-{
+void ShellWindow::SendBoundsUpdate() {
+ gfx::Rect bounds = native_window_->GetBounds();
+ content::RenderViewHost* rvh = web_contents_->GetRenderViewHost();
+ ListValue args;
+ DictionaryValue* update = new DictionaryValue();
+ args.Append(update);
+ update->SetInteger("x", bounds.x());
+ update->SetInteger("y", 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();
jeremya 2012/10/19 00:26:45 I don't think SaveWindowPosition is sufficient her
if (window_key_.empty())
return;

Powered by Google App Engine
This is Rietveld 408576698