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

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

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

Powered by Google App Engine
This is Rietveld 408576698