OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/renderer_overrides_handler.h" | 5 #include "content/browser/devtools/renderer_overrides_handler.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/barrier_closure.h" | 10 #include "base/barrier_closure.h" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 scoped_refptr<DevToolsProtocol::Response> | 287 scoped_refptr<DevToolsProtocol::Response> |
288 RendererOverridesHandler::PageHandleJavaScriptDialog( | 288 RendererOverridesHandler::PageHandleJavaScriptDialog( |
289 scoped_refptr<DevToolsProtocol::Command> command) { | 289 scoped_refptr<DevToolsProtocol::Command> command) { |
290 base::DictionaryValue* params = command->params(); | 290 base::DictionaryValue* params = command->params(); |
291 const char* paramAccept = | 291 const char* paramAccept = |
292 devtools::Page::handleJavaScriptDialog::kParamAccept; | 292 devtools::Page::handleJavaScriptDialog::kParamAccept; |
293 bool accept; | 293 bool accept; |
294 if (!params || !params->GetBoolean(paramAccept, &accept)) | 294 if (!params || !params->GetBoolean(paramAccept, &accept)) |
295 return command->InvalidParamResponse(paramAccept); | 295 return command->InvalidParamResponse(paramAccept); |
296 string16 prompt_override; | 296 base::string16 prompt_override; |
297 string16* prompt_override_ptr = &prompt_override; | 297 base::string16* prompt_override_ptr = &prompt_override; |
298 if (!params || !params->GetString( | 298 if (!params || !params->GetString( |
299 devtools::Page::handleJavaScriptDialog::kParamPromptText, | 299 devtools::Page::handleJavaScriptDialog::kParamPromptText, |
300 prompt_override_ptr)) { | 300 prompt_override_ptr)) { |
301 prompt_override_ptr = NULL; | 301 prompt_override_ptr = NULL; |
302 } | 302 } |
303 | 303 |
304 RenderViewHost* host = agent_->GetRenderViewHost(); | 304 RenderViewHost* host = agent_->GetRenderViewHost(); |
305 if (host) { | 305 if (host) { |
306 WebContents* web_contents = host->GetDelegate()->GetAsWebContents(); | 306 WebContents* web_contents = host->GetDelegate()->GetAsWebContents(); |
307 if (web_contents) { | 307 if (web_contents) { |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 return NULL; | 953 return NULL; |
954 } | 954 } |
955 event.data.pinchUpdate.scale = static_cast<float>(scale); | 955 event.data.pinchUpdate.scale = static_cast<float>(scale); |
956 } | 956 } |
957 | 957 |
958 host->ForwardGestureEvent(event); | 958 host->ForwardGestureEvent(event); |
959 return command->SuccessResponse(NULL); | 959 return command->SuccessResponse(NULL); |
960 } | 960 } |
961 | 961 |
962 } // namespace content | 962 } // namespace content |
OLD | NEW |