OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "pdf/page_indicator.h" | 5 #include "pdf/page_indicator.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "pdf/draw_utils.h" | 9 #include "pdf/draw_utils.h" |
10 #include "pdf/number_image_generator.h" | 10 #include "pdf/number_image_generator.h" |
11 #include "pdf/resource_consts.h" | 11 #include "pdf/resource_consts.h" |
12 | 12 |
13 namespace chrome_pdf { | 13 namespace chrome_pdf { |
14 | 14 |
15 | 15 |
16 PageIndicator::PageIndicator() | 16 PageIndicator::PageIndicator() |
17 : current_page_(0), | 17 : current_page_(0), |
| 18 fade_out_timer_id_(0), |
18 splash_timeout_(kPageIndicatorSplashTimeoutMs), | 19 splash_timeout_(kPageIndicatorSplashTimeoutMs), |
19 fade_timeout_(kPageIndicatorScrollFadeTimeoutMs), | 20 fade_timeout_(kPageIndicatorScrollFadeTimeoutMs), |
20 always_visible_(false) { | 21 always_visible_(false) { |
21 } | 22 } |
22 | 23 |
23 PageIndicator::~PageIndicator() { | 24 PageIndicator::~PageIndicator() { |
24 } | 25 } |
25 | 26 |
26 bool PageIndicator::CreatePageIndicator( | 27 bool PageIndicator::CreatePageIndicator( |
27 uint32 id, | 28 uint32 id, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 Fade(true, fade_timeout_); | 118 Fade(true, fade_timeout_); |
118 } | 119 } |
119 | 120 |
120 int PageIndicator::GetYPosition( | 121 int PageIndicator::GetYPosition( |
121 int vertical_scrollbar_y, int document_height, int plugin_height) { | 122 int vertical_scrollbar_y, int document_height, int plugin_height) { |
122 double percent = static_cast<double>(vertical_scrollbar_y) / document_height; | 123 double percent = static_cast<double>(vertical_scrollbar_y) / document_height; |
123 return (plugin_height - rect().height()) * percent; | 124 return (plugin_height - rect().height()) * percent; |
124 } | 125 } |
125 | 126 |
126 } // namespace chrome_pdf | 127 } // namespace chrome_pdf |
OLD | NEW |