| OLD | NEW |
| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 virtual ~SelectableHoverHighlightView() {} |
| 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 virtual 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); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 virtual 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 Loading... |
| 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 |
| OLD | NEW |