| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 private: | 93 private: |
| 94 void AppendHeaderEntry() { | 94 void AppendHeaderEntry() { |
| 95 CreateSpecialRow(IDS_ASH_STATUS_TRAY_IME, this); | 95 CreateSpecialRow(IDS_ASH_STATUS_TRAY_IME, this); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void AppendIMEList(const IMEInfoList& list) { | 98 void AppendIMEList(const IMEInfoList& list) { |
| 99 ime_map_.clear(); | 99 ime_map_.clear(); |
| 100 CreateScrollableList(); | 100 CreateScrollableList(); |
| 101 for (size_t i = 0; i < list.size(); i++) { | 101 for (size_t i = 0; i < list.size(); i++) { |
| 102 HoverHighlightView* container = new HoverHighlightView(this); | 102 HoverHighlightView* container = new HoverHighlightView(this); |
| 103 container->AddLabel(list[i].name, | 103 container->AddLabel( |
| 104 list[i].name, |
| 105 gfx::ALIGN_LEFT, |
| 104 list[i].selected ? gfx::Font::BOLD : gfx::Font::NORMAL); | 106 list[i].selected ? gfx::Font::BOLD : gfx::Font::NORMAL); |
| 105 scroll_content()->AddChildView(container); | 107 scroll_content()->AddChildView(container); |
| 106 ime_map_[container] = list[i].id; | 108 ime_map_[container] = list[i].id; |
| 107 } | 109 } |
| 108 } | 110 } |
| 109 | 111 |
| 110 void AppendIMEProperties(const IMEPropertyInfoList& property_list) { | 112 void AppendIMEProperties(const IMEPropertyInfoList& property_list) { |
| 111 property_map_.clear(); | 113 property_map_.clear(); |
| 112 for (size_t i = 0; i < property_list.size(); i++) { | 114 for (size_t i = 0; i < property_list.size(); i++) { |
| 113 HoverHighlightView* container = new HoverHighlightView(this); | 115 HoverHighlightView* container = new HoverHighlightView(this); |
| 114 container->AddLabel( | 116 container->AddLabel( |
| 115 property_list[i].name, | 117 property_list[i].name, |
| 118 gfx::ALIGN_LEFT, |
| 116 property_list[i].selected ? gfx::Font::BOLD : gfx::Font::NORMAL); | 119 property_list[i].selected ? gfx::Font::BOLD : gfx::Font::NORMAL); |
| 117 if (i == 0) | 120 if (i == 0) |
| 118 container->SetBorder(views::Border::CreateSolidSidedBorder( | 121 container->SetBorder(views::Border::CreateSolidSidedBorder( |
| 119 1, 0, 0, 0, kBorderLightColor)); | 122 1, 0, 0, 0, kBorderLightColor)); |
| 120 scroll_content()->AddChildView(container); | 123 scroll_content()->AddChildView(container); |
| 121 property_map_[container] = property_list[i].key; | 124 property_map_[container] = property_list[i].key; |
| 122 } | 125 } |
| 123 } | 126 } |
| 124 | 127 |
| 125 void AppendSettings() { | 128 void AppendSettings() { |
| 126 HoverHighlightView* container = new HoverHighlightView(this); | 129 HoverHighlightView* container = new HoverHighlightView(this); |
| 127 container->AddLabel(ui::ResourceBundle::GetSharedInstance(). | 130 container->AddLabel( |
| 128 GetLocalizedString(IDS_ASH_STATUS_TRAY_IME_SETTINGS), | 131 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( |
| 132 IDS_ASH_STATUS_TRAY_IME_SETTINGS), |
| 133 gfx::ALIGN_LEFT, |
| 129 gfx::Font::NORMAL); | 134 gfx::Font::NORMAL); |
| 130 AddChildView(container); | 135 AddChildView(container); |
| 131 settings_ = container; | 136 settings_ = container; |
| 132 } | 137 } |
| 133 | 138 |
| 134 // Overridden from ViewClickListener. | 139 // Overridden from ViewClickListener. |
| 135 virtual void OnViewClicked(views::View* sender) OVERRIDE { | 140 virtual void OnViewClicked(views::View* sender) OVERRIDE { |
| 136 SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate(); | 141 SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate(); |
| 137 if (sender == footer()->content()) { | 142 if (sender == footer()->content()) { |
| 138 TransitionToDefaultView(); | 143 TransitionToDefaultView(); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 268 |
| 264 UpdateTrayLabel(current, list.size()); | 269 UpdateTrayLabel(current, list.size()); |
| 265 | 270 |
| 266 if (default_) | 271 if (default_) |
| 267 default_->UpdateLabel(current); | 272 default_->UpdateLabel(current); |
| 268 if (detailed_) | 273 if (detailed_) |
| 269 detailed_->Update(list, property_list); | 274 detailed_->Update(list, property_list); |
| 270 } | 275 } |
| 271 | 276 |
| 272 } // namespace ash | 277 } // namespace ash |
| OLD | NEW |