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

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

Issue 2525903003: Add Page.stopLoading to devtools and --timeout switch to headless_shell (Closed)
Patch Set: FixPage.stopLoading command description. Created 4 years 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
« no previous file with comments | « content/browser/devtools/protocol/page_handler.h ('k') | headless/app/headless_shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 client_->SendCaptureScreenshotResponse(command_id, 633 client_->SendCaptureScreenshotResponse(command_id,
634 CaptureScreenshotResponse::Create()->set_data(base_64_data)); 634 CaptureScreenshotResponse::Create()->set_data(base_64_data));
635 } 635 }
636 636
637 void PageHandler::OnColorPicked(int r, int g, int b, int a) { 637 void PageHandler::OnColorPicked(int r, int g, int b, int a) {
638 scoped_refptr<dom::RGBA> color = 638 scoped_refptr<dom::RGBA> color =
639 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); 639 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a);
640 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); 640 client_->ColorPicked(ColorPickedParams::Create()->set_color(color));
641 } 641 }
642 642
643 Response PageHandler::StopLoading() {
644 WebContentsImpl* web_contents = GetWebContents();
645 if (!web_contents)
646 return Response::InternalError("Could not connect to view");
647 web_contents->Stop();
648 return Response::OK();
649 }
650
643 } // namespace page 651 } // namespace page
644 } // namespace devtools 652 } // namespace devtools
645 } // namespace content 653 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/page_handler.h ('k') | headless/app/headless_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698