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

Side by Side Diff: ash/common/system/ime/tray_ime_chromeos.cc

Issue 2761063002: Move more from WmShell to Shell (Closed)
Patch Set: merge Created 3 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
« no previous file with comments | « ash/common/system/date/date_view.cc ('k') | ash/common/system/overview/overview_button_tray.cc » ('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/common/system/ime/tray_ime_chromeos.h" 5 #include "ash/common/system/ime/tray_ime_chromeos.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/common/material_design/material_design_controller.h" 9 #include "ash/common/material_design/material_design_controller.h"
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 container->AddLabel( 182 container->AddLabel(
183 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( 183 ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
184 IDS_ASH_STATUS_TRAY_IME_SETTINGS), 184 IDS_ASH_STATUS_TRAY_IME_SETTINGS),
185 gfx::ALIGN_LEFT, false /* highlight */); 185 gfx::ALIGN_LEFT, false /* highlight */);
186 AddChildView(container); 186 AddChildView(container);
187 settings_ = container; 187 settings_ = container;
188 } 188 }
189 189
190 void ShowSettings() { 190 void ShowSettings() {
191 WmShell::Get()->RecordUserMetricsAction(UMA_STATUS_AREA_IME_SHOW_DETAILED); 191 WmShell::Get()->RecordUserMetricsAction(UMA_STATUS_AREA_IME_SHOW_DETAILED);
192 WmShell::Get()->system_tray_controller()->ShowIMESettings(); 192 Shell::Get()->system_tray_controller()->ShowIMESettings();
193 if (owner()->system_tray()) 193 if (owner()->system_tray())
194 owner()->system_tray()->CloseSystemBubble(); 194 owner()->system_tray()->CloseSystemBubble();
195 } 195 }
196 196
197 LoginStatus login_; 197 LoginStatus login_;
198 198
199 // Not used in material design. 199 // Not used in material design.
200 views::View* settings_; 200 views::View* settings_;
201 201
202 // Only used in material design. 202 // Only used in material design.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 bool TrayIME::ShouldShowKeyboardToggle() { 276 bool TrayIME::ShouldShowKeyboardToggle() {
277 return keyboard_suppressed_ && !Shell::GetInstance() 277 return keyboard_suppressed_ && !Shell::GetInstance()
278 ->accessibility_delegate() 278 ->accessibility_delegate()
279 ->IsVirtualKeyboardEnabled(); 279 ->IsVirtualKeyboardEnabled();
280 } 280 }
281 281
282 base::string16 TrayIME::GetDefaultViewLabel(bool show_ime_label) { 282 base::string16 TrayIME::GetDefaultViewLabel(bool show_ime_label) {
283 if (show_ime_label) { 283 if (show_ime_label) {
284 IMEInfo current; 284 IMEInfo current;
285 WmShell::Get()->system_tray_delegate()->GetCurrentIME(&current); 285 Shell::Get()->system_tray_delegate()->GetCurrentIME(&current);
286 return current.name; 286 return current.name;
287 } else { 287 } else {
288 // Display virtual keyboard status instead. 288 // Display virtual keyboard status instead.
289 int id = keyboard::IsKeyboardEnabled() 289 int id = keyboard::IsKeyboardEnabled()
290 ? IDS_ASH_STATUS_TRAY_KEYBOARD_ENABLED 290 ? IDS_ASH_STATUS_TRAY_KEYBOARD_ENABLED
291 : IDS_ASH_STATUS_TRAY_KEYBOARD_DISABLED; 291 : IDS_ASH_STATUS_TRAY_KEYBOARD_DISABLED;
292 return ui::ResourceBundle::GetSharedInstance().GetLocalizedString(id); 292 return ui::ResourceBundle::GetSharedInstance().GetLocalizedString(id);
293 } 293 }
294 } 294 }
295 295
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 void TrayIME::DestroyDefaultView() { 327 void TrayIME::DestroyDefaultView() {
328 default_ = NULL; 328 default_ = NULL;
329 } 329 }
330 330
331 void TrayIME::DestroyDetailedView() { 331 void TrayIME::DestroyDetailedView() {
332 detailed_ = NULL; 332 detailed_ = NULL;
333 } 333 }
334 334
335 void TrayIME::OnIMERefresh() { 335 void TrayIME::OnIMERefresh() {
336 // Caches the current ime state. 336 // Caches the current ime state.
337 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); 337 SystemTrayDelegate* delegate = Shell::Get()->system_tray_delegate();
338 ime_list_.clear(); 338 ime_list_.clear();
339 property_list_.clear(); 339 property_list_.clear();
340 delegate->GetCurrentIME(&current_ime_); 340 delegate->GetCurrentIME(&current_ime_);
341 delegate->GetAvailableIMEList(&ime_list_); 341 delegate->GetAvailableIMEList(&ime_list_);
342 delegate->GetCurrentIMEProperties(&property_list_); 342 delegate->GetCurrentIMEProperties(&property_list_);
343 ime_managed_message_ = delegate->GetIMEManagedMessage(); 343 ime_managed_message_ = delegate->GetIMEManagedMessage();
344 344
345 Update(); 345 Update();
346 } 346 }
347 347
(...skipping 22 matching lines...) Expand all
370 return ime_count >= threshold; 370 return ime_count >= threshold;
371 } 371 }
372 372
373 ImeListView::SingleImeBehavior TrayIME::GetSingleImeBehavior() { 373 ImeListView::SingleImeBehavior TrayIME::GetSingleImeBehavior() {
374 // If managed, we also want to show a single IME. 374 // If managed, we also want to show a single IME.
375 return IsIMEManaged() ? ImeListView::SHOW_SINGLE_IME 375 return IsIMEManaged() ? ImeListView::SHOW_SINGLE_IME
376 : ImeListView::HIDE_SINGLE_IME; 376 : ImeListView::HIDE_SINGLE_IME;
377 } 377 }
378 378
379 } // namespace ash 379 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/date/date_view.cc ('k') | ash/common/system/overview/overview_button_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698