| OLD | NEW |
| (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 CHROME_BROWSER_CHROMEOS_LOGIN_OOBE_PROGRESS_BAR_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_OOBE_PROGRESS_BAR_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 #include "ui/gfx/font.h" | |
| 13 #include "views/view.h" | |
| 14 | |
| 15 class SkBitmap; | |
| 16 | |
| 17 namespace chromeos { | |
| 18 | |
| 19 // Special purpose progress bar with labeled steps that is used to show user's | |
| 20 // progress in OOBE process. | |
| 21 class OobeProgressBar : public views::View { | |
| 22 public: | |
| 23 // Construct progress bar with given labels as steps. | |
| 24 // |steps| is a vector of string IDs from resources. | |
| 25 explicit OobeProgressBar(const std::vector<int>& steps); | |
| 26 virtual ~OobeProgressBar(); | |
| 27 | |
| 28 // Overridden from View: | |
| 29 virtual void OnPaint(gfx::Canvas* canvas); | |
| 30 | |
| 31 // Set the current step for the progress bar. Must be one of the steps | |
| 32 // passed in the constructor. | |
| 33 void SetStep(int step); | |
| 34 | |
| 35 protected: | |
| 36 // Overridden from View: | |
| 37 virtual void OnLocaleChanged(); | |
| 38 | |
| 39 private: | |
| 40 static void InitClass(); | |
| 41 | |
| 42 // Graphics. | |
| 43 static SkBitmap* dot_current_; | |
| 44 static SkBitmap* dot_empty_; | |
| 45 static SkBitmap* dot_filled_; | |
| 46 static SkBitmap* line_; | |
| 47 static SkBitmap* line_left_; | |
| 48 static SkBitmap* line_right_; | |
| 49 | |
| 50 gfx::Font font_; | |
| 51 | |
| 52 // Unique ids for progress bar steps. The order defines how the steps are | |
| 53 // enumerated on screen. | |
| 54 std::vector<int> steps_; | |
| 55 | |
| 56 // Index of the current step. | |
| 57 size_t progress_; | |
| 58 | |
| 59 DISALLOW_COPY_AND_ASSIGN(OobeProgressBar); | |
| 60 }; | |
| 61 | |
| 62 } // namespace chromeos | |
| 63 | |
| 64 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OOBE_PROGRESS_BAR_H_ | |
| OLD | NEW |