| 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) { | 360 Response PageHandler::RequestAppBanner() { |
| 361 WebContentsImpl* web_contents = GetWebContents(); | 361 WebContentsImpl* web_contents = GetWebContents(); |
| 362 if (!web_contents) | 362 if (!web_contents) |
| 363 return Response::InternalError("Could not connect to view"); | 363 return Response::InternalError("Could not connect to view"); |
| 364 *result = web_contents->GetDelegate()->RequestAppBanner(web_contents); | 364 web_contents->GetDelegate()->RequestAppBannerFromDevTools(web_contents); |
| 365 return Response::OK(); | 365 return Response::OK(); |
| 366 } | 366 } |
| 367 | 367 |
| 368 WebContentsImpl* PageHandler::GetWebContents() { | 368 WebContentsImpl* PageHandler::GetWebContents() { |
| 369 return host_ ? | 369 return host_ ? |
| 370 static_cast<WebContentsImpl*>(WebContents::FromRenderFrameHost(host_)) : | 370 static_cast<WebContentsImpl*>(WebContents::FromRenderFrameHost(host_)) : |
| 371 nullptr; | 371 nullptr; |
| 372 } | 372 } |
| 373 | 373 |
| 374 void PageHandler::NotifyScreencastVisibility(bool visible) { | 374 void PageHandler::NotifyScreencastVisibility(bool visible) { |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 511 |
| 512 void PageHandler::OnColorPicked(int r, int g, int b, int a) { | 512 void PageHandler::OnColorPicked(int r, int g, int b, int a) { |
| 513 scoped_refptr<dom::RGBA> color = | 513 scoped_refptr<dom::RGBA> color = |
| 514 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); | 514 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); |
| 515 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); | 515 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); |
| 516 } | 516 } |
| 517 | 517 |
| 518 } // namespace page | 518 } // namespace page |
| 519 } // namespace devtools | 519 } // namespace devtools |
| 520 } // namespace content | 520 } // namespace content |
| OLD | NEW |