summaryrefslogtreecommitdiffstats
path: root/pdf/page_indicator.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-20 01:56:40 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-20 01:56:40 +0000
commit1b1e9effe9fa3b66dd1bcfff4b78455460f66c61 (patch)
treeca185a1ce62737b897b38ed77d8b8945dddec8df /pdf/page_indicator.h
parentf0d119a1eb1211961315c7ce31984134798dbb47 (diff)
downloadchromium_src-1b1e9effe9fa3b66dd1bcfff4b78455460f66c61.zip
chromium_src-1b1e9effe9fa3b66dd1bcfff4b78455460f66c61.tar.gz
chromium_src-1b1e9effe9fa3b66dd1bcfff4b78455460f66c61.tar.bz2
Add the pdf plugin's source in src\pdf.
I've updated gypi files to not use internal_pdf variable anymore, which was brought in from pdf repo's supplemental.gypi. R=thestig@chromium.org TBR=darin Review URL: https://codereview.chromium.org/294793003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271531 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'pdf/page_indicator.h')
-rw-r--r--pdf/page_indicator.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/pdf/page_indicator.h b/pdf/page_indicator.h
new file mode 100644
index 0000000..0d06ee1
--- /dev/null
+++ b/pdf/page_indicator.h
@@ -0,0 +1,72 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PDF_PAGE_INDICATOR_H_
+#define PDF_PAGE_INDICATOR_H_
+
+#include <string>
+#include <vector>
+
+#include "pdf/control.h"
+#include "pdf/fading_control.h"
+#include "ppapi/cpp/image_data.h"
+#include "ppapi/cpp/point.h"
+#include "ppapi/cpp/rect.h"
+
+namespace chrome_pdf {
+
+class NumberImageGenerator;
+
+const uint32 kPageIndicatorScrollFadeTimeoutMs = 240;
+const uint32 kPageIndicatorInitialFadeTimeoutMs = 960;
+const uint32 kPageIndicatorSplashTimeoutMs = 2000;
+
+class PageIndicator : public FadingControl {
+ public:
+ PageIndicator();
+ virtual ~PageIndicator();
+ virtual bool CreatePageIndicator(
+ uint32 id,
+ bool visible,
+ Control::Owner* delegate,
+ NumberImageGenerator* number_image_generator,
+ bool always_visible);
+
+ void Configure(const pp::Point& origin, const pp::ImageData& background);
+
+ int current_page() const { return current_page_; }
+ void set_current_page(int current_page);
+
+ virtual void Splash();
+ void Splash(uint32 splash_timeout, uint32 page_timeout);
+
+ // Returns the y position where the page indicator should be drawn given the
+ // position of the scrollbar and the total document height and the plugin
+ // height.
+ int GetYPosition(
+ int vertical_scrollbar_y, int document_height, int plugin_height);
+
+ // Control interface.
+ virtual void Paint(pp::ImageData* image_data, const pp::Rect& rc);
+ virtual void OnTimerFired(uint32 timer_id);
+
+ // FadingControl interface.
+ virtual void OnFadeInComplete();
+
+ private:
+ void ResetFadeOutTimer();
+
+ int current_page_;
+ pp::ImageData background_;
+ NumberImageGenerator* number_image_generator_;
+ uint32 fade_out_timer_id_;
+ uint32 splash_timeout_;
+ uint32 fade_timeout_;
+
+ bool always_visible_;
+};
+
+} // namespace chrome_pdf
+
+#endif // PDF_PAGE_INDICATOR_H_