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

Side by Side Diff: content/browser/devtools/protocol/page_handler.cc

Issue 691823002: Add WebContents source to methods in WebContentsDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 prompt_override = base::UTF8ToUTF16(*prompt_text); 366 prompt_override = base::UTF8ToUTF16(*prompt_text);
367 367
368 if (!host_) 368 if (!host_)
369 return Response::InternalError("Could not connect to view"); 369 return Response::InternalError("Could not connect to view");
370 370
371 WebContents* web_contents = WebContents::FromRenderViewHost(host_); 371 WebContents* web_contents = WebContents::FromRenderViewHost(host_);
372 if (!web_contents) 372 if (!web_contents)
373 return Response::InternalError("No JavaScript dialog to handle"); 373 return Response::InternalError("No JavaScript dialog to handle");
374 374
375 JavaScriptDialogManager* manager = 375 JavaScriptDialogManager* manager =
376 web_contents->GetDelegate()->GetJavaScriptDialogManager(); 376 web_contents->GetDelegate()->GetJavaScriptDialogManager(web_contents);
377 if (manager && manager->HandleJavaScriptDialog( 377 if (manager && manager->HandleJavaScriptDialog(
378 web_contents, accept, prompt_text ? &prompt_override : nullptr)) { 378 web_contents, accept, prompt_text ? &prompt_override : nullptr)) {
379 return Response::OK(); 379 return Response::OK();
380 } 380 }
381 381
382 return Response::InternalError("Could not handle JavaScript dialog"); 382 return Response::InternalError("Could not handle JavaScript dialog");
383 } 383 }
384 384
385 scoped_refptr<DevToolsProtocol::Response> PageHandler::QueryUsageAndQuota( 385 scoped_refptr<DevToolsProtocol::Response> PageHandler::QueryUsageAndQuota(
386 const std::string& security_origin, 386 const std::string& security_origin,
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 584
585 void PageHandler::QueryUsageAndQuotaCompleted( 585 void PageHandler::QueryUsageAndQuotaCompleted(
586 scoped_refptr<DevToolsProtocol::Command> command, 586 scoped_refptr<DevToolsProtocol::Command> command,
587 scoped_refptr<QueryUsageAndQuotaResponse> response_data) { 587 scoped_refptr<QueryUsageAndQuotaResponse> response_data) {
588 client_->SendQueryUsageAndQuotaResponse(command, response_data); 588 client_->SendQueryUsageAndQuotaResponse(command, response_data);
589 } 589 }
590 590
591 } // namespace page 591 } // namespace page
592 } // namespace devtools 592 } // namespace devtools
593 } // namespace content 593 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698