| 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 "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "ui/base/l10n/l10n_font_util.h" | 10 #include "ui/base/l10n/l10n_font_util.h" |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 | 644 |
| 645 void Widget::OnNativeWidgetEndUserBoundsChange() { | 645 void Widget::OnNativeWidgetEndUserBoundsChange() { |
| 646 widget_delegate_->OnWindowEndUserBoundsChange(); | 646 widget_delegate_->OnWindowEndUserBoundsChange(); |
| 647 } | 647 } |
| 648 | 648 |
| 649 bool Widget::HasFocusManager() const { | 649 bool Widget::HasFocusManager() const { |
| 650 return !!focus_manager_.get(); | 650 return !!focus_manager_.get(); |
| 651 } | 651 } |
| 652 | 652 |
| 653 bool Widget::OnNativeWidgetPaintAccelerated(const gfx::Rect& dirty_region) { | 653 bool Widget::OnNativeWidgetPaintAccelerated(const gfx::Rect& dirty_region) { |
| 654 #if !defined(COMPOSITOR_2) | |
| 655 return false; | |
| 656 #else | |
| 657 if (!compositor_.get()) | 654 if (!compositor_.get()) |
| 658 return false; | 655 return false; |
| 659 | 656 |
| 660 compositor_->NotifyStart(); | 657 compositor_->NotifyStart(); |
| 661 GetRootView()->PaintToTexture(dirty_region); | 658 GetRootView()->PaintToTexture(dirty_region); |
| 662 GetRootView()->PaintComposite(); | 659 GetRootView()->PaintComposite(); |
| 663 compositor_->NotifyEnd(); | 660 compositor_->NotifyEnd(); |
| 664 return true; | 661 return true; |
| 665 #endif | |
| 666 } | 662 } |
| 667 | 663 |
| 668 void Widget::OnNativeWidgetPaint(gfx::Canvas* canvas) { | 664 void Widget::OnNativeWidgetPaint(gfx::Canvas* canvas) { |
| 669 GetRootView()->Paint(canvas); | 665 GetRootView()->Paint(canvas); |
| 670 #if !defined(COMPOSITOR_2) | |
| 671 if (compositor_.get()) { | |
| 672 compositor_->NotifyStart(); | |
| 673 root_view_->PaintComposite(compositor_.get()); | |
| 674 compositor_->NotifyEnd(); | |
| 675 } | |
| 676 #endif | |
| 677 } | 666 } |
| 678 | 667 |
| 679 int Widget::GetNonClientComponent(const gfx::Point& point) { | 668 int Widget::GetNonClientComponent(const gfx::Point& point) { |
| 680 return non_client_view_->NonClientHitTest(point); | 669 return non_client_view_->NonClientHitTest(point); |
| 681 } | 670 } |
| 682 | 671 |
| 683 bool Widget::OnKeyEvent(const KeyEvent& event) { | 672 bool Widget::OnKeyEvent(const KeyEvent& event) { |
| 684 return static_cast<internal::RootView*>(GetRootView())->OnKeyEvent(event); | 673 return static_cast<internal::RootView*>(GetRootView())->OnKeyEvent(event); |
| 685 } | 674 } |
| 686 | 675 |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 native_widget_->CenterWindow(non_client_view_->GetPreferredSize()); | 861 native_widget_->CenterWindow(non_client_view_->GetPreferredSize()); |
| 873 } else { | 862 } else { |
| 874 // Use the supplied initial bounds. | 863 // Use the supplied initial bounds. |
| 875 SetBoundsConstrained(bounds, NULL); | 864 SetBoundsConstrained(bounds, NULL); |
| 876 } | 865 } |
| 877 } | 866 } |
| 878 } | 867 } |
| 879 | 868 |
| 880 | 869 |
| 881 } // namespace views | 870 } // namespace views |
| OLD | NEW |