| 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 "views/window/native_frame_view.h" | 5 #include "views/window/native_frame_view.h" |
| 6 | 6 |
| 7 #include "views/widget/native_widget.h" | 7 #include "views/widget/native_widget.h" |
| 8 #include "views/widget/widget.h" | 8 #include "views/widget/widget.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) && !defined(USE_AURA) |
| 11 #include "views/widget/native_widget_win.h" | 11 #include "views/widget/native_widget_win.h" |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 namespace views { | 14 namespace views { |
| 15 | 15 |
| 16 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
| 17 // NativeFrameView, public: | 17 // NativeFrameView, public: |
| 18 | 18 |
| 19 NativeFrameView::NativeFrameView(Widget* frame) | 19 NativeFrameView::NativeFrameView(Widget* frame) |
| 20 : NonClientFrameView(), | 20 : NonClientFrameView(), |
| 21 frame_(frame) { | 21 frame_(frame) { |
| 22 } | 22 } |
| 23 | 23 |
| 24 NativeFrameView::~NativeFrameView() { | 24 NativeFrameView::~NativeFrameView() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 //////////////////////////////////////////////////////////////////////////////// | 27 //////////////////////////////////////////////////////////////////////////////// |
| 28 // NativeFrameView, NonClientFrameView overrides: | 28 // NativeFrameView, NonClientFrameView overrides: |
| 29 | 29 |
| 30 gfx::Rect NativeFrameView::GetBoundsForClientView() const { | 30 gfx::Rect NativeFrameView::GetBoundsForClientView() const { |
| 31 return gfx::Rect(0, 0, width(), height()); | 31 return gfx::Rect(0, 0, width(), height()); |
| 32 } | 32 } |
| 33 | 33 |
| 34 gfx::Rect NativeFrameView::GetWindowBoundsForClientBounds( | 34 gfx::Rect NativeFrameView::GetWindowBoundsForClientBounds( |
| 35 const gfx::Rect& client_bounds) const { | 35 const gfx::Rect& client_bounds) const { |
| 36 #if defined(OS_WIN) | 36 #if defined(OS_WIN) && !defined(USE_AURA) |
| 37 RECT rect = client_bounds.ToRECT(); | 37 RECT rect = client_bounds.ToRECT(); |
| 38 NativeWidgetWin* widget_win = | 38 NativeWidgetWin* widget_win = |
| 39 static_cast<NativeWidgetWin*>(frame_->native_widget()); | 39 static_cast<NativeWidgetWin*>(frame_->native_widget()); |
| 40 AdjustWindowRectEx(&rect, widget_win->window_style(), FALSE, | 40 AdjustWindowRectEx(&rect, widget_win->window_style(), FALSE, |
| 41 widget_win->window_ex_style()); | 41 widget_win->window_ex_style()); |
| 42 return gfx::Rect(rect); | 42 return gfx::Rect(rect); |
| 43 #else | 43 #else |
| 44 // TODO(sad): | 44 // TODO(sad): |
| 45 return client_bounds; | 45 return client_bounds; |
| 46 #endif | 46 #endif |
| (...skipping 18 matching lines...) Expand all Loading... |
| 65 | 65 |
| 66 void NativeFrameView::UpdateWindowIcon() { | 66 void NativeFrameView::UpdateWindowIcon() { |
| 67 // Nothing to do. | 67 // Nothing to do. |
| 68 } | 68 } |
| 69 | 69 |
| 70 gfx::Size NativeFrameView::GetPreferredSize() { | 70 gfx::Size NativeFrameView::GetPreferredSize() { |
| 71 return frame_->client_view()->GetPreferredSize(); | 71 return frame_->client_view()->GetPreferredSize(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace views | 74 } // namespace views |
| OLD | NEW |