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