Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 10377158: Move keyboard related methods from RenderViewHostDelegate to a new RenderWidgetHostDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove crbug link Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 /////////////////////////////////////////////////////////////////////////////// 123 ///////////////////////////////////////////////////////////////////////////////
124 // RenderViewHostImpl, public: 124 // RenderViewHostImpl, public:
125 125
126 // static 126 // static
127 RenderViewHostImpl* RenderViewHostImpl::FromID(int render_process_id, 127 RenderViewHostImpl* RenderViewHostImpl::FromID(int render_process_id,
128 int render_view_id) { 128 int render_view_id) {
129 return static_cast<RenderViewHostImpl*>( 129 return static_cast<RenderViewHostImpl*>(
130 RenderViewHost::FromID(render_process_id, render_view_id)); 130 RenderViewHost::FromID(render_process_id, render_view_id));
131 } 131 }
132 132
133 RenderViewHostImpl::RenderViewHostImpl(SiteInstance* instance, 133 RenderViewHostImpl::RenderViewHostImpl(
134 RenderViewHostDelegate* delegate, 134 SiteInstance* instance,
135 int routing_id, 135 RenderViewHostDelegate* delegate,
136 bool swapped_out, 136 RenderWidgetHostDelegate* widget_delegate,
137 SessionStorageNamespace* session_storage) 137 int routing_id,
138 : RenderWidgetHostImpl(instance->GetProcess(), routing_id), 138 bool swapped_out,
139 SessionStorageNamespace* session_storage)
140 : RenderWidgetHostImpl(widget_delegate, instance->GetProcess(), routing_id),
139 delegate_(delegate), 141 delegate_(delegate),
140 instance_(static_cast<SiteInstanceImpl*>(instance)), 142 instance_(static_cast<SiteInstanceImpl*>(instance)),
141 waiting_for_drag_context_response_(false), 143 waiting_for_drag_context_response_(false),
142 enabled_bindings_(0), 144 enabled_bindings_(0),
143 guest_(false), 145 guest_(false),
144 pending_request_id_(-1), 146 pending_request_id_(-1),
145 navigations_suspended_(false), 147 navigations_suspended_(false),
146 suspended_nav_message_(NULL), 148 suspended_nav_message_(NULL),
147 is_swapped_out_(swapped_out), 149 is_swapped_out_(swapped_out),
148 run_modal_reply_msg_(NULL), 150 run_modal_reply_msg_(NULL),
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 void RenderViewHostImpl::AddObserver( 1392 void RenderViewHostImpl::AddObserver(
1391 content::RenderViewHostObserver* observer) { 1393 content::RenderViewHostObserver* observer) {
1392 observers_.AddObserver(observer); 1394 observers_.AddObserver(observer);
1393 } 1395 }
1394 1396
1395 void RenderViewHostImpl::RemoveObserver( 1397 void RenderViewHostImpl::RemoveObserver(
1396 content::RenderViewHostObserver* observer) { 1398 content::RenderViewHostObserver* observer) {
1397 observers_.RemoveObserver(observer); 1399 observers_.RemoveObserver(observer);
1398 } 1400 }
1399 1401
1400 bool RenderViewHostImpl::PreHandleKeyboardEvent(
1401 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) {
1402 return delegate_->PreHandleKeyboardEvent(event, is_keyboard_shortcut);
1403 }
1404
1405 void RenderViewHostImpl::UnhandledKeyboardEvent(
1406 const NativeWebKeyboardEvent& event) {
1407 delegate_->HandleKeyboardEvent(event);
1408 }
1409
1410 void RenderViewHostImpl::OnUserGesture() { 1402 void RenderViewHostImpl::OnUserGesture() {
1411 delegate_->OnUserGesture(); 1403 delegate_->OnUserGesture();
1412 } 1404 }
1413 1405
1414 void RenderViewHostImpl::OnMsgShouldCloseACK( 1406 void RenderViewHostImpl::OnMsgShouldCloseACK(
1415 bool proceed, 1407 bool proceed,
1416 const base::TimeTicks& renderer_before_unload_start_time, 1408 const base::TimeTicks& renderer_before_unload_start_time,
1417 const base::TimeTicks& renderer_before_unload_end_time) { 1409 const base::TimeTicks& renderer_before_unload_end_time) {
1418 StopHangMonitorTimeout(); 1410 StopHangMonitorTimeout();
1419 // If this renderer navigated while the beforeunload request was in flight, we 1411 // If this renderer navigated while the beforeunload request was in flight, we
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1832 // can cause navigations to be ignored in OnMsgNavigate. 1824 // can cause navigations to be ignored in OnMsgNavigate.
1833 is_waiting_for_beforeunload_ack_ = false; 1825 is_waiting_for_beforeunload_ack_ = false;
1834 is_waiting_for_unload_ack_ = false; 1826 is_waiting_for_unload_ack_ = false;
1835 } 1827 }
1836 1828
1837 void RenderViewHostImpl::ClearPowerSaveBlockers() { 1829 void RenderViewHostImpl::ClearPowerSaveBlockers() {
1838 STLDeleteValues(&power_save_blockers_); 1830 STLDeleteValues(&power_save_blockers_);
1839 } 1831 }
1840 1832
1841 } // namespace content 1833 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/browser/renderer_host/render_widget_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698