| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } | 191 } |
| 192 | 192 |
| 193 void PageHandler::DidDetachInterstitialPage() { | 193 void PageHandler::DidDetachInterstitialPage() { |
| 194 if (!enabled_) | 194 if (!enabled_) |
| 195 return; | 195 return; |
| 196 client_->InterstitialHidden(InterstitialHiddenParams::Create()); | 196 client_->InterstitialHidden(InterstitialHiddenParams::Create()); |
| 197 } | 197 } |
| 198 | 198 |
| 199 Response PageHandler::Enable() { | 199 Response PageHandler::Enable() { |
| 200 enabled_ = true; | 200 enabled_ = true; |
| 201 if (GetWebContents() && GetWebContents()->ShowingInterstitialPage()) |
| 202 client_->InterstitialShown(InterstitialShownParams::Create()); |
| 201 return Response::FallThrough(); | 203 return Response::FallThrough(); |
| 202 } | 204 } |
| 203 | 205 |
| 204 Response PageHandler::Disable() { | 206 Response PageHandler::Disable() { |
| 205 enabled_ = false; | 207 enabled_ = false; |
| 206 screencast_enabled_ = false; | 208 screencast_enabled_ = false; |
| 207 SetControlNavigations(false); | 209 SetControlNavigations(false); |
| 208 color_picker_->SetEnabled(false); | 210 color_picker_->SetEnabled(false); |
| 209 return Response::FallThrough(); | 211 return Response::FallThrough(); |
| 210 } | 212 } |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 | 638 |
| 637 void PageHandler::OnColorPicked(int r, int g, int b, int a) { | 639 void PageHandler::OnColorPicked(int r, int g, int b, int a) { |
| 638 scoped_refptr<dom::RGBA> color = | 640 scoped_refptr<dom::RGBA> color = |
| 639 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); | 641 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); |
| 640 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); | 642 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); |
| 641 } | 643 } |
| 642 | 644 |
| 643 } // namespace page | 645 } // namespace page |
| 644 } // namespace devtools | 646 } // namespace devtools |
| 645 } // namespace content | 647 } // namespace content |
| OLD | NEW |