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

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

Issue 593503003: Support error handling for Surface readbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatted code and fixed build issue in test. Created 6 years, 1 month 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 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_COLOR_PICKER_H_ 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_COLOR_PICKER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_COLOR_PICKER_H_ 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_COLOR_PICKER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "content/public/browser/render_widget_host.h" 9 #include "content/public/browser/render_widget_host.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
(...skipping 16 matching lines...) Expand all
27 explicit ColorPicker(ColorPickedCallback callback); 27 explicit ColorPicker(ColorPickedCallback callback);
28 virtual ~ColorPicker(); 28 virtual ~ColorPicker();
29 29
30 void SetRenderViewHost(RenderViewHostImpl* host); 30 void SetRenderViewHost(RenderViewHostImpl* host);
31 void SetEnabled(bool enabled); 31 void SetEnabled(bool enabled);
32 void OnSwapCompositorFrame(); 32 void OnSwapCompositorFrame();
33 33
34 private: 34 private:
35 void UpdateFrame(); 35 void UpdateFrame();
36 void ResetFrame(); 36 void ResetFrame();
37 void FrameUpdated(bool succeeded, const SkBitmap& bitmap); 37 void FrameUpdated(const SkBitmap&, ReadbackResponse);
38 bool HandleMouseEvent(const blink::WebMouseEvent& event); 38 bool HandleMouseEvent(const blink::WebMouseEvent& event);
39 void UpdateCursor(); 39 void UpdateCursor();
40 40
41 ColorPickedCallback callback_; 41 ColorPickedCallback callback_;
42 bool enabled_; 42 bool enabled_;
43 SkBitmap frame_; 43 SkBitmap frame_;
44 int last_cursor_x_; 44 int last_cursor_x_;
45 int last_cursor_y_; 45 int last_cursor_y_;
46 RenderWidgetHost::MouseEventCallback mouse_event_callback_; 46 RenderWidgetHost::MouseEventCallback mouse_event_callback_;
47 RenderViewHostImpl* host_; 47 RenderViewHostImpl* host_;
48 base::WeakPtrFactory<ColorPicker> weak_factory_; 48 base::WeakPtrFactory<ColorPicker> weak_factory_;
49 49
50 DISALLOW_COPY_AND_ASSIGN(ColorPicker); 50 DISALLOW_COPY_AND_ASSIGN(ColorPicker);
51 }; 51 };
52 52
53 } // namespace page 53 } // namespace page
54 } // namespace devtools 54 } // namespace devtools
55 } // namespace content 55 } // namespace content
56 56
57 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_COLOR_PICKER_H_ 57 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_COLOR_PICKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698