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

Side by Side Diff: pdf/button.h

Issue 1125103002: Remove the in-process PDF viewer from pdf/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-in-process-instance
Patch Set: Created 5 years, 7 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
« no previous file with comments | « pdf/BUILD.gn ('k') | pdf/button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef PDF_BUTTON_H_
6 #define PDF_BUTTON_H_
7
8 #include "pdf/control.h"
9 #include "ppapi/cpp/image_data.h"
10 #include "ppapi/cpp/rect.h"
11
12 namespace chrome_pdf {
13
14 class Button : public Control {
15 public:
16 enum ButtonEventIds {
17 EVENT_ID_BUTTON_CLICKED,
18 EVENT_ID_BUTTON_STATE_CHANGED,
19 };
20
21 enum ButtonStyle {
22 BUTTON_CLICKABLE,
23 BUTTON_STATE
24 };
25
26 enum ButtonState {
27 BUTTON_NORMAL,
28 BUTTON_HIGHLIGHTED,
29 BUTTON_PRESSED,
30 BUTTON_PRESSED_STICKY,
31 };
32
33 Button();
34 virtual ~Button();
35 virtual bool CreateButton(uint32 id,
36 const pp::Point& origin,
37 bool visible,
38 Control::Owner* delegate,
39 ButtonStyle style,
40 const pp::ImageData& face_normal,
41 const pp::ImageData& face_highlighted,
42 const pp::ImageData& face_pressed);
43
44 virtual void Paint(pp::ImageData* image_data, const pp::Rect& rc);
45 virtual bool HandleEvent(const pp::InputEvent& event);
46 virtual void OnEventCaptureReleased();
47 virtual void Show(bool visible, bool invalidate);
48 virtual void AdjustTransparency(uint8 transparency, bool invalidate);
49
50 ButtonState state() const { return state_; }
51 bool IsPressed() const { return state() == BUTTON_PRESSED_STICKY; }
52 void SetPressedState(bool pressed);
53
54 private:
55 void OnButtonClicked();
56
57 const pp::ImageData& GetCurrentImage();
58 void ChangeState(ButtonState new_state, bool force);
59
60 ButtonStyle style_;
61 ButtonState state_;
62 bool is_pressed_;
63
64 pp::ImageData normal_;
65 pp::ImageData highlighted_;
66 pp::ImageData pressed_;
67 };
68
69 } // namespace chrome_pdf
70
71 #endif // PDF_BUTTON_H_
OLDNEW
« no previous file with comments | « pdf/BUILD.gn ('k') | pdf/button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698