Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: chrome/browser/ui/views/critical_notification_bubble_view.h

Issue 680133002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CHROME_BROWSER_UI_VIEWS_CRITICAL_NOTIFICATION_BUBBLE_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_CRITICAL_NOTIFICATION_BUBBLE_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_CRITICAL_NOTIFICATION_BUBBLE_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_CRITICAL_NOTIFICATION_BUBBLE_VIEW_H_
7 7
8 #include "base/timer/timer.h" 8 #include "base/timer/timer.h"
9 #include "ui/views/bubble/bubble_delegate.h" 9 #include "ui/views/bubble/bubble_delegate.h"
10 #include "ui/views/controls/button/button.h" 10 #include "ui/views/controls/button/button.h"
11 11
12 namespace ui { 12 namespace ui {
13 class Accelerator; 13 class Accelerator;
14 } 14 }
15 15
16 namespace views { 16 namespace views {
17 class Label; 17 class Label;
18 class LabelButton; 18 class LabelButton;
19 } 19 }
20 20
21 class CriticalNotificationBubbleView : public views::BubbleDelegateView, 21 class CriticalNotificationBubbleView : public views::BubbleDelegateView,
22 public views::ButtonListener { 22 public views::ButtonListener {
23 public: 23 public:
24 explicit CriticalNotificationBubbleView(views::View* anchor_view); 24 explicit CriticalNotificationBubbleView(views::View* anchor_view);
25 virtual ~CriticalNotificationBubbleView(); 25 ~CriticalNotificationBubbleView() override;
26 26
27 // views::ButtonListener overrides: 27 // views::ButtonListener overrides:
28 virtual void ButtonPressed(views::Button* sender, 28 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
29 const ui::Event& event) override;
30 29
31 // views::WidgetDelegate overrides: 30 // views::WidgetDelegate overrides:
32 virtual void WindowClosing() override; 31 void WindowClosing() override;
33 32
34 // views::View overrides: 33 // views::View overrides:
35 virtual void GetAccessibleState(ui::AXViewState* state) override; 34 void GetAccessibleState(ui::AXViewState* state) override;
36 virtual void ViewHierarchyChanged( 35 void ViewHierarchyChanged(
37 const ViewHierarchyChangedDetails& details) override; 36 const ViewHierarchyChangedDetails& details) override;
38 37
39 protected: 38 protected:
40 // views::BubbleDelegateView overrides: 39 // views::BubbleDelegateView overrides:
41 virtual bool AcceleratorPressed( 40 bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
42 const ui::Accelerator& accelerator) override; 41 void Init() override;
43 virtual void Init() override;
44 42
45 private: 43 private:
46 // Helper function to calculate the remaining time (in seconds) until 44 // Helper function to calculate the remaining time (in seconds) until
47 // spontaneous reboot. 45 // spontaneous reboot.
48 int GetRemainingTime(); 46 int GetRemainingTime();
49 47
50 // Helper function to set the headline for the bubble. 48 // Helper function to set the headline for the bubble.
51 void UpdateBubbleHeadline(int seconds); 49 void UpdateBubbleHeadline(int seconds);
52 50
53 // Called when the timer fires each time the clock ticks. 51 // Called when the timer fires each time the clock ticks.
54 void OnCountdown(); 52 void OnCountdown();
55 53
56 // The headline and buttons on the bubble. 54 // The headline and buttons on the bubble.
57 views::Label* headline_; 55 views::Label* headline_;
58 views::LabelButton* restart_button_; 56 views::LabelButton* restart_button_;
59 views::LabelButton* dismiss_button_; 57 views::LabelButton* dismiss_button_;
60 58
61 // A timer to refresh the bubble to show new countdown value. 59 // A timer to refresh the bubble to show new countdown value.
62 base::RepeatingTimer<CriticalNotificationBubbleView> refresh_timer_; 60 base::RepeatingTimer<CriticalNotificationBubbleView> refresh_timer_;
63 61
64 // When the bubble was created. 62 // When the bubble was created.
65 base::Time bubble_created_; 63 base::Time bubble_created_;
66 64
67 DISALLOW_COPY_AND_ASSIGN(CriticalNotificationBubbleView); 65 DISALLOW_COPY_AND_ASSIGN(CriticalNotificationBubbleView);
68 }; 66 };
69 67
70 #endif // CHROME_BROWSER_UI_VIEWS_CRITICAL_NOTIFICATION_BUBBLE_VIEW_H_ 68 #endif // CHROME_BROWSER_UI_VIEWS_CRITICAL_NOTIFICATION_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698