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/devtools/devtools_frontend_host.h" | 5 #include "content/browser/devtools/devtools_frontend_host.h" |
6 | 6 |
7 #include "content/browser/devtools/devtools_manager_impl.h" | 7 #include "content/browser/devtools/devtools_manager_impl.h" |
8 #include "content/browser/renderer_host/render_view_host_impl.h" | 8 #include "content/browser/renderer_host/render_view_host_impl.h" |
9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
10 #include "content/common/devtools_messages.h" | 10 #include "content/common/devtools_messages.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 void DevToolsFrontendHost::ReplacedWithAnotherClient() { | 57 void DevToolsFrontendHost::ReplacedWithAnotherClient() { |
58 } | 58 } |
59 | 59 |
60 bool DevToolsFrontendHost::OnMessageReceived( | 60 bool DevToolsFrontendHost::OnMessageReceived( |
61 const IPC::Message& message) { | 61 const IPC::Message& message) { |
62 bool handled = true; | 62 bool handled = true; |
63 IPC_BEGIN_MESSAGE_MAP(DevToolsFrontendHost, message) | 63 IPC_BEGIN_MESSAGE_MAP(DevToolsFrontendHost, message) |
64 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DispatchOnInspectorBackend, | 64 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DispatchOnInspectorBackend, |
65 OnDispatchOnInspectorBackend) | 65 OnDispatchOnInspectorBackend) |
66 IPC_MESSAGE_HANDLER(DevToolsHostMsg_ActivateWindow, OnActivateWindow) | 66 IPC_MESSAGE_HANDLER(DevToolsHostMsg_DispatchOnEmbedder, |
67 IPC_MESSAGE_HANDLER(DevToolsHostMsg_ChangeAttachedWindowHeight, | 67 OnDispatchOnEmbedder) |
68 OnChangeAttachedWindowHeight) | |
69 IPC_MESSAGE_HANDLER(DevToolsHostMsg_CloseWindow, OnCloseWindow) | |
70 IPC_MESSAGE_HANDLER(DevToolsHostMsg_MoveWindow, OnMoveWindow) | |
71 IPC_MESSAGE_HANDLER(DevToolsHostMsg_RequestSetDockSide, | |
72 OnRequestSetDockSide) | |
73 IPC_MESSAGE_HANDLER(DevToolsHostMsg_OpenInNewTab, OnOpenInNewTab) | |
74 IPC_MESSAGE_HANDLER(DevToolsHostMsg_Save, OnSave) | |
75 IPC_MESSAGE_HANDLER(DevToolsHostMsg_Append, OnAppend) | |
76 IPC_MESSAGE_HANDLER(DevToolsHostMsg_RequestFileSystems, | |
77 OnRequestFileSystems) | |
78 IPC_MESSAGE_HANDLER(DevToolsHostMsg_AddFileSystem, OnAddFileSystem) | |
79 IPC_MESSAGE_HANDLER(DevToolsHostMsg_RemoveFileSystem, OnRemoveFileSystem) | |
80 IPC_MESSAGE_HANDLER(DevToolsHostMsg_IndexPath, OnIndexPath) | |
81 IPC_MESSAGE_HANDLER(DevToolsHostMsg_StopIndexing, OnStopIndexing) | |
82 IPC_MESSAGE_HANDLER(DevToolsHostMsg_SearchInPath, OnSearchInPath) | |
83 IPC_MESSAGE_UNHANDLED(handled = false) | 68 IPC_MESSAGE_UNHANDLED(handled = false) |
84 IPC_END_MESSAGE_MAP() | 69 IPC_END_MESSAGE_MAP() |
85 return handled; | 70 return handled; |
86 } | 71 } |
87 | 72 |
88 void DevToolsFrontendHost::RenderProcessGone( | 73 void DevToolsFrontendHost::RenderProcessGone( |
89 base::TerminationStatus status) { | 74 base::TerminationStatus status) { |
90 switch(status) { | 75 switch(status) { |
91 case base::TERMINATION_STATUS_ABNORMAL_TERMINATION: | 76 case base::TERMINATION_STATUS_ABNORMAL_TERMINATION: |
92 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: | 77 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: |
93 case base::TERMINATION_STATUS_PROCESS_CRASHED: | 78 case base::TERMINATION_STATUS_PROCESS_CRASHED: |
94 DevToolsManager::GetInstance()->ClientHostClosing(this); | 79 DevToolsManager::GetInstance()->ClientHostClosing(this); |
95 break; | 80 break; |
96 default: | 81 default: |
97 break; | 82 break; |
98 } | 83 } |
99 } | 84 } |
100 | 85 |
101 void DevToolsFrontendHost::OnDispatchOnInspectorBackend( | 86 void DevToolsFrontendHost::OnDispatchOnInspectorBackend( |
102 const std::string& message) { | 87 const std::string& message) { |
103 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorBackend(this, message); | 88 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorBackend(this, message); |
104 // delegate_->DispatchOnInspectorBackend(message); | |
105 } | 89 } |
106 | 90 |
107 void DevToolsFrontendHost::OnActivateWindow() { | 91 void DevToolsFrontendHost::OnDispatchOnEmbedder( |
108 delegate_->ActivateWindow(); | 92 const std::string& message) { |
109 } | 93 delegate_->DispatchOnEmbedder(message); |
110 | |
111 void DevToolsFrontendHost::OnChangeAttachedWindowHeight(unsigned height) { | |
112 delegate_->ChangeAttachedWindowHeight(height); | |
113 } | |
114 | |
115 void DevToolsFrontendHost::OnCloseWindow() { | |
116 delegate_->CloseWindow(); | |
117 } | |
118 | |
119 void DevToolsFrontendHost::OnMoveWindow(int x, int y) { | |
120 delegate_->MoveWindow(x, y); | |
121 } | |
122 | |
123 void DevToolsFrontendHost::OnOpenInNewTab(const std::string& url) { | |
124 delegate_->OpenInNewTab(url); | |
125 } | |
126 | |
127 void DevToolsFrontendHost::OnSave( | |
128 const std::string& url, | |
129 const std::string& content, | |
130 bool save_as) { | |
131 delegate_->SaveToFile(url, content, save_as); | |
132 } | |
133 | |
134 void DevToolsFrontendHost::OnAppend( | |
135 const std::string& url, | |
136 const std::string& content) { | |
137 delegate_->AppendToFile(url, content); | |
138 } | |
139 | |
140 void DevToolsFrontendHost::OnRequestFileSystems() { | |
141 delegate_->RequestFileSystems(); | |
142 } | |
143 | |
144 void DevToolsFrontendHost::OnAddFileSystem() { | |
145 delegate_->AddFileSystem(); | |
146 } | |
147 | |
148 void DevToolsFrontendHost::OnRemoveFileSystem( | |
149 const std::string& file_system_path) { | |
150 delegate_->RemoveFileSystem(file_system_path); | |
151 } | |
152 | |
153 void DevToolsFrontendHost::OnIndexPath(int request_id, | |
154 const std::string& file_system_path) { | |
155 delegate_->IndexPath(request_id, file_system_path); | |
156 } | |
157 | |
158 void DevToolsFrontendHost::OnStopIndexing(int request_id) { | |
159 delegate_->StopIndexing(request_id); | |
160 } | |
161 | |
162 void DevToolsFrontendHost::OnSearchInPath(int request_id, | |
163 const std::string& file_system_path, | |
164 const std::string& query) { | |
165 delegate_->SearchInPath(request_id, file_system_path, query); | |
166 } | |
167 | |
168 void DevToolsFrontendHost::OnRequestSetDockSide(const std::string& side) { | |
169 delegate_->SetDockSide(side); | |
170 } | 94 } |
171 | 95 |
172 } // namespace content | 96 } // namespace content |
OLD | NEW |