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

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

Issue 2548263002: [DevTools] Migrate dom, emulation, inspector, network, page and schema handlers to new generator. (Closed)
Patch Set: rebased atop of roll Created 4 years 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 "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/browser/renderer_host/render_view_host_impl.h" 9 #include "content/browser/renderer_host/render_view_host_impl.h"
10 #include "content/browser/renderer_host/render_widget_host_view_base.h" 10 #include "content/browser/renderer_host/render_widget_host_view_base.h"
11 #include "content/common/cursors/webcursor.h" 11 #include "content/common/cursors/webcursor.h"
12 #include "content/public/common/screen_info.h" 12 #include "content/public/common/screen_info.h"
13 #include "third_party/WebKit/public/platform/WebCursorInfo.h" 13 #include "third_party/WebKit/public/platform/WebCursorInfo.h"
14 #include "third_party/WebKit/public/platform/WebInputEvent.h" 14 #include "third_party/WebKit/public/platform/WebInputEvent.h"
15 #include "third_party/skia/include/core/SkCanvas.h" 15 #include "third_party/skia/include/core/SkCanvas.h"
16 #include "third_party/skia/include/core/SkPaint.h" 16 #include "third_party/skia/include/core/SkPaint.h"
17 #include "third_party/skia/include/core/SkPath.h" 17 #include "third_party/skia/include/core/SkPath.h"
18 #include "ui/gfx/geometry/size_conversions.h" 18 #include "ui/gfx/geometry/size_conversions.h"
19 19
20 namespace content { 20 namespace content {
21 namespace devtools { 21 namespace protocol {
22 namespace page {
23 22
24 ColorPicker::ColorPicker(ColorPickedCallback callback) 23 ColorPicker::ColorPicker(ColorPickedCallback callback)
25 : callback_(callback), 24 : callback_(callback),
26 enabled_(false), 25 enabled_(false),
27 last_cursor_x_(-1), 26 last_cursor_x_(-1),
28 last_cursor_y_(-1), 27 last_cursor_y_(-1),
29 host_(nullptr), 28 host_(nullptr),
30 weak_factory_(this) { 29 weak_factory_(this) {
31 mouse_event_callback_ = base::Bind( 30 mouse_event_callback_ = base::Bind(
32 &ColorPicker::HandleMouseEvent, 31 &ColorPicker::HandleMouseEvent,
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 cursor_info.custom_image = result; 251 cursor_info.custom_image = result;
253 cursor_info.hotspot = 252 cursor_info.hotspot =
254 gfx::Point(kHotspotOffset * device_scale_factor, 253 gfx::Point(kHotspotOffset * device_scale_factor,
255 kHotspotOffset * device_scale_factor); 254 kHotspotOffset * device_scale_factor);
256 255
257 cursor.InitFromCursorInfo(cursor_info); 256 cursor.InitFromCursorInfo(cursor_info);
258 DCHECK(host_); 257 DCHECK(host_);
259 host_->SetCursor(cursor); 258 host_->SetCursor(cursor);
260 } 259 }
261 260
262 } // namespace page 261 } // namespace protocol
263 } // namespace devtools
264 } // namespace content 262 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698