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

Side by Side Diff: pdf/thumbnail_control.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/progress_control.cc ('k') | pdf/thumbnail_control.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_THUMBNAIL_CONTROL_H_
6 #define PDF_THUMBNAIL_CONTROL_H_
7
8 #include <map>
9 #include <vector>
10
11 #include "pdf/control.h"
12 #include "pdf/pdf_engine.h"
13 #include "ppapi/cpp/input_event.h"
14
15 namespace chrome_pdf {
16
17 class NumberImageGenerator;
18
19 class ThumbnailControl : public Control {
20 public:
21 enum ThumbnailEventIds {
22 EVENT_ID_THUMBNAIL_SELECTED = 100,
23 };
24
25 explicit ThumbnailControl();
26 virtual ~ThumbnailControl();
27
28 // Sets current position of the thumnail control.
29 void SetPosition(int position, int total, bool invalidate);
30 void SlideIn();
31 void SlideOut();
32
33 virtual bool CreateThumbnailControl(
34 uint32 id, const pp::Rect& rc,
35 bool visible, Owner* owner, PDFEngine* engine,
36 NumberImageGenerator* number_image_generator);
37
38 // Control interface.
39 virtual void Show(bool visible, bool invalidate);
40 virtual void Paint(pp::ImageData* image_data, const pp::Rect& rc);
41 virtual bool HandleEvent(const pp::InputEvent& event);
42 virtual void OnTimerFired(uint32 timer_id);
43
44 virtual void ResetEngine(PDFEngine* engine);
45
46 private:
47 void ClearCache();
48
49 struct PageInfo {
50 int index;
51 pp::Rect rect;
52 };
53
54 PDFEngine* engine_;
55 pp::Rect visible_rect_;
56 std::vector<PageInfo> visible_pages_;
57 std::map<int, pp::ImageData*> image_cache_;
58 int sliding_width_;
59 int sliding_shift_;
60 int sliding_timeout_;
61 uint32 sliding_timer_id_;
62 NumberImageGenerator* number_image_generator_;
63 };
64
65 } // namespace chrome_pdf
66
67 #endif // PDF_THUMBNAIL_CONTROL_H_
OLDNEW
« no previous file with comments | « pdf/progress_control.cc ('k') | pdf/thumbnail_control.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698