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_views.h" | 5 #include "chrome/browser/ui/views/extensions/shell_window_views.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
9 #include "chrome/browser/favicon/favicon_tab_helper.h" | 9 #include "chrome/browser/favicon/favicon_tab_helper.h" |
10 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 int kResizeInsideBoundsSize = ash::kResizeInsideBoundsSize; | 188 int kResizeInsideBoundsSize = ash::kResizeInsideBoundsSize; |
189 int kResizeAreaCornerSize = ash::kResizeAreaCornerSize; | 189 int kResizeAreaCornerSize = ash::kResizeAreaCornerSize; |
190 #endif | 190 #endif |
191 | 191 |
192 // Check the frame first, as we allow a small area overlapping the contents | 192 // Check the frame first, as we allow a small area overlapping the contents |
193 // to be used for resize handles. | 193 // to be used for resize handles. |
194 bool can_ever_resize = frame_->widget_delegate() ? | 194 bool can_ever_resize = frame_->widget_delegate() ? |
195 frame_->widget_delegate()->CanResize() : | 195 frame_->widget_delegate()->CanResize() : |
196 false; | 196 false; |
197 // Don't allow overlapping resize handles when the window is maximized or | 197 if (can_ever_resize) { |
198 // fullscreen, as it can't be resized in those states. | 198 // Don't allow overlapping resize handles when the window is maximized or |
199 int resize_border = | 199 // fullscreen, as it can't be resized in those states. |
200 frame_->IsMaximized() || frame_->IsFullscreen() ? 0 : | 200 int resize_border = |
201 kResizeInsideBoundsSize; | 201 frame_->IsMaximized() || frame_->IsFullscreen() ? 0 : |
202 int frame_component = GetHTComponentForFrame(point, | 202 kResizeInsideBoundsSize; |
203 resize_border, | 203 int frame_component = GetHTComponentForFrame(point, |
204 resize_border, | 204 resize_border, |
205 kResizeAreaCornerSize, | 205 resize_border, |
206 kResizeAreaCornerSize, | 206 kResizeAreaCornerSize, |
207 can_ever_resize); | 207 kResizeAreaCornerSize, |
208 if (frame_component != HTNOWHERE) | 208 can_ever_resize); |
209 return frame_component; | 209 if (frame_component != HTNOWHERE) |
| 210 return frame_component; |
| 211 } |
210 | 212 |
211 // Check for possible draggable region in the client area for the frameless | 213 // Check for possible draggable region in the client area for the frameless |
212 // window. | 214 // window. |
213 if (window_->frameless() && | 215 if (window_->frameless() && |
214 window_->draggable_region() && | 216 window_->draggable_region() && |
215 window_->draggable_region()->contains(point.x(), point.y())) | 217 window_->draggable_region()->contains(point.x(), point.y())) |
216 return HTCAPTION; | 218 return HTCAPTION; |
217 | 219 |
218 int client_component = frame_->client_view()->NonClientHitTest(point); | 220 int client_component = frame_->client_view()->NonClientHitTest(point); |
219 if (client_component != HTNOWHERE) | 221 if (client_component != HTNOWHERE) |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 ui::WindowShowState show_state) { | 689 ui::WindowShowState show_state) { |
688 views::WidgetDelegate::SaveWindowPlacement(bounds, show_state); | 690 views::WidgetDelegate::SaveWindowPlacement(bounds, show_state); |
689 shell_window_->SaveWindowPosition(); | 691 shell_window_->SaveWindowPosition(); |
690 } | 692 } |
691 | 693 |
692 // static | 694 // static |
693 NativeShellWindow* NativeShellWindow::Create( | 695 NativeShellWindow* NativeShellWindow::Create( |
694 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { | 696 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { |
695 return new ShellWindowViews(shell_window, params); | 697 return new ShellWindowViews(shell_window, params); |
696 } | 698 } |
OLD | NEW |