update_view.h revision c407dc5cd9bdc5668497f21b26b09d988ab439de
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_UPDATE_VIEW_H_ 6#define CHROME_BROWSER_CHROMEOS_LOGIN_UPDATE_VIEW_H_ 7 8#include "views/view.h" 9 10namespace views { 11class Label; 12class ProgressBar; 13} // namespace views 14 15namespace chromeos { 16 17class ScreenObserver; 18class UpdateController; 19 20// View for the network selection/initial welcome screen. 21class UpdateView : public views::View { 22 public: 23 explicit UpdateView(ScreenObserver* observer); 24 virtual ~UpdateView(); 25 26 virtual void Init(); 27 virtual void Reset(); 28 virtual void UpdateLocalizedStrings(); 29 30 // Sets update controller. 31 virtual void set_controller(UpdateController* controller) { 32 controller_ = controller; 33 } 34 35 // Advances view's progress bar. Maximum progress is 100. 36 virtual void AddProgress(int progress); 37 38 // views::View implementation: 39 virtual void Layout(); 40 virtual bool AcceleratorPressed(const views::Accelerator& a); 41 42 private: 43 // Creates Label control and adds it as a child. 44 void InitLabel(views::Label** label); 45 46 // Keyboard accelerator to allow cancelling update by hitting escape. 47 views::Accelerator escape_accelerator_; 48 49 // Dialog controls. 50 views::Label* installing_updates_label_; 51 views::Label* escape_to_skip_label_; 52 views::ProgressBar* progress_bar_; 53 54 // Notifications receiver. 55 chromeos::ScreenObserver* observer_; 56 // Update controller. 57 chromeos::UpdateController* controller_; 58 59 DISALLOW_COPY_AND_ASSIGN(UpdateView); 60}; 61 62} // namespace chromeos 63 64#endif // CHROME_BROWSER_CHROMEOS_LOGIN_UPDATE_VIEW_H_ 65