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

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

Issue 1043173003: [DevTools] Move Page and Emulation handlers to RenderFrameHostImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix non-debug-devtools compilation Created 5 years, 8 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/color_picker.h" 5 #include "content/browser/devtools/protocol/color_picker.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/browser/renderer_host/render_view_host_impl.h" 8 #include "content/browser/renderer_host/render_view_host_impl.h"
9 #include "content/browser/renderer_host/render_widget_host_view_base.h" 9 #include "content/browser/renderer_host/render_widget_host_view_base.h"
10 #include "content/common/cursors/webcursor.h" 10 #include "content/common/cursors/webcursor.h"
(...skipping 15 matching lines...) Expand all
26 host_(nullptr), 26 host_(nullptr),
27 weak_factory_(this) { 27 weak_factory_(this) {
28 mouse_event_callback_ = base::Bind( 28 mouse_event_callback_ = base::Bind(
29 &ColorPicker::HandleMouseEvent, 29 &ColorPicker::HandleMouseEvent,
30 base::Unretained(this)); 30 base::Unretained(this));
31 } 31 }
32 32
33 ColorPicker::~ColorPicker() { 33 ColorPicker::~ColorPicker() {
34 } 34 }
35 35
36 void ColorPicker::SetRenderViewHost(RenderViewHostImpl* host) { 36 void ColorPicker::SetRenderWidgetHost(RenderWidgetHostImpl* host) {
37 if (host_ == host) 37 if (host_ == host)
38 return; 38 return;
39 39
40 if (host_) 40 if (host_)
41 host_->RemoveMouseEventCallback(mouse_event_callback_); 41 host_->RemoveMouseEventCallback(mouse_event_callback_);
42 ResetFrame(); 42 ResetFrame();
43 host_ = host; 43 host_ = host;
44 if (enabled_ && host) 44 if (enabled_ && host)
45 host->AddMouseEventCallback(mouse_event_callback_); 45 host->AddMouseEventCallback(mouse_event_callback_);
46 } 46 }
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 #endif 255 #endif
256 256
257 cursor.InitFromCursorInfo(cursor_info); 257 cursor.InitFromCursorInfo(cursor_info);
258 DCHECK(host_); 258 DCHECK(host_);
259 host_->SetCursor(cursor); 259 host_->SetCursor(cursor);
260 } 260 }
261 261
262 } // namespace page 262 } // namespace page
263 } // namespace devtools 263 } // namespace devtools
264 } // namespace content 264 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/color_picker.h ('k') | content/browser/devtools/protocol/emulation_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698