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

Side by Side Diff: chrome/browser/extensions/api/app_window/app_window_api.cc

Issue 11369039: Add setBounds method and browsertest for get/set bounds to app window API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/app_window/app_window_api.h" 5 #include "chrome/browser/extensions/api/app_window/app_window_api.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/debugger/devtools_window.h" 10 #include "chrome/browser/debugger/devtools_window.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 shell_window->web_contents()->GetRenderViewHost(); 202 shell_window->web_contents()->GetRenderViewHost();
203 int view_id = MSG_ROUTING_NONE; 203 int view_id = MSG_ROUTING_NONE;
204 if (create_params.creator_process_id == created_view->GetProcess()->GetID()) 204 if (create_params.creator_process_id == created_view->GetProcess()->GetID())
205 view_id = created_view->GetRoutingID(); 205 view_id = created_view->GetRoutingID();
206 206
207 base::DictionaryValue* result = new base::DictionaryValue; 207 base::DictionaryValue* result = new base::DictionaryValue;
208 result->Set("viewId", base::Value::CreateIntegerValue(view_id)); 208 result->Set("viewId", base::Value::CreateIntegerValue(view_id));
209 result->Set("injectTitlebar", 209 result->Set("injectTitlebar",
210 base::Value::CreateBooleanValue(inject_html_titlebar)); 210 base::Value::CreateBooleanValue(inject_html_titlebar));
211 result->Set("id", base::Value::CreateStringValue(shell_window->window_key())); 211 result->Set("id", base::Value::CreateStringValue(shell_window->window_key()));
212 DictionaryValue* boundsValue = new DictionaryValue();
213 gfx::Rect bounds = shell_window->GetBaseWindow()->GetBounds();
214 boundsValue->SetInteger("left", bounds.x());
215 boundsValue->SetInteger("top", bounds.y());
216 boundsValue->SetInteger("width", bounds.width());
217 boundsValue->SetInteger("height", bounds.height());
218 result->Set("bounds", boundsValue);
212 SetResult(result); 219 SetResult(result);
213 220
214 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) { 221 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) {
215 new DevToolsRestorer(this, created_view); 222 new DevToolsRestorer(this, created_view);
216 return true; 223 return true;
217 } 224 }
218 225
219 SendResponse(true); 226 SendResponse(true);
220 return true; 227 return true;
221 } 228 }
222 229
223 } // namespace extensions 230 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698