| 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/widget/native_widget_views.h" | 5 #include "views/widget/native_widget_views.h" |
| 6 | 6 |
| 7 #include "views/view.h" | 7 #include "views/view.h" |
| 8 #include "views/widget/native_widget_view.h" | 8 #include "views/widget/native_widget_view.h" |
| 9 | 9 |
| 10 namespace views { | 10 namespace views { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 gfx::NativeView NativeWidgetViews::GetNativeView() const { | 74 gfx::NativeView NativeWidgetViews::GetNativeView() const { |
| 75 return GetParentNativeWidget()->GetNativeView(); | 75 return GetParentNativeWidget()->GetNativeView(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 gfx::NativeWindow NativeWidgetViews::GetNativeWindow() const { | 78 gfx::NativeWindow NativeWidgetViews::GetNativeWindow() const { |
| 79 return GetParentNativeWidget()->GetNativeWindow(); | 79 return GetParentNativeWidget()->GetNativeWindow(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 Window* NativeWidgetViews::GetContainingWindow() { | 82 Window* NativeWidgetViews::GetContainingWindow() { |
| 83 return view_->GetWindow(); | 83 return view_->GetWidget()->AsWindow(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 const Window* NativeWidgetViews::GetContainingWindow() const { | 86 const Window* NativeWidgetViews::GetContainingWindow() const { |
| 87 return view_->GetWindow(); | 87 return view_->GetWidget()->AsWindow(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void NativeWidgetViews::ViewRemoved(View* view) { | 90 void NativeWidgetViews::ViewRemoved(View* view) { |
| 91 return GetParentNativeWidget()->ViewRemoved(view); | 91 return GetParentNativeWidget()->ViewRemoved(view); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void NativeWidgetViews::SetNativeWindowProperty(const char* name, void* value) { | 94 void NativeWidgetViews::SetNativeWindowProperty(const char* name, void* value) { |
| 95 NOTIMPLEMENTED(); | 95 NOTIMPLEMENTED(); |
| 96 } | 96 } |
| 97 | 97 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 gfx::Rect NativeWidgetViews::GetWindowScreenBounds() const { | 176 gfx::Rect NativeWidgetViews::GetWindowScreenBounds() const { |
| 177 gfx::Point origin = view_->bounds().origin(); | 177 gfx::Point origin = view_->bounds().origin(); |
| 178 View::ConvertPointToScreen(view_->parent(), &origin); | 178 View::ConvertPointToScreen(view_->parent(), &origin); |
| 179 return gfx::Rect(origin.x(), origin.y(), view_->width(), view_->height()); | 179 return gfx::Rect(origin.x(), origin.y(), view_->width(), view_->height()); |
| 180 } | 180 } |
| 181 | 181 |
| 182 gfx::Rect NativeWidgetViews::GetClientAreaScreenBounds() const { | 182 gfx::Rect NativeWidgetViews::GetClientAreaScreenBounds() const { |
| 183 return GetWindowScreenBounds(); | 183 return GetWindowScreenBounds(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 gfx::Rect NativeWidgetViews::GetRestoredBounds() const { |
| 187 return GetWindowScreenBounds(); |
| 188 } |
| 189 |
| 186 void NativeWidgetViews::SetBounds(const gfx::Rect& bounds) { | 190 void NativeWidgetViews::SetBounds(const gfx::Rect& bounds) { |
| 187 // |bounds| are supplied in the coordinates of the parent. | 191 // |bounds| are supplied in the coordinates of the parent. |
| 188 view_->SetBoundsRect(bounds); | 192 view_->SetBoundsRect(bounds); |
| 189 } | 193 } |
| 190 | 194 |
| 191 void NativeWidgetViews::SetSize(const gfx::Size& size) { | 195 void NativeWidgetViews::SetSize(const gfx::Size& size) { |
| 192 view_->SetSize(size); | 196 view_->SetSize(size); |
| 193 } | 197 } |
| 194 | 198 |
| 195 void NativeWidgetViews::SetBoundsConstrained(const gfx::Rect& bounds, | 199 void NativeWidgetViews::SetBoundsConstrained(const gfx::Rect& bounds, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 212 MessageLoop::current()->PostTask(FROM_HERE, | 216 MessageLoop::current()->PostTask(FROM_HERE, |
| 213 close_widget_factory_.NewRunnableMethod(&NativeWidgetViews::CloseNow)); | 217 close_widget_factory_.NewRunnableMethod(&NativeWidgetViews::CloseNow)); |
| 214 } | 218 } |
| 215 } | 219 } |
| 216 | 220 |
| 217 void NativeWidgetViews::CloseNow() { | 221 void NativeWidgetViews::CloseNow() { |
| 218 view_->parent()->RemoveChildView(view_); | 222 view_->parent()->RemoveChildView(view_); |
| 219 delete view_; | 223 delete view_; |
| 220 } | 224 } |
| 221 | 225 |
| 226 void NativeWidgetViews::EnableClose(bool enable) { |
| 227 } |
| 228 |
| 222 void NativeWidgetViews::Show() { | 229 void NativeWidgetViews::Show() { |
| 223 view_->SetVisible(true); | 230 view_->SetVisible(true); |
| 224 } | 231 } |
| 225 | 232 |
| 226 void NativeWidgetViews::Hide() { | 233 void NativeWidgetViews::Hide() { |
| 227 view_->SetVisible(false); | 234 view_->SetVisible(false); |
| 228 } | 235 } |
| 229 | 236 |
| 237 void NativeWidgetViews::ShowNativeWidget(ShowState state) { |
| 238 } |
| 239 |
| 230 bool NativeWidgetViews::IsVisible() const { | 240 bool NativeWidgetViews::IsVisible() const { |
| 231 return view_->IsVisible(); | 241 return view_->IsVisible(); |
| 232 } | 242 } |
| 233 | 243 |
| 234 void NativeWidgetViews::Activate() { | 244 void NativeWidgetViews::Activate() { |
| 235 NOTIMPLEMENTED(); | 245 NOTIMPLEMENTED(); |
| 236 } | 246 } |
| 237 | 247 |
| 238 void NativeWidgetViews::Deactivate() { | 248 void NativeWidgetViews::Deactivate() { |
| 239 NOTIMPLEMENTED(); | 249 NOTIMPLEMENTED(); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 NativeWidget* NativeWidgetViews::GetParentNativeWidget() { | 326 NativeWidget* NativeWidgetViews::GetParentNativeWidget() { |
| 317 return view_->GetWidget()->native_widget(); | 327 return view_->GetWidget()->native_widget(); |
| 318 } | 328 } |
| 319 | 329 |
| 320 const NativeWidget* NativeWidgetViews::GetParentNativeWidget() const { | 330 const NativeWidget* NativeWidgetViews::GetParentNativeWidget() const { |
| 321 return view_->GetWidget()->native_widget(); | 331 return view_->GetWidget()->native_widget(); |
| 322 } | 332 } |
| 323 | 333 |
| 324 } // namespace views | 334 } // namespace views |
| 325 | 335 |
| OLD | NEW |