OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
837 set_next_paint_is_resize_ack(); | 837 set_next_paint_is_resize_ack(); |
838 | 838 |
839 if (fullscreen_change) | 839 if (fullscreen_change) |
840 DidToggleFullscreen(); | 840 DidToggleFullscreen(); |
841 | 841 |
842 // If a resize ack is requested and it isn't set-up, then no more resizes will | 842 // If a resize ack is requested and it isn't set-up, then no more resizes will |
843 // come in and in general things will go wrong. | 843 // come in and in general things will go wrong. |
844 DCHECK(resize_ack != SEND_RESIZE_ACK || next_paint_is_resize_ack()); | 844 DCHECK(resize_ack != SEND_RESIZE_ACK || next_paint_is_resize_ack()); |
845 } | 845 } |
846 | 846 |
847 void RenderWidget::ResizeSynchronously( | 847 void RenderWidget::ResizeSynchronously(const gfx::Rect& new_position) { |
Avi (use Gerrit)
2015/02/03 01:30:42
ditto
bokan
2015/02/03 03:13:17
Done.
| |
848 const gfx::Rect& new_position, | |
849 const gfx::Size& visible_viewport_size) { | |
850 Resize(new_position.size(), | 848 Resize(new_position.size(), |
851 new_position.size(), | 849 new_position.size(), |
852 top_controls_shrink_blink_size_, | 850 top_controls_shrink_blink_size_, |
853 top_controls_height_, | 851 top_controls_height_, |
854 visible_viewport_size, | 852 new_position.size(), |
855 gfx::Rect(), | 853 gfx::Rect(), |
856 is_fullscreen_, | 854 is_fullscreen_, |
857 NO_RESIZE_ACK); | 855 NO_RESIZE_ACK); |
858 view_screen_rect_ = new_position; | 856 view_screen_rect_ = new_position; |
859 window_screen_rect_ = new_position; | 857 window_screen_rect_ = new_position; |
860 if (!did_show_) | 858 if (!did_show_) |
861 initial_pos_ = new_position; | 859 initial_pos_ = new_position; |
862 } | 860 } |
863 | 861 |
864 void RenderWidget::OnClose() { | 862 void RenderWidget::OnClose() { |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1610 } | 1608 } |
1611 | 1609 |
1612 if (!resizing_mode_selector_->is_synchronous_mode()) { | 1610 if (!resizing_mode_selector_->is_synchronous_mode()) { |
1613 if (did_show_) { | 1611 if (did_show_) { |
1614 Send(new ViewHostMsg_RequestMove(routing_id_, pos)); | 1612 Send(new ViewHostMsg_RequestMove(routing_id_, pos)); |
1615 SetPendingWindowRect(pos); | 1613 SetPendingWindowRect(pos); |
1616 } else { | 1614 } else { |
1617 initial_pos_ = pos; | 1615 initial_pos_ = pos; |
1618 } | 1616 } |
1619 } else { | 1617 } else { |
1620 ResizeSynchronously(pos, visible_viewport_size_); | 1618 ResizeSynchronously(pos); |
Avi (use Gerrit)
2015/02/03 01:30:42
ditto
bokan
2015/02/03 03:13:17
Done.
| |
1621 } | 1619 } |
1622 } | 1620 } |
1623 | 1621 |
1624 void RenderWidget::SetPendingWindowRect(const WebRect& rect) { | 1622 void RenderWidget::SetPendingWindowRect(const WebRect& rect) { |
1625 pending_window_rect_ = rect; | 1623 pending_window_rect_ = rect; |
1626 pending_window_rect_count_++; | 1624 pending_window_rect_count_++; |
1627 } | 1625 } |
1628 | 1626 |
1629 WebRect RenderWidget::rootWindowRect() { | 1627 WebRect RenderWidget::rootWindowRect() { |
1630 if (pending_window_rect_count_) { | 1628 if (pending_window_rect_count_) { |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2428 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2426 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2429 video_hole_frames_.AddObserver(frame); | 2427 video_hole_frames_.AddObserver(frame); |
2430 } | 2428 } |
2431 | 2429 |
2432 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2430 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2433 video_hole_frames_.RemoveObserver(frame); | 2431 video_hole_frames_.RemoveObserver(frame); |
2434 } | 2432 } |
2435 #endif // defined(VIDEO_HOLE) | 2433 #endif // defined(VIDEO_HOLE) |
2436 | 2434 |
2437 } // namespace content | 2435 } // namespace content |
OLD | NEW |