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

Unified Diff: chrome/browser/automation/automation_provider.cc

Issue 149233: Adds a way to set the boundaries of the browser window through... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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
« no previous file with comments | « chrome/browser/automation/automation_provider.h ('k') | chrome/common/temp_scaffolding_stubs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/automation_provider.cc
===================================================================
--- chrome/browser/automation/automation_provider.cc (revision 19980)
+++ chrome/browser/automation/automation_provider.cc (working copy)
@@ -950,6 +950,7 @@
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WindowExecuteCommand,
ExecuteBrowserCommand)
IPC_MESSAGE_HANDLER(AutomationMsg_WindowViewBounds, WindowGetViewBounds)
+ IPC_MESSAGE_HANDLER(AutomationMsg_SetWindowBounds, SetWindowBounds)
IPC_MESSAGE_HANDLER(AutomationMsg_SetWindowVisible, SetWindowVisible)
#if defined(OS_WIN)
IPC_MESSAGE_HANDLER(AutomationMsg_WindowClick, WindowSimulateClick)
@@ -1713,6 +1714,18 @@
}
}
+void AutomationProvider::SetWindowBounds(int handle, const gfx::Rect& bounds,
+ bool* success) {
+ *success = false;
+ if (window_tracker_->ContainsHandle(handle)) {
+ HWND hwnd = window_tracker_->GetResource(handle);
+ if (::MoveWindow(hwnd, bounds.x(), bounds.y(), bounds.width(),
+ bounds.height(), true)) {
+ *success = true;
+ }
+ }
+}
+
void AutomationProvider::SetWindowVisible(int handle, bool visible,
bool* result) {
if (window_tracker_->ContainsHandle(handle)) {
« no previous file with comments | « chrome/browser/automation/automation_provider.h ('k') | chrome/common/temp_scaffolding_stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698