| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/protocol/page_handler.h" | 5 #include "content/browser/devtools/protocol/page_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 prompt_override = base::UTF8ToUTF16(*prompt_text); | 355 prompt_override = base::UTF8ToUTF16(*prompt_text); |
| 356 | 356 |
| 357 if (!host_) | 357 if (!host_) |
| 358 return Response::InternalError("Could not connect to view"); | 358 return Response::InternalError("Could not connect to view"); |
| 359 | 359 |
| 360 WebContents* web_contents = WebContents::FromRenderViewHost(host_); | 360 WebContents* web_contents = WebContents::FromRenderViewHost(host_); |
| 361 if (!web_contents) | 361 if (!web_contents) |
| 362 return Response::InternalError("No JavaScript dialog to handle"); | 362 return Response::InternalError("No JavaScript dialog to handle"); |
| 363 | 363 |
| 364 JavaScriptDialogManager* manager = | 364 JavaScriptDialogManager* manager = |
| 365 web_contents->GetDelegate()->GetJavaScriptDialogManager(); | 365 web_contents->GetDelegate()->GetJavaScriptDialogManager(web_contents); |
| 366 if (manager && manager->HandleJavaScriptDialog( | 366 if (manager && manager->HandleJavaScriptDialog( |
| 367 web_contents, accept, prompt_text ? &prompt_override : nullptr)) { | 367 web_contents, accept, prompt_text ? &prompt_override : nullptr)) { |
| 368 return Response::OK(); | 368 return Response::OK(); |
| 369 } | 369 } |
| 370 | 370 |
| 371 return Response::InternalError("Could not handle JavaScript dialog"); | 371 return Response::InternalError("Could not handle JavaScript dialog"); |
| 372 } | 372 } |
| 373 | 373 |
| 374 scoped_refptr<DevToolsProtocol::Response> PageHandler::QueryUsageAndQuota( | 374 scoped_refptr<DevToolsProtocol::Response> PageHandler::QueryUsageAndQuota( |
| 375 const std::string& security_origin, | 375 const std::string& security_origin, |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 | 597 |
| 598 void PageHandler::QueryUsageAndQuotaCompleted( | 598 void PageHandler::QueryUsageAndQuotaCompleted( |
| 599 scoped_refptr<DevToolsProtocol::Command> command, | 599 scoped_refptr<DevToolsProtocol::Command> command, |
| 600 scoped_ptr<QueryUsageAndQuotaResponse> response_data) { | 600 scoped_ptr<QueryUsageAndQuotaResponse> response_data) { |
| 601 client_->SendQueryUsageAndQuotaResponse(command, *response_data); | 601 client_->SendQueryUsageAndQuotaResponse(command, *response_data); |
| 602 } | 602 } |
| 603 | 603 |
| 604 } // namespace page | 604 } // namespace page |
| 605 } // namespace devtools | 605 } // namespace devtools |
| 606 } // namespace content | 606 } // namespace content |
| OLD | NEW |