| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/frame/popup_non_client_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/popup_non_client_frame_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 7 #include "ui/gfx/point.h" | 8 #include "ui/gfx/point.h" |
| 8 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
| 9 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| 10 | 11 |
| 11 #if !defined(OS_WIN) | 12 #if !defined(OS_WIN) |
| 12 #include "views/window/hit_test.h" | 13 #include "views/window/hit_test.h" |
| 13 #endif | 14 #endif |
| 14 | 15 |
| 16 PopupNonClientFrameView::PopupNonClientFrameView(BrowserFrame* frame) { |
| 17 frame->set_frame_type(views::Window::FRAME_TYPE_FORCE_NATIVE); |
| 18 } |
| 19 |
| 15 gfx::Rect PopupNonClientFrameView::GetBoundsForClientView() const { | 20 gfx::Rect PopupNonClientFrameView::GetBoundsForClientView() const { |
| 16 return gfx::Rect(0, 0, width(), height()); | 21 return gfx::Rect(0, 0, width(), height()); |
| 17 } | 22 } |
| 18 | 23 |
| 19 bool PopupNonClientFrameView::AlwaysUseCustomFrame() const { | |
| 20 return false; | |
| 21 } | |
| 22 | |
| 23 bool PopupNonClientFrameView::AlwaysUseNativeFrame() const { | |
| 24 return true; | |
| 25 } | |
| 26 | |
| 27 gfx::Rect PopupNonClientFrameView::GetWindowBoundsForClientBounds( | 24 gfx::Rect PopupNonClientFrameView::GetWindowBoundsForClientBounds( |
| 28 const gfx::Rect& client_bounds) const { | 25 const gfx::Rect& client_bounds) const { |
| 29 return client_bounds; | 26 return client_bounds; |
| 30 } | 27 } |
| 31 | 28 |
| 32 int PopupNonClientFrameView::NonClientHitTest(const gfx::Point& point) { | 29 int PopupNonClientFrameView::NonClientHitTest(const gfx::Point& point) { |
| 33 return bounds().Contains(point) ? HTCLIENT : HTNOWHERE; | 30 return bounds().Contains(point) ? HTCLIENT : HTNOWHERE; |
| 34 } | 31 } |
| 35 | 32 |
| 36 void PopupNonClientFrameView::GetWindowMask(const gfx::Size& size, | 33 void PopupNonClientFrameView::GetWindowMask(const gfx::Size& size, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 51 return gfx::Rect(0, 0, width(), tabstrip->GetPreferredSize().height()); | 48 return gfx::Rect(0, 0, width(), tabstrip->GetPreferredSize().height()); |
| 52 } | 49 } |
| 53 | 50 |
| 54 int PopupNonClientFrameView::GetHorizontalTabStripVerticalOffset( | 51 int PopupNonClientFrameView::GetHorizontalTabStripVerticalOffset( |
| 55 bool restored) const { | 52 bool restored) const { |
| 56 return 0; | 53 return 0; |
| 57 } | 54 } |
| 58 | 55 |
| 59 void PopupNonClientFrameView::UpdateThrobber(bool running) { | 56 void PopupNonClientFrameView::UpdateThrobber(bool running) { |
| 60 } | 57 } |
| OLD | NEW |