| 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/widget.h" | 5 #include "views/widget/widget.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "ui/gfx/compositor/compositor.h" | 9 #include "ui/gfx/compositor/compositor.h" |
| 10 #include "views/focus/view_storage.h" | 10 #include "views/focus/view_storage.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 206 } |
| 207 | 207 |
| 208 void Widget::Show() { | 208 void Widget::Show() { |
| 209 native_widget_->Show(); | 209 native_widget_->Show(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 void Widget::Hide() { | 212 void Widget::Hide() { |
| 213 native_widget_->Hide(); | 213 native_widget_->Hide(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void Widget::Activate() { | |
| 217 native_widget_->Activate(); | |
| 218 } | |
| 219 | |
| 220 void Widget::Deactivate() { | |
| 221 native_widget_->Deactivate(); | |
| 222 } | |
| 223 | |
| 224 bool Widget::IsActive() const { | 216 bool Widget::IsActive() const { |
| 225 return native_widget_->IsActive(); | 217 return native_widget_->IsActive(); |
| 226 } | 218 } |
| 227 | 219 |
| 220 void Widget::SetOpacity(unsigned char opacity) { |
| 221 native_widget_->SetOpacity(opacity); |
| 222 } |
| 223 |
| 228 void Widget::SetAlwaysOnTop(bool on_top) { | 224 void Widget::SetAlwaysOnTop(bool on_top) { |
| 229 native_widget_->SetAlwaysOnTop(on_top); | 225 native_widget_->SetAlwaysOnTop(on_top); |
| 230 } | 226 } |
| 231 | 227 |
| 232 void Widget::Maximize() { | |
| 233 native_widget_->Maximize(); | |
| 234 } | |
| 235 | |
| 236 void Widget::Minimize() { | |
| 237 native_widget_->Minimize(); | |
| 238 } | |
| 239 | |
| 240 void Widget::Restore() { | |
| 241 native_widget_->Restore(); | |
| 242 } | |
| 243 | |
| 244 bool Widget::IsMaximized() const { | |
| 245 return native_widget_->IsMaximized(); | |
| 246 } | |
| 247 | |
| 248 bool Widget::IsMinimized() const { | |
| 249 return native_widget_->IsMinimized(); | |
| 250 } | |
| 251 | |
| 252 void Widget::SetOpacity(unsigned char opacity) { | |
| 253 native_widget_->SetOpacity(opacity); | |
| 254 } | |
| 255 | |
| 256 View* Widget::GetRootView() { | 228 View* Widget::GetRootView() { |
| 257 if (!root_view_.get()) { | 229 if (!root_view_.get()) { |
| 258 // First time the root view is being asked for, create it now. | 230 // First time the root view is being asked for, create it now. |
| 259 root_view_.reset(CreateRootView()); | 231 root_view_.reset(CreateRootView()); |
| 260 } | 232 } |
| 261 return root_view_.get(); | 233 return root_view_.get(); |
| 262 } | 234 } |
| 263 | 235 |
| 264 bool Widget::IsVisible() const { | 236 bool Widget::IsVisible() const { |
| 265 return native_widget_->IsVisible(); | 237 return native_widget_->IsVisible(); |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 gfx::AcceleratedWidget widget = native_widget_->GetAcceleratedWidget(); | 517 gfx::AcceleratedWidget widget = native_widget_->GetAcceleratedWidget(); |
| 546 if (widget != gfx::kNullAcceleratedWidget) | 518 if (widget != gfx::kNullAcceleratedWidget) |
| 547 compositor_ = ui::Compositor::Create(widget); | 519 compositor_ = ui::Compositor::Create(widget); |
| 548 } | 520 } |
| 549 | 521 |
| 550 bool Widget::ShouldReleaseCaptureOnMouseReleased() const { | 522 bool Widget::ShouldReleaseCaptureOnMouseReleased() const { |
| 551 return true; | 523 return true; |
| 552 } | 524 } |
| 553 | 525 |
| 554 } // namespace views | 526 } // namespace views |
| OLD | NEW |