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

Side by Side Diff: ash/system/ime/tray_ime.cc

Issue 683473005: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
« no previous file with comments | « ash/system/ime/tray_ime.h ('k') | ash/system/locale/locale_notification_controller.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/system/ime/tray_ime.h" 5 #include "ash/system/ime/tray_ime.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/metrics/user_metrics_recorder.h" 9 #include "ash/metrics/user_metrics_recorder.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 class SelectableHoverHighlightView : public HoverHighlightView { 42 class SelectableHoverHighlightView : public HoverHighlightView {
43 public: 43 public:
44 SelectableHoverHighlightView(ViewClickListener* listener, 44 SelectableHoverHighlightView(ViewClickListener* listener,
45 const base::string16& label, 45 const base::string16& label,
46 bool selected) 46 bool selected)
47 : HoverHighlightView(listener), selected_(selected) { 47 : HoverHighlightView(listener), selected_(selected) {
48 AddLabel( 48 AddLabel(
49 label, gfx::ALIGN_LEFT, selected ? gfx::Font::BOLD : gfx::Font::NORMAL); 49 label, gfx::ALIGN_LEFT, selected ? gfx::Font::BOLD : gfx::Font::NORMAL);
50 } 50 }
51 51
52 virtual ~SelectableHoverHighlightView() {} 52 ~SelectableHoverHighlightView() override {}
53 53
54 protected: 54 protected:
55 // Overridden from views::View. 55 // Overridden from views::View.
56 virtual void GetAccessibleState(ui::AXViewState* state) override { 56 void GetAccessibleState(ui::AXViewState* state) override {
57 HoverHighlightView::GetAccessibleState(state); 57 HoverHighlightView::GetAccessibleState(state);
58 state->role = ui::AX_ROLE_CHECK_BOX; 58 state->role = ui::AX_ROLE_CHECK_BOX;
59 if (selected_) 59 if (selected_)
60 state->AddStateFlag(ui::AX_STATE_CHECKED); 60 state->AddStateFlag(ui::AX_STATE_CHECKED);
61 } 61 }
62 62
63 private: 63 private:
64 bool selected_; 64 bool selected_;
65 65
66 DISALLOW_COPY_AND_ASSIGN(SelectableHoverHighlightView); 66 DISALLOW_COPY_AND_ASSIGN(SelectableHoverHighlightView);
67 }; 67 };
68 68
69 class IMEDefaultView : public TrayItemMore { 69 class IMEDefaultView : public TrayItemMore {
70 public: 70 public:
71 explicit IMEDefaultView(SystemTrayItem* owner) 71 explicit IMEDefaultView(SystemTrayItem* owner)
72 : TrayItemMore(owner, true) { 72 : TrayItemMore(owner, true) {
73 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 73 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
74 74
75 SetImage(bundle.GetImageNamed( 75 SetImage(bundle.GetImageNamed(
76 IDR_AURA_UBER_TRAY_IME).ToImageSkia()); 76 IDR_AURA_UBER_TRAY_IME).ToImageSkia());
77 77
78 IMEInfo info; 78 IMEInfo info;
79 Shell::GetInstance()->system_tray_delegate()->GetCurrentIME(&info); 79 Shell::GetInstance()->system_tray_delegate()->GetCurrentIME(&info);
80 UpdateLabel(info); 80 UpdateLabel(info);
81 } 81 }
82 82
83 virtual ~IMEDefaultView() {} 83 ~IMEDefaultView() override {}
84 84
85 void UpdateLabel(const IMEInfo& info) { 85 void UpdateLabel(const IMEInfo& info) {
86 SetLabel(info.name); 86 SetLabel(info.name);
87 SetAccessibleName(info.name); 87 SetAccessibleName(info.name);
88 } 88 }
89 89
90 private: 90 private:
91 DISALLOW_COPY_AND_ASSIGN(IMEDefaultView); 91 DISALLOW_COPY_AND_ASSIGN(IMEDefaultView);
92 }; 92 };
93 93
94 class IMEDetailedView : public TrayDetailsView, 94 class IMEDetailedView : public TrayDetailsView,
95 public ViewClickListener { 95 public ViewClickListener {
96 public: 96 public:
97 IMEDetailedView(SystemTrayItem* owner, user::LoginStatus login) 97 IMEDetailedView(SystemTrayItem* owner, user::LoginStatus login)
98 : TrayDetailsView(owner), 98 : TrayDetailsView(owner),
99 login_(login) { 99 login_(login) {
100 SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate(); 100 SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
101 IMEInfoList list; 101 IMEInfoList list;
102 delegate->GetAvailableIMEList(&list); 102 delegate->GetAvailableIMEList(&list);
103 IMEPropertyInfoList property_list; 103 IMEPropertyInfoList property_list;
104 delegate->GetCurrentIMEProperties(&property_list); 104 delegate->GetCurrentIMEProperties(&property_list);
105 Update(list, property_list); 105 Update(list, property_list);
106 } 106 }
107 107
108 virtual ~IMEDetailedView() {} 108 ~IMEDetailedView() override {}
109 109
110 void Update(const IMEInfoList& list, 110 void Update(const IMEInfoList& list,
111 const IMEPropertyInfoList& property_list) { 111 const IMEPropertyInfoList& property_list) {
112 Reset(); 112 Reset();
113 113
114 AppendIMEList(list); 114 AppendIMEList(list);
115 if (!property_list.empty()) 115 if (!property_list.empty())
116 AppendIMEProperties(property_list); 116 AppendIMEProperties(property_list);
117 bool userAddingRunning = ash::Shell::GetInstance() 117 bool userAddingRunning = ash::Shell::GetInstance()
118 ->session_state_delegate() 118 ->session_state_delegate()
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 container->AddLabel( 161 container->AddLabel(
162 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( 162 ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
163 IDS_ASH_STATUS_TRAY_IME_SETTINGS), 163 IDS_ASH_STATUS_TRAY_IME_SETTINGS),
164 gfx::ALIGN_LEFT, 164 gfx::ALIGN_LEFT,
165 gfx::Font::NORMAL); 165 gfx::Font::NORMAL);
166 AddChildView(container); 166 AddChildView(container);
167 settings_ = container; 167 settings_ = container;
168 } 168 }
169 169
170 // Overridden from ViewClickListener. 170 // Overridden from ViewClickListener.
171 virtual void OnViewClicked(views::View* sender) override { 171 void OnViewClicked(views::View* sender) override {
172 SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate(); 172 SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
173 if (sender == footer()->content()) { 173 if (sender == footer()->content()) {
174 TransitionToDefaultView(); 174 TransitionToDefaultView();
175 } else if (sender == settings_) { 175 } else if (sender == settings_) {
176 Shell::GetInstance()->metrics()->RecordUserMetricsAction( 176 Shell::GetInstance()->metrics()->RecordUserMetricsAction(
177 ash::UMA_STATUS_AREA_IME_SHOW_DETAILED); 177 ash::UMA_STATUS_AREA_IME_SHOW_DETAILED);
178 delegate->ShowIMESettings(); 178 delegate->ShowIMESettings();
179 } else { 179 } else {
180 std::map<views::View*, std::string>::const_iterator ime_find; 180 std::map<views::View*, std::string>::const_iterator ime_find;
181 ime_find = ime_map_.find(sender); 181 ime_find = ime_map_.find(sender);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 299
300 UpdateTrayLabel(current, list.size()); 300 UpdateTrayLabel(current, list.size());
301 301
302 if (default_) 302 if (default_)
303 default_->UpdateLabel(current); 303 default_->UpdateLabel(current);
304 if (detailed_) 304 if (detailed_)
305 detailed_->Update(list, property_list); 305 detailed_->Update(list, property_list);
306 } 306 }
307 307
308 } // namespace ash 308 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/ime/tray_ime.h ('k') | ash/system/locale/locale_notification_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698