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/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "ui/gfx/font.h" | 13 #include "ui/gfx/font.h" |
14 #include "ui/views/controls/label.h" | 14 #include "ui/views/controls/label.h" |
15 | 15 |
16 namespace ash { | 16 namespace ash { |
17 namespace internal { | 17 namespace internal { |
18 | 18 |
19 TrayIME::TrayIME() { | 19 TrayIME::TrayIME() { |
20 } | 20 } |
21 | 21 |
22 TrayIME::~TrayIME() { | 22 TrayIME::~TrayIME() { |
23 } | 23 } |
24 | 24 |
25 void TrayIME::UpdateTrayLabel() { | 25 void TrayIME::UpdateTrayLabel() { |
26 IMEInfoList list = ash::Shell::GetInstance()->tray_delegate()-> | 26 IMEInfoList list; |
27 GetAvailableIMEList(); | 27 ash::Shell::GetInstance()->tray_delegate()->GetAvailableIMEList(&list); |
28 for (size_t i = 0; i < list.size(); i++) { | 28 for (size_t i = 0; i < list.size(); i++) { |
29 if (list[i].selected) { | 29 if (list[i].selected) { |
30 tray_label_->SetText(list[i].short_name); | 30 tray_label_->SetText(list[i].short_name); |
31 break; | 31 break; |
32 } | 32 } |
33 } | 33 } |
34 tray_label_->SetVisible(list.size() > 1); | 34 tray_label_->SetVisible(list.size() > 1); |
35 } | 35 } |
36 | 36 |
37 views::View* TrayIME::CreateTrayView(user::LoginStatus status) { | 37 views::View* TrayIME::CreateTrayView(user::LoginStatus status) { |
(...skipping 22 matching lines...) Expand all Loading... |
60 | 60 |
61 void TrayIME::DestroyDetailedView() { | 61 void TrayIME::DestroyDetailedView() { |
62 } | 62 } |
63 | 63 |
64 void TrayIME::OnIMERefresh() { | 64 void TrayIME::OnIMERefresh() { |
65 UpdateTrayLabel(); | 65 UpdateTrayLabel(); |
66 } | 66 } |
67 | 67 |
68 } // namespace internal | 68 } // namespace internal |
69 } // namespace ash | 69 } // namespace ash |
OLD | NEW |