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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 color_picker_->SetRenderWidgetHost(widget_host); | 129 color_picker_->SetRenderWidgetHost(widget_host); |
130 | 130 |
131 if (widget_host) { | 131 if (widget_host) { |
132 registrar_.Add( | 132 registrar_.Add( |
133 this, | 133 this, |
134 content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, | 134 content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, |
135 content::Source<RenderWidgetHost>(widget_host)); | 135 content::Source<RenderWidgetHost>(widget_host)); |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 void PageHandler::SetClient(scoped_ptr<Client> client) { | 139 void PageHandler::SetClient(std::unique_ptr<Client> client) { |
140 client_.swap(client); | 140 client_.swap(client); |
141 } | 141 } |
142 | 142 |
143 void PageHandler::Detached() { | 143 void PageHandler::Detached() { |
144 Disable(); | 144 Disable(); |
145 } | 145 } |
146 | 146 |
147 void PageHandler::OnSwapCompositorFrame( | 147 void PageHandler::OnSwapCompositorFrame( |
148 const cc::CompositorFrameMetadata& frame_metadata) { | 148 const cc::CompositorFrameMetadata& frame_metadata) { |
149 last_compositor_frame_metadata_ = frame_metadata; | 149 last_compositor_frame_metadata_ = frame_metadata; |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 | 514 |
515 void PageHandler::OnColorPicked(int r, int g, int b, int a) { | 515 void PageHandler::OnColorPicked(int r, int g, int b, int a) { |
516 scoped_refptr<dom::RGBA> color = | 516 scoped_refptr<dom::RGBA> color = |
517 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); | 517 dom::RGBA::Create()->set_r(r)->set_g(g)->set_b(b)->set_a(a); |
518 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); | 518 client_->ColorPicked(ColorPickedParams::Create()->set_color(color)); |
519 } | 519 } |
520 | 520 |
521 } // namespace page | 521 } // namespace page |
522 } // namespace devtools | 522 } // namespace devtools |
523 } // namespace content | 523 } // namespace content |
OLD | NEW |