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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 if (is_hidden_ || !host_) | 820 if (is_hidden_ || !host_) |
821 return; | 821 return; |
822 | 822 |
823 DCHECK(!host_->is_accelerated_compositing_active() || | 823 DCHECK(!host_->is_accelerated_compositing_active() || |
824 get_use_acceleration_when_possible()); | 824 get_use_acceleration_when_possible()); |
825 | 825 |
826 // If we aren't using the views compositor, then | 826 // If we aren't using the views compositor, then |
827 // paint a "hole" in the canvas so that the render of the web page is on | 827 // paint a "hole" in the canvas so that the render of the web page is on |
828 // top of whatever else has already been painted in the views hierarchy. | 828 // top of whatever else has already been painted in the views hierarchy. |
829 // Later views might still get to paint on top. | 829 // Later views might still get to paint on top. |
830 if (!get_use_acceleration_when_possible()) { | 830 if (!get_use_acceleration_when_possible()) |
831 canvas->FillRectInt(SK_ColorBLACK, 0, 0, | 831 canvas->FillRect(SK_ColorBLACK, GetLocalBounds(), SkXfermode::kClear_Mode); |
832 bounds().width(), bounds().height(), | |
833 SkXfermode::kClear_Mode); | |
834 } | |
835 | 832 |
836 DCHECK(!about_to_validate_and_paint_); | 833 DCHECK(!about_to_validate_and_paint_); |
837 | 834 |
838 // TODO(anicolao): get the damage somehow | 835 // TODO(anicolao): get the damage somehow |
839 // invalid_rect_ = damage_rect; | 836 // invalid_rect_ = damage_rect; |
840 invalid_rect_ = bounds(); | 837 invalid_rect_ = bounds(); |
841 gfx::Point origin; | 838 gfx::Point origin; |
842 ConvertPointToWidget(this, &origin); | 839 ConvertPointToWidget(this, &origin); |
843 | 840 |
844 about_to_validate_and_paint_ = true; | 841 about_to_validate_and_paint_ = true; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 tab_switch_paint_duration); | 886 tab_switch_paint_duration); |
890 // Reset tab_switch_paint_time_ to 0 so future tab selections are | 887 // Reset tab_switch_paint_time_ to 0 so future tab selections are |
891 // recorded. | 888 // recorded. |
892 tab_switch_paint_time_ = base::TimeTicks(); | 889 tab_switch_paint_time_ = base::TimeTicks(); |
893 } | 890 } |
894 } else { | 891 } else { |
895 if (whiteout_start_time_.is_null()) | 892 if (whiteout_start_time_.is_null()) |
896 whiteout_start_time_ = base::TimeTicks::Now(); | 893 whiteout_start_time_ = base::TimeTicks::Now(); |
897 | 894 |
898 if (get_use_acceleration_when_possible()) | 895 if (get_use_acceleration_when_possible()) |
899 canvas->FillRectInt(SK_ColorWHITE, 0, 0, | 896 canvas->FillRect(SK_ColorWHITE, GetLocalBounds()); |
900 bounds().width(), bounds().height()); | |
901 } | 897 } |
902 } | 898 } |
903 | 899 |
904 void RenderWidgetHostViewViews::Focus() { | 900 void RenderWidgetHostViewViews::Focus() { |
905 RequestFocus(); | 901 RequestFocus(); |
906 } | 902 } |
907 | 903 |
908 void RenderWidgetHostViewViews::Blur() { | 904 void RenderWidgetHostViewViews::Blur() { |
909 // TODO(estade): We should be clearing native focus as well, but I know of no | 905 // TODO(estade): We should be clearing native focus as well, but I know of no |
910 // way to do that without focusing another widget. | 906 // way to do that without focusing another widget. |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 for (std::vector< base::Callback<void(void)> >::const_iterator | 1154 for (std::vector< base::Callback<void(void)> >::const_iterator |
1159 it = on_compositing_ended_callbacks_.begin(); | 1155 it = on_compositing_ended_callbacks_.begin(); |
1160 it != on_compositing_ended_callbacks_.end(); ++it) { | 1156 it != on_compositing_ended_callbacks_.end(); ++it) { |
1161 it->Run(); | 1157 it->Run(); |
1162 } | 1158 } |
1163 on_compositing_ended_callbacks_.clear(); | 1159 on_compositing_ended_callbacks_.clear(); |
1164 compositor->RemoveObserver(this); | 1160 compositor->RemoveObserver(this); |
1165 } | 1161 } |
1166 | 1162 |
1167 #endif | 1163 #endif |
OLD | NEW |