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

Unified Diff: chrome/browser/ui/views/extensions/shell_window_views.cc

Issue 11369237: Add a way to fetch window frame metrics from NativeShellWindow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GetFrameInsets Created 8 years, 1 month 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/views/extensions/shell_window_views.cc
diff --git a/chrome/browser/ui/views/extensions/shell_window_views.cc b/chrome/browser/ui/views/extensions/shell_window_views.cc
index 098849b03a5dc2f6c43cea45cc1d150415cd83a2..2864b475b9f76c54847f20819287f240c8cd0047 100644
--- a/chrome/browser/ui/views/extensions/shell_window_views.cc
+++ b/chrome/browser/ui/views/extensions/shell_window_views.cc
@@ -409,9 +409,8 @@ ShellWindowViews::ShellWindowViews(ShellWindow* shell_window,
minimum_size_ = win_params.minimum_size;
maximum_size_ = win_params.maximum_size;
window_->Init(params);
- gfx::Rect window_bounds =
- window_->non_client_view()->GetWindowBoundsForClientBounds(
- win_params.bounds);
+ gfx::Rect window_bounds = win_params.bounds;
+ window_bounds.Inset(-GetFrameInsets());
stevenjb 2012/11/15 18:22:47 Even though this is more verbose, I think it is mo
// Center window if no position was specified.
if (win_params.bounds.x() == INT_MIN || win_params.bounds.y() == INT_MIN) {
window_->CenterWindow(window_bounds.size());
@@ -574,6 +573,13 @@ bool ShellWindowViews::IsAlwaysOnTop() const {
return false;
}
+gfx::Insets ShellWindowViews::GetFrameInsets() const {
+ if (frameless())
+ return gfx::Insets();
+
+ return gfx::Insets(kCaptionHeight, 0, 0, 0);
stevenjb 2012/11/15 18:22:47 And this turned out much easier to read, so I thin
+}
+
void ShellWindowViews::DeleteDelegate() {
shell_window_->OnNativeClose();
}
« chrome/browser/ui/base_window.h ('K') | « chrome/browser/ui/views/extensions/shell_window_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698