| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 350 } |
| 351 | 351 |
| 352 Response PageHandler::SetColorPickerEnabled(bool enabled) { | 352 Response PageHandler::SetColorPickerEnabled(bool enabled) { |
| 353 if (!host_) | 353 if (!host_) |
| 354 return Response::InternalError("Could not connect to view"); | 354 return Response::InternalError("Could not connect to view"); |
| 355 | 355 |
| 356 color_picker_->SetEnabled(enabled); | 356 color_picker_->SetEnabled(enabled); |
| 357 return Response::OK(); | 357 return Response::OK(); |
| 358 } | 358 } |
| 359 | 359 |
| 360 Response PageHandler::RequestAppBanner(bool* result) { |
| 361 return Response::InternalError("RequestAppBanner is not supported"); |
| 362 } |
| 363 |
| 360 WebContentsImpl* PageHandler::GetWebContents() { | 364 WebContentsImpl* PageHandler::GetWebContents() { |
| 361 return host_ ? | 365 return host_ ? |
| 362 static_cast<WebContentsImpl*>(WebContents::FromRenderFrameHost(host_)) : | 366 static_cast<WebContentsImpl*>(WebContents::FromRenderFrameHost(host_)) : |
| 363 nullptr; | 367 nullptr; |
| 364 } | 368 } |
| 365 | 369 |
| 366 void PageHandler::NotifyScreencastVisibility(bool visible) { | 370 void PageHandler::NotifyScreencastVisibility(bool visible) { |
| 367 if (visible) | 371 if (visible) |
| 368 capture_retry_count_ = kCaptureRetryLimit; | 372 capture_retry_count_ = kCaptureRetryLimit; |
| 369 client_->ScreencastVisibilityChanged( | 373 client_->ScreencastVisibilityChanged( |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 | 507 |
| 504 void PageHandler::OnColorPicked(int r, int g, int b, int a) { | 508 void PageHandler::OnColorPicked(int r, int g, int b, int a) { |
| 505 scoped_refptr<dom::RGBA> color = | 509 scoped_refptr<dom::RGBA> color = |
| 506 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); | 510 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); |
| 507 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); | 511 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); |
| 508 } | 512 } |
| 509 | 513 |
| 510 } // namespace page | 514 } // namespace page |
| 511 } // namespace devtools | 515 } // namespace devtools |
| 512 } // namespace content | 516 } // namespace content |
| OLD | NEW |