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

Side by Side Diff: chrome/browser/extensions/window_controller.cc

Issue 12803011: Add BaseWindow::GetContentBounds() and use in WindowController::CreateWindowValue() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix osx build Created 7 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/extensions/window_open_apitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/window_controller.h" 5 #include "chrome/browser/extensions/window_controller.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" 8 #include "chrome/browser/extensions/api/tabs/tabs_constants.h"
9 #include "chrome/browser/extensions/window_controller_list.h" 9 #include "chrome/browser/extensions/window_controller_list.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } else if (window()->IsFullscreen()) { 44 } else if (window()->IsFullscreen()) {
45 window_state = keys::kShowStateValueFullscreen; 45 window_state = keys::kShowStateValueFullscreen;
46 } else if (window()->IsMaximized()) { 46 } else if (window()->IsMaximized()) {
47 window_state = keys::kShowStateValueMaximized; 47 window_state = keys::kShowStateValueMaximized;
48 } else { 48 } else {
49 window_state = keys::kShowStateValueNormal; 49 window_state = keys::kShowStateValueNormal;
50 } 50 }
51 result->SetString(keys::kShowStateKey, window_state); 51 result->SetString(keys::kShowStateKey, window_state);
52 52
53 gfx::Rect bounds; 53 gfx::Rect bounds;
54 if (window()->IsMinimized()) 54 bounds = window()->GetContentBounds();
55 bounds = window()->GetRestoredBounds();
56 else
57 bounds = window()->GetBounds();
58 result->SetInteger(keys::kLeftKey, bounds.x()); 55 result->SetInteger(keys::kLeftKey, bounds.x());
59 result->SetInteger(keys::kTopKey, bounds.y()); 56 result->SetInteger(keys::kTopKey, bounds.y());
60 result->SetInteger(keys::kWidthKey, bounds.width()); 57 result->SetInteger(keys::kWidthKey, bounds.width());
61 result->SetInteger(keys::kHeightKey, bounds.height()); 58 result->SetInteger(keys::kHeightKey, bounds.height());
62 59
63 return result; 60 return result;
64 } 61 }
65 62
66 } // namespace extensions 63 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/window_open_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698