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/browser/renderer_host/render_view_host.h" | 5 #include "content/browser/renderer_host/render_view_host.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 delegate_->RequestOpenURL( | 1084 delegate_->RequestOpenURL( |
1085 validated_url, referrer, disposition, source_frame_id); | 1085 validated_url, referrer, disposition, source_frame_id); |
1086 } | 1086 } |
1087 | 1087 |
1088 void RenderViewHost::OnMsgDidContentsPreferredSizeChange( | 1088 void RenderViewHost::OnMsgDidContentsPreferredSizeChange( |
1089 const gfx::Size& new_size) { | 1089 const gfx::Size& new_size) { |
1090 delegate_->UpdatePreferredSize(new_size); | 1090 delegate_->UpdatePreferredSize(new_size); |
1091 } | 1091 } |
1092 | 1092 |
1093 void RenderViewHost::OnRenderAutoResized(const gfx::Size& new_size) { | 1093 void RenderViewHost::OnRenderAutoResized(const gfx::Size& new_size) { |
1094 delegate_->UpdatePreferredSize(new_size); | 1094 delegate_->ResizeDueToAutoResize(new_size); |
1095 } | 1095 } |
1096 | 1096 |
1097 void RenderViewHost::OnMsgDidChangeScrollbarsForMainFrame( | 1097 void RenderViewHost::OnMsgDidChangeScrollbarsForMainFrame( |
1098 bool has_horizontal_scrollbar, bool has_vertical_scrollbar) { | 1098 bool has_horizontal_scrollbar, bool has_vertical_scrollbar) { |
1099 if (view_) | 1099 if (view_) |
1100 view_->SetHasHorizontalScrollbar(has_horizontal_scrollbar); | 1100 view_->SetHasHorizontalScrollbar(has_horizontal_scrollbar); |
1101 } | 1101 } |
1102 | 1102 |
1103 void RenderViewHost::OnMsgDidChangeScrollOffsetPinningForMainFrame( | 1103 void RenderViewHost::OnMsgDidChangeScrollOffsetPinningForMainFrame( |
1104 bool is_pinned_to_left, bool is_pinned_to_right) { | 1104 bool is_pinned_to_left, bool is_pinned_to_right) { |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1407 void RenderViewHost::EnablePreferredSizeMode() { | 1407 void RenderViewHost::EnablePreferredSizeMode() { |
1408 Send(new ViewMsg_EnablePreferredSizeChangedMode(routing_id())); | 1408 Send(new ViewMsg_EnablePreferredSizeChangedMode(routing_id())); |
1409 } | 1409 } |
1410 | 1410 |
1411 void RenderViewHost::EnableAutoResize(const gfx::Size& min_size, | 1411 void RenderViewHost::EnableAutoResize(const gfx::Size& min_size, |
1412 const gfx::Size& max_size) { | 1412 const gfx::Size& max_size) { |
1413 SetShouldAutoResize(true); | 1413 SetShouldAutoResize(true); |
1414 Send(new ViewMsg_EnableAutoResize(routing_id(), min_size, max_size)); | 1414 Send(new ViewMsg_EnableAutoResize(routing_id(), min_size, max_size)); |
1415 } | 1415 } |
1416 | 1416 |
| 1417 void RenderViewHost::DisableAutoResize(const gfx::Size& new_size) { |
| 1418 SetShouldAutoResize(false); |
| 1419 Send(new ViewMsg_DisableAutoResize(routing_id(), new_size)); |
| 1420 } |
| 1421 |
1417 void RenderViewHost::ExecuteCustomContextMenuCommand( | 1422 void RenderViewHost::ExecuteCustomContextMenuCommand( |
1418 int action, const content::CustomContextMenuContext& context) { | 1423 int action, const content::CustomContextMenuContext& context) { |
1419 Send(new ViewMsg_CustomContextMenuAction(routing_id(), context, action)); | 1424 Send(new ViewMsg_CustomContextMenuAction(routing_id(), context, action)); |
1420 } | 1425 } |
1421 | 1426 |
1422 void RenderViewHost::NotifyContextMenuClosed( | 1427 void RenderViewHost::NotifyContextMenuClosed( |
1423 const content::CustomContextMenuContext& context) { | 1428 const content::CustomContextMenuContext& context) { |
1424 Send(new ViewMsg_ContextMenuClosed(routing_id(), context)); | 1429 Send(new ViewMsg_ContextMenuClosed(routing_id(), context)); |
1425 } | 1430 } |
1426 | 1431 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1600 // Whenever we change swap out state, we should not be waiting for | 1605 // Whenever we change swap out state, we should not be waiting for |
1601 // beforeunload or unload acks. We clear them here to be safe, since they | 1606 // beforeunload or unload acks. We clear them here to be safe, since they |
1602 // can cause navigations to be ignored in OnMsgNavigate. | 1607 // can cause navigations to be ignored in OnMsgNavigate. |
1603 is_waiting_for_beforeunload_ack_ = false; | 1608 is_waiting_for_beforeunload_ack_ = false; |
1604 is_waiting_for_unload_ack_ = false; | 1609 is_waiting_for_unload_ack_ = false; |
1605 } | 1610 } |
1606 | 1611 |
1607 void RenderViewHost::ClearPowerSaveBlockers() { | 1612 void RenderViewHost::ClearPowerSaveBlockers() { |
1608 STLDeleteValues(&power_save_blockers_); | 1613 STLDeleteValues(&power_save_blockers_); |
1609 } | 1614 } |
OLD | NEW |