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/renderer_host/render_widget_host_view_views.h" | 5 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 | 737 |
738 about_to_validate_and_paint_ = true; | 738 about_to_validate_and_paint_ = true; |
739 BackingStore* backing_store = host_->GetBackingStore(true); | 739 BackingStore* backing_store = host_->GetBackingStore(true); |
740 // Calling GetBackingStore maybe have changed |invalid_rect_|... | 740 // Calling GetBackingStore maybe have changed |invalid_rect_|... |
741 about_to_validate_and_paint_ = false; | 741 about_to_validate_and_paint_ = false; |
742 | 742 |
743 gfx::Rect paint_rect = gfx::Rect(0, 0, kMaxWindowWidth, kMaxWindowHeight); | 743 gfx::Rect paint_rect = gfx::Rect(0, 0, kMaxWindowWidth, kMaxWindowHeight); |
744 paint_rect = paint_rect.Intersect(invalid_rect_); | 744 paint_rect = paint_rect.Intersect(invalid_rect_); |
745 | 745 |
746 if (backing_store) { | 746 if (backing_store) { |
747 #if defined(TOOLKIT_USES_GTK) | 747 #if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) |
748 // Only render the widget if it is attached to a window; there's a short | 748 // Only render the widget if it is attached to a window; there's a short |
749 // period where this object isn't attached to a window but hasn't been | 749 // period where this object isn't attached to a window but hasn't been |
750 // Destroy()ed yet and it receives paint messages... | 750 // Destroy()ed yet and it receives paint messages... |
751 if (GetInnerNativeView()->window) { | 751 if (GetInnerNativeView()->window) { |
752 #endif | 752 #endif |
753 if (!visually_deemphasized_) { | 753 if (!visually_deemphasized_) { |
754 // In the common case, use XCopyArea. We don't draw more than once, so | 754 // In the common case, use XCopyArea. We don't draw more than once, so |
755 // we don't need to double buffer. | 755 // we don't need to double buffer. |
756 if (IsPopup()) { | 756 if (IsPopup()) { |
757 origin.SetPoint(origin.x() + paint_rect.x(), | 757 origin.SetPoint(origin.x() + paint_rect.x(), |
758 origin.y() + paint_rect.y()); | 758 origin.y() + paint_rect.y()); |
759 paint_rect.SetRect(0, 0, paint_rect.width(), paint_rect.height()); | 759 paint_rect.SetRect(0, 0, paint_rect.width(), paint_rect.height()); |
760 } | 760 } |
761 static_cast<BackingStoreSkia*>(backing_store)->SkiaShowRect( | 761 static_cast<BackingStoreSkia*>(backing_store)->SkiaShowRect( |
762 gfx::Point(paint_rect.x(), paint_rect.y()), canvas); | 762 gfx::Point(paint_rect.x(), paint_rect.y()), canvas); |
763 } else { | 763 } else { |
764 // TODO(sad) | 764 // TODO(sad) |
765 NOTIMPLEMENTED(); | 765 NOTIMPLEMENTED(); |
766 } | 766 } |
767 #if defined(TOOLKIT_USES_GTK) | 767 #if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) |
768 } | 768 } |
769 #endif | 769 #endif |
770 if (!whiteout_start_time_.is_null()) { | 770 if (!whiteout_start_time_.is_null()) { |
771 base::TimeDelta whiteout_duration = base::TimeTicks::Now() - | 771 base::TimeDelta whiteout_duration = base::TimeTicks::Now() - |
772 whiteout_start_time_; | 772 whiteout_start_time_; |
773 UMA_HISTOGRAM_TIMES("MPArch.RWHH_WhiteoutDuration", whiteout_duration); | 773 UMA_HISTOGRAM_TIMES("MPArch.RWHH_WhiteoutDuration", whiteout_duration); |
774 | 774 |
775 // Reset the start time to 0 so that we start recording again the next | 775 // Reset the start time to 0 so that we start recording again the next |
776 // time the backing store is NULL... | 776 // time the backing store is NULL... |
777 whiteout_start_time_ = base::TimeTicks(); | 777 whiteout_start_time_ = base::TimeTicks(); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 DCHECK(GetInputMethod()); | 868 DCHECK(GetInputMethod()); |
869 GetInputMethod()->CancelComposition(this); | 869 GetInputMethod()->CancelComposition(this); |
870 has_composition_text_ = false; | 870 has_composition_text_ = false; |
871 } | 871 } |
872 | 872 |
873 void RenderWidgetHostViewViews::UpdateTouchSelectionController() { | 873 void RenderWidgetHostViewViews::UpdateTouchSelectionController() { |
874 if (touch_selection_controller_.get()) | 874 if (touch_selection_controller_.get()) |
875 touch_selection_controller_->SelectionChanged(selection_start_, | 875 touch_selection_controller_->SelectionChanged(selection_start_, |
876 selection_end_); | 876 selection_end_); |
877 } | 877 } |
| 878 |
| 879 void RenderWidgetHostViewViews::UpdateCursor(const WebCursor& cursor) { |
| 880 } |
| 881 |
| 882 void RenderWidgetHostViewViews::ShowCurrentCursor() { |
| 883 NOTIMPLEMENTED(); |
| 884 } |
| 885 |
| 886 void RenderWidgetHostViewViews::GetDefaultScreenInfo( |
| 887 WebKit::WebScreenInfo* results) { |
| 888 NOTIMPLEMENTED(); |
| 889 } |
| 890 |
| 891 void RenderWidgetHostViewViews::GetScreenInfo(WebKit::WebScreenInfo* results) { |
| 892 NOTIMPLEMENTED(); |
| 893 } |
| 894 |
| 895 gfx::Rect RenderWidgetHostViewViews::GetRootWindowBounds() { |
| 896 NOTIMPLEMENTED(); |
| 897 return gfx::Rect(); |
| 898 } |
| 899 |
| 900 gfx::PluginWindowHandle RenderWidgetHostViewViews::GetCompositingSurface() { |
| 901 NOTIMPLEMENTED(); |
| 902 return 0; |
| 903 } |
| 904 |
| 905 #if defined(USE_AURA) |
| 906 // static |
| 907 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( |
| 908 RenderWidgetHost* widget) { |
| 909 return new RenderWidgetHostViewViews(widget); |
| 910 } |
| 911 #endif |
OLD | NEW |