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

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

Issue 1569893003: Add "Request app banner" context menu in DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated pfeldman's comment Created 4 years, 11 months 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 WebContentsImpl* web_contents = GetWebContents();
362 if (!web_contents)
363 return Response::InternalError("Could not connect to view");
364 *result = web_contents->GetDelegate()->RequestAppBanner(web_contents);
365 return Response::OK();
366 }
367
360 WebContentsImpl* PageHandler::GetWebContents() { 368 WebContentsImpl* PageHandler::GetWebContents() {
361 return host_ ? 369 return host_ ?
362 static_cast<WebContentsImpl*>(WebContents::FromRenderFrameHost(host_)) : 370 static_cast<WebContentsImpl*>(WebContents::FromRenderFrameHost(host_)) :
363 nullptr; 371 nullptr;
364 } 372 }
365 373
366 void PageHandler::NotifyScreencastVisibility(bool visible) { 374 void PageHandler::NotifyScreencastVisibility(bool visible) {
367 if (visible) 375 if (visible)
368 capture_retry_count_ = kCaptureRetryLimit; 376 capture_retry_count_ = kCaptureRetryLimit;
369 client_->ScreencastVisibilityChanged( 377 client_->ScreencastVisibilityChanged(
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 511
504 void PageHandler::OnColorPicked(int r, int g, int b, int a) { 512 void PageHandler::OnColorPicked(int r, int g, int b, int a) {
505 scoped_refptr<dom::RGBA> color = 513 scoped_refptr<dom::RGBA> color =
506 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);
507 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); 515 client_->ColorPicked(ColorPickedParams::Create()->set_color(color));
508 } 516 }
509 517
510 } // namespace page 518 } // namespace page
511 } // namespace devtools 519 } // namespace devtools
512 } // namespace content 520 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/page_handler.h ('k') | content/public/browser/web_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698