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 27 // Overridden from View: 28 virtual void OnPaint(gfx::Canvas* canvas); 29 30 // Set the current step for the progress bar. Must be one of the steps 31 // passed in the constructor. 32 void SetStep(int step); 33 34 protected: 35 // Overridden from View: 36 virtual void OnLocaleChanged(); 37 38 private: 39 static void InitClass(); 40 41 // Graphics. 42 static SkBitmap* dot_current_; 43 static SkBitmap* dot_empty_; 44 static SkBitmap* dot_filled_; 45 static SkBitmap* line_; 46 static SkBitmap* line_left_; 47 static SkBitmap* line_right_; 48 49 gfx::Font font_; 50 51 // Unique ids for progress bar steps. The order defines how the steps are 52 // enumerated on screen. 53 std::vector<int> steps_; 54 55 // Index of the current step. 56 size_t progress_; 57 58 DISALLOW_COPY_AND_ASSIGN(OobeProgressBar); 59 }; 60 61 } // namespace chromeos 62 63 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OOBE_PROGRESS_BAR_H_ 64