| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_STATUS_AREA_HOST_AURA_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_ASH_STATUS_AREA_HOST_AURA_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "chrome/browser/chromeos/status/status_area_button.h" | |
| 11 #include "chrome/browser/ui/browser_list.h" | |
| 12 #include "content/public/browser/notification_observer.h" | |
| 13 #include "content/public/browser/notification_registrar.h" | |
| 14 | |
| 15 #if defined(OS_CHROMEOS) | |
| 16 #include "base/memory/scoped_ptr.h" | |
| 17 #include "chrome/browser/chromeos/login/login_html_dialog.h" | |
| 18 #endif | |
| 19 | |
| 20 class ClockUpdater; | |
| 21 class StatusAreaView; | |
| 22 | |
| 23 namespace views { | |
| 24 class Views; | |
| 25 class Widget; | |
| 26 } | |
| 27 | |
| 28 class StatusAreaHostAura : public StatusAreaButton::Delegate, | |
| 29 public BrowserList::Observer, | |
| 30 public content::NotificationObserver { | |
| 31 public: | |
| 32 StatusAreaHostAura(); | |
| 33 virtual ~StatusAreaHostAura(); | |
| 34 | |
| 35 // Returns the status area view. | |
| 36 StatusAreaView* GetStatusArea(); | |
| 37 | |
| 38 // Instantiates and sets |status_area_view_|, and sets it as the contents of | |
| 39 // a new views::Widget |status_area_widget_| which is returned. | |
| 40 // The caller is expected to take ownership of |status_area_widget_|. | |
| 41 views::Widget* CreateStatusArea(); | |
| 42 | |
| 43 // Adds the buttons to the status area. This is called separately, after | |
| 44 // the profile has been initialized. | |
| 45 void AddButtons(); | |
| 46 | |
| 47 // StatusAreaButton::Delegate implementation. | |
| 48 virtual bool ShouldExecuteStatusAreaCommand( | |
| 49 const views::View* button_view, int command_id) const OVERRIDE; | |
| 50 virtual void ExecuteStatusAreaCommand( | |
| 51 const views::View* button_view, int command_id) OVERRIDE; | |
| 52 virtual StatusAreaButton::TextStyle GetStatusAreaTextStyle() const OVERRIDE; | |
| 53 virtual void ButtonVisibilityChanged(views::View* button_view) OVERRIDE; | |
| 54 | |
| 55 // BrowserList::Observer implementation. | |
| 56 virtual void OnBrowserAdded(const Browser* browser) OVERRIDE {} | |
| 57 virtual void OnBrowserRemoved(const Browser* browser) OVERRIDE {} | |
| 58 virtual void OnBrowserSetLastActive(const Browser* browser) OVERRIDE; | |
| 59 | |
| 60 // content::NotificationObserver implementation. | |
| 61 virtual void Observe(int type, | |
| 62 const content::NotificationSource& source, | |
| 63 const content::NotificationDetails& details) OVERRIDE; | |
| 64 | |
| 65 private: | |
| 66 // Is either the login or lock screen currently displayed? | |
| 67 bool IsLoginOrLockScreenDisplayed() const; | |
| 68 | |
| 69 // Triggers an update of the status area text style and position. | |
| 70 void UpdateAppearance(); | |
| 71 | |
| 72 // Owned by caller of CreateStatusArea(). | |
| 73 views::Widget* status_area_widget_; | |
| 74 // Owned by status_area_widget_. | |
| 75 StatusAreaView* status_area_view_; | |
| 76 | |
| 77 #if defined(OS_CHROMEOS) | |
| 78 scoped_ptr<ClockUpdater> clock_updater_; | |
| 79 #endif | |
| 80 | |
| 81 content::NotificationRegistrar registrar_; | |
| 82 | |
| 83 DISALLOW_COPY_AND_ASSIGN(StatusAreaHostAura); | |
| 84 }; | |
| 85 | |
| 86 #endif // CHROME_BROWSER_UI_VIEWS_ASH_STATUS_AREA_HOST_AURA_H_ | |
| OLD | NEW |