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

Side by Side Diff: ash/shell/lock_view.cc

Issue 621133002: replace OVERRIDE and FINAL with override and final in ash/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « ash/shell/keyboard_controller_proxy_stub.h ('k') | ash/shell/panel_window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "ash/session/session_state_delegate.h" 5 #include "ash/session/session_state_delegate.h"
6 #include "ash/shell.h" 6 #include "ash/shell.h"
7 #include "ash/shell/example_factory.h" 7 #include "ash/shell/example_factory.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 17 matching lines...) Expand all
28 public: 28 public:
29 LockView() : unlock_button_(new views::LabelButton( 29 LockView() : unlock_button_(new views::LabelButton(
30 this, base::ASCIIToUTF16("Unlock"))) { 30 this, base::ASCIIToUTF16("Unlock"))) {
31 unlock_button_->SetStyle(views::Button::STYLE_BUTTON); 31 unlock_button_->SetStyle(views::Button::STYLE_BUTTON);
32 AddChildView(unlock_button_); 32 AddChildView(unlock_button_);
33 unlock_button_->SetFocusable(true); 33 unlock_button_->SetFocusable(true);
34 } 34 }
35 virtual ~LockView() {} 35 virtual ~LockView() {}
36 36
37 // Overridden from views::View: 37 // Overridden from views::View:
38 virtual gfx::Size GetPreferredSize() const OVERRIDE { 38 virtual gfx::Size GetPreferredSize() const override {
39 return gfx::Size(500, 400); 39 return gfx::Size(500, 400);
40 } 40 }
41 41
42 private: 42 private:
43 // Overridden from views::View: 43 // Overridden from views::View:
44 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { 44 virtual void OnPaint(gfx::Canvas* canvas) override {
45 canvas->FillRect(GetLocalBounds(), SK_ColorYELLOW); 45 canvas->FillRect(GetLocalBounds(), SK_ColorYELLOW);
46 base::string16 text = base::ASCIIToUTF16("LOCKED!"); 46 base::string16 text = base::ASCIIToUTF16("LOCKED!");
47 int string_width = gfx::GetStringWidth(text, font_list_); 47 int string_width = gfx::GetStringWidth(text, font_list_);
48 canvas->DrawStringRect(text, font_list_, SK_ColorRED, 48 canvas->DrawStringRect(text, font_list_, SK_ColorRED,
49 gfx::Rect((width() - string_width)/ 2, 49 gfx::Rect((width() - string_width)/ 2,
50 (height() - font_list_.GetHeight()) / 2, 50 (height() - font_list_.GetHeight()) / 2,
51 string_width, font_list_.GetHeight())); 51 string_width, font_list_.GetHeight()));
52 } 52 }
53 virtual void Layout() OVERRIDE { 53 virtual void Layout() override {
54 gfx::Rect bounds = GetLocalBounds(); 54 gfx::Rect bounds = GetLocalBounds();
55 gfx::Size ps = unlock_button_->GetPreferredSize(); 55 gfx::Size ps = unlock_button_->GetPreferredSize();
56 bounds.set_y(bounds.bottom() - ps.height() - 5); 56 bounds.set_y(bounds.bottom() - ps.height() - 5);
57 bounds.set_x((bounds.width() - ps.width()) / 2); 57 bounds.set_x((bounds.width() - ps.width()) / 2);
58 bounds.set_size(ps); 58 bounds.set_size(ps);
59 unlock_button_->SetBoundsRect(bounds); 59 unlock_button_->SetBoundsRect(bounds);
60 } 60 }
61 virtual void ViewHierarchyChanged( 61 virtual void ViewHierarchyChanged(
62 const ViewHierarchyChangedDetails& details) OVERRIDE { 62 const ViewHierarchyChangedDetails& details) override {
63 if (details.is_add && details.child == this) 63 if (details.is_add && details.child == this)
64 unlock_button_->RequestFocus(); 64 unlock_button_->RequestFocus();
65 } 65 }
66 66
67 // Overridden from views::WidgetDelegateView: 67 // Overridden from views::WidgetDelegateView:
68 virtual void WindowClosing() OVERRIDE { 68 virtual void WindowClosing() override {
69 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); 69 Shell::GetInstance()->session_state_delegate()->UnlockScreen();
70 } 70 }
71 71
72 // Overridden from views::ButtonListener: 72 // Overridden from views::ButtonListener:
73 virtual void ButtonPressed(views::Button* sender, 73 virtual void ButtonPressed(views::Button* sender,
74 const ui::Event& event) OVERRIDE { 74 const ui::Event& event) override {
75 DCHECK(sender == unlock_button_); 75 DCHECK(sender == unlock_button_);
76 GetWidget()->Close(); 76 GetWidget()->Close();
77 } 77 }
78 78
79 gfx::FontList font_list_; 79 gfx::FontList font_list_;
80 views::LabelButton* unlock_button_; 80 views::LabelButton* unlock_button_;
81 81
82 DISALLOW_COPY_AND_ASSIGN(LockView); 82 DISALLOW_COPY_AND_ASSIGN(LockView);
83 }; 83 };
84 84
(...skipping 17 matching lines...) Expand all
102 widget->GetNativeView()->SetName("LockView"); 102 widget->GetNativeView()->SetName("LockView");
103 widget->GetNativeView()->Focus(); 103 widget->GetNativeView()->Focus();
104 104
105 // TODO: it shouldn't be necessary to invoke UpdateTooltip() here. 105 // TODO: it shouldn't be necessary to invoke UpdateTooltip() here.
106 Shell::GetInstance()->tooltip_controller()->UpdateTooltip( 106 Shell::GetInstance()->tooltip_controller()->UpdateTooltip(
107 widget->GetNativeView()); 107 widget->GetNativeView());
108 } 108 }
109 109
110 } // namespace shell 110 } // namespace shell
111 } // namespace ash 111 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/keyboard_controller_proxy_stub.h ('k') | ash/shell/panel_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698