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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |