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

Side by Side Diff: chrome/browser/renderer_host/render_view_host.cc

Issue 348056: Highlight node with mouse over it while selecting element to inspect (Closed)
Patch Set: Created 11 years, 1 month 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_view_host.h" 5 #include "chrome/browser/renderer_host/render_view_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 delegate_(delegate), 110 delegate_(delegate),
111 waiting_for_drag_context_response_(false), 111 waiting_for_drag_context_response_(false),
112 enabled_bindings_(0), 112 enabled_bindings_(0),
113 pending_request_id_(0), 113 pending_request_id_(0),
114 navigations_suspended_(false), 114 navigations_suspended_(false),
115 suspended_nav_message_(NULL), 115 suspended_nav_message_(NULL),
116 run_modal_reply_msg_(NULL), 116 run_modal_reply_msg_(NULL),
117 is_waiting_for_unload_ack_(false), 117 is_waiting_for_unload_ack_(false),
118 unload_ack_is_for_cross_site_transition_(false), 118 unload_ack_is_for_cross_site_transition_(false),
119 are_javascript_messages_suppressed_(false), 119 are_javascript_messages_suppressed_(false),
120 sudden_termination_allowed_(false), 120 sudden_termination_allowed_(false) {
121 in_inspect_element_mode_(false) {
122 DCHECK(instance_); 121 DCHECK(instance_);
123 DCHECK(delegate_); 122 DCHECK(delegate_);
124 123
125 // TODO(mpcomplete): remove this notification (and registrar) when we figure 124 // TODO(mpcomplete): remove this notification (and registrar) when we figure
126 // out why we're crashing on process()->Init(). 125 // out why we're crashing on process()->Init().
127 // http://code.google.com/p/chromium/issues/detail?id=15607 126 // http://code.google.com/p/chromium/issues/detail?id=15607
128 registrar_.Add(this, NotificationType::RENDERER_PROCESS_TERMINATED, 127 registrar_.Add(this, NotificationType::RENDERER_PROCESS_TERMINATED,
129 NotificationService::AllSources()); 128 NotificationService::AllSources());
130 } 129 }
131 130
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardToDevToolsClient, 798 IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardToDevToolsClient,
800 OnForwardToDevToolsClient); 799 OnForwardToDevToolsClient);
801 IPC_MESSAGE_HANDLER(ViewHostMsg_ActivateDevToolsWindow, 800 IPC_MESSAGE_HANDLER(ViewHostMsg_ActivateDevToolsWindow,
802 OnActivateDevToolsWindow); 801 OnActivateDevToolsWindow);
803 IPC_MESSAGE_HANDLER(ViewHostMsg_CloseDevToolsWindow, 802 IPC_MESSAGE_HANDLER(ViewHostMsg_CloseDevToolsWindow,
804 OnCloseDevToolsWindow); 803 OnCloseDevToolsWindow);
805 IPC_MESSAGE_HANDLER(ViewHostMsg_DockDevToolsWindow, 804 IPC_MESSAGE_HANDLER(ViewHostMsg_DockDevToolsWindow,
806 OnDockDevToolsWindow); 805 OnDockDevToolsWindow);
807 IPC_MESSAGE_HANDLER(ViewHostMsg_UndockDevToolsWindow, 806 IPC_MESSAGE_HANDLER(ViewHostMsg_UndockDevToolsWindow,
808 OnUndockDevToolsWindow); 807 OnUndockDevToolsWindow);
809 IPC_MESSAGE_HANDLER(ViewHostMsg_ToggleInspectElementMode,
810 OnToggleInspectElementMode);
811 IPC_MESSAGE_HANDLER(ViewHostMsg_DevToolsRuntimeFeatureStateChanged, 808 IPC_MESSAGE_HANDLER(ViewHostMsg_DevToolsRuntimeFeatureStateChanged,
812 OnDevToolsRuntimeFeatureStateChanged); 809 OnDevToolsRuntimeFeatureStateChanged);
813 IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction, 810 IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction,
814 OnUserMetricsRecordAction) 811 OnUserMetricsRecordAction)
815 IPC_MESSAGE_HANDLER(ViewHostMsg_MissingPluginStatus, OnMissingPluginStatus); 812 IPC_MESSAGE_HANDLER(ViewHostMsg_MissingPluginStatus, OnMissingPluginStatus);
816 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin); 813 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin);
817 IPC_MESSAGE_HANDLER(ViewHostMsg_SendCurrentPageAllSavableResourceLinks, 814 IPC_MESSAGE_HANDLER(ViewHostMsg_SendCurrentPageAllSavableResourceLinks,
818 OnReceivedSavableResourceLinksForCurrentPage); 815 OnReceivedSavableResourceLinksForCurrentPage);
819 IPC_MESSAGE_HANDLER(ViewHostMsg_SendSerializedHtmlData, 816 IPC_MESSAGE_HANDLER(ViewHostMsg_SendSerializedHtmlData,
820 OnReceivedSerializedHtmlData); 817 OnReceivedSerializedHtmlData);
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 } 1426 }
1430 1427
1431 void RenderViewHost::OnDockDevToolsWindow() { 1428 void RenderViewHost::OnDockDevToolsWindow() {
1432 DevToolsManager::GetInstance()->DockWindow(this); 1429 DevToolsManager::GetInstance()->DockWindow(this);
1433 } 1430 }
1434 1431
1435 void RenderViewHost::OnUndockDevToolsWindow() { 1432 void RenderViewHost::OnUndockDevToolsWindow() {
1436 DevToolsManager::GetInstance()->UndockWindow(this); 1433 DevToolsManager::GetInstance()->UndockWindow(this);
1437 } 1434 }
1438 1435
1439 void RenderViewHost::OnToggleInspectElementMode(bool enabled) {
1440 DevToolsManager::GetInstance()->ToggleInspectElementMode(this, enabled);
1441 }
1442
1443 void RenderViewHost::OnDevToolsRuntimeFeatureStateChanged( 1436 void RenderViewHost::OnDevToolsRuntimeFeatureStateChanged(
1444 const std::string& feature, 1437 const std::string& feature,
1445 bool enabled) { 1438 bool enabled) {
1446 DevToolsManager::GetInstance()-> 1439 DevToolsManager::GetInstance()->
1447 RuntimeFeatureStateChanged(this, feature, enabled); 1440 RuntimeFeatureStateChanged(this, feature, enabled);
1448 } 1441 }
1449 1442
1450 void RenderViewHost::OnUserMetricsRecordAction(const std::wstring& action) { 1443 void RenderViewHost::OnUserMetricsRecordAction(const std::wstring& action) {
1451 UserMetrics::RecordComputedAction(action.c_str(), process()->profile()); 1444 UserMetrics::RecordComputedAction(action.c_str(), process()->profile());
1452 } 1445 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1600 void RenderViewHost::OnMsgFocusedNodeChanged() { 1593 void RenderViewHost::OnMsgFocusedNodeChanged() {
1601 delegate_->FocusedNodeChanged(); 1594 delegate_->FocusedNodeChanged();
1602 } 1595 }
1603 1596
1604 gfx::Rect RenderViewHost::GetRootWindowResizerRect() const { 1597 gfx::Rect RenderViewHost::GetRootWindowResizerRect() const {
1605 return delegate_->GetRootWindowResizerRect(); 1598 return delegate_->GetRootWindowResizerRect();
1606 } 1599 }
1607 1600
1608 void RenderViewHost::ForwardMouseEvent( 1601 void RenderViewHost::ForwardMouseEvent(
1609 const WebKit::WebMouseEvent& mouse_event) { 1602 const WebKit::WebMouseEvent& mouse_event) {
1610 if (in_inspect_element_mode_ &&
1611 mouse_event.type == WebInputEvent::MouseDown) {
1612 in_inspect_element_mode_ = false;
1613 DevToolsManager::GetInstance()->InspectElement(this, mouse_event.x,
1614 mouse_event.y);
1615 return;
1616 }
1617 1603
1618 // We make a copy of the mouse event because 1604 // We make a copy of the mouse event because
1619 // RenderWidgetHost::ForwardMouseEvent will delete |mouse_event|. 1605 // RenderWidgetHost::ForwardMouseEvent will delete |mouse_event|.
1620 WebKit::WebMouseEvent event_copy(mouse_event); 1606 WebKit::WebMouseEvent event_copy(mouse_event);
1621 RenderWidgetHost::ForwardMouseEvent(event_copy); 1607 RenderWidgetHost::ForwardMouseEvent(event_copy);
1622 1608
1623 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); 1609 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
1624 if (view) { 1610 if (view) {
1625 switch (event_copy.type) { 1611 switch (event_copy.type) {
1626 case WebInputEvent::MouseMove: 1612 case WebInputEvent::MouseMove:
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1741 #endif 1727 #endif
1742 } 1728 }
1743 1729
1744 void RenderViewHost::OnCSSInserted() { 1730 void RenderViewHost::OnCSSInserted() {
1745 delegate_->DidInsertCSS(); 1731 delegate_->DidInsertCSS();
1746 } 1732 }
1747 1733
1748 void RenderViewHost::UpdateBrowserWindowId(int window_id) { 1734 void RenderViewHost::UpdateBrowserWindowId(int window_id) {
1749 Send(new ViewMsg_UpdateBrowserWindowId(routing_id(), window_id)); 1735 Send(new ViewMsg_UpdateBrowserWindowId(routing_id(), window_id));
1750 } 1736 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_view_host.h ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698