OLD | NEW |
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/ui/views/extensions/shell_window_frame_view.h" | 5 #include "chrome/browser/ui/views/extensions/shell_window_frame_view.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/ui/views/extensions/native_app_window_views.h" | 8 #include "chrome/browser/ui/views/extensions/native_app_window_views.h" |
9 #include "extensions/common/draggable_region.h" | 9 #include "extensions/common/draggable_region.h" |
10 #include "grit/theme_resources.h" | 10 #include "grit/theme_resources.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 int closeButtonOffsetX = | 160 int closeButtonOffsetX = |
161 (kCaptionHeight - close_button_->height()) / 2; | 161 (kCaptionHeight - close_button_->height()) / 2; |
162 int header_width = close_button_->width() + closeButtonOffsetX * 2; | 162 int header_width = close_button_->width() + closeButtonOffsetX * 2; |
163 return gfx::Rect(client_bounds.x(), | 163 return gfx::Rect(client_bounds.x(), |
164 std::max(0, client_bounds.y() - kCaptionHeight), | 164 std::max(0, client_bounds.y() - kCaptionHeight), |
165 std::max(header_width, client_bounds.width()), | 165 std::max(header_width, client_bounds.width()), |
166 client_bounds.height() + kCaptionHeight); | 166 client_bounds.height() + kCaptionHeight); |
167 } | 167 } |
168 | 168 |
169 int ShellWindowFrameView::NonClientHitTest(const gfx::Point& point) { | 169 int ShellWindowFrameView::NonClientHitTest(const gfx::Point& point) const { |
170 if (frame_->IsFullscreen()) | 170 if (frame_->IsFullscreen()) |
171 return HTCLIENT; | 171 return HTCLIENT; |
172 | 172 |
173 int resize_inside_bounds_size = kResizeInsideBoundsSize; | 173 int resize_inside_bounds_size = kResizeInsideBoundsSize; |
174 int resize_area_corner_size = kResizeAreaCornerSize; | 174 int resize_area_corner_size = kResizeAreaCornerSize; |
175 | 175 |
176 #if defined(USE_ASH) | 176 #if defined(USE_ASH) |
177 aura::Window* window = frame_->GetNativeWindow(); | 177 aura::Window* window = frame_->GetNativeWindow(); |
178 if (chrome::IsNativeWindowInAsh(window)) { | 178 if (chrome::IsNativeWindowInAsh(window)) { |
179 gfx::Rect expanded_bounds = bounds(); | 179 gfx::Rect expanded_bounds = bounds(); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 DCHECK(!window_->frameless()); | 363 DCHECK(!window_->frameless()); |
364 if (sender == close_button_) | 364 if (sender == close_button_) |
365 frame_->Close(); | 365 frame_->Close(); |
366 else if (sender == maximize_button_) | 366 else if (sender == maximize_button_) |
367 frame_->Maximize(); | 367 frame_->Maximize(); |
368 else if (sender == restore_button_) | 368 else if (sender == restore_button_) |
369 frame_->Restore(); | 369 frame_->Restore(); |
370 else if (sender == minimize_button_) | 370 else if (sender == minimize_button_) |
371 frame_->Minimize(); | 371 frame_->Minimize(); |
372 } | 372 } |
OLD | NEW |