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

Side by Side Diff: ash/common/system/chromeos/ime_menu/ime_menu_tray.cc

Issue 2775973002: Promotes more accessors from WmShell to Shell (Closed)
Patch Set: feedback 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/chromeos/ime_menu/ime_menu_tray.h" 5 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h"
6 6
7 #include "ash/common/accessibility_delegate.h" 7 #include "ash/common/accessibility_delegate.h"
8 #include "ash/common/ash_constants.h" 8 #include "ash/common/ash_constants.h"
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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 label_(new ImeMenuLabel()), 353 label_(new ImeMenuLabel()),
354 show_keyboard_(false), 354 show_keyboard_(false),
355 force_show_keyboard_(false), 355 force_show_keyboard_(false),
356 should_block_shelf_auto_hide_(false), 356 should_block_shelf_auto_hide_(false),
357 keyboard_suppressed_(false), 357 keyboard_suppressed_(false),
358 show_bubble_after_keyboard_hidden_(false) { 358 show_bubble_after_keyboard_hidden_(false) {
359 if (MaterialDesignController::IsShelfMaterial()) 359 if (MaterialDesignController::IsShelfMaterial())
360 SetInkDropMode(InkDropMode::ON); 360 SetInkDropMode(InkDropMode::ON);
361 SetupLabelForTray(label_); 361 SetupLabelForTray(label_);
362 tray_container()->AddChildView(label_); 362 tray_container()->AddChildView(label_);
363 SystemTrayNotifier* tray_notifier = WmShell::Get()->system_tray_notifier(); 363 SystemTrayNotifier* tray_notifier = Shell::Get()->system_tray_notifier();
364 tray_notifier->AddIMEObserver(this); 364 tray_notifier->AddIMEObserver(this);
365 tray_notifier->AddVirtualKeyboardObserver(this); 365 tray_notifier->AddVirtualKeyboardObserver(this);
366 } 366 }
367 367
368 ImeMenuTray::~ImeMenuTray() { 368 ImeMenuTray::~ImeMenuTray() {
369 if (bubble_) 369 if (bubble_)
370 bubble_->bubble_view()->reset_delegate(); 370 bubble_->bubble_view()->reset_delegate();
371 SystemTrayNotifier* tray_notifier = WmShell::Get()->system_tray_notifier(); 371 SystemTrayNotifier* tray_notifier = Shell::Get()->system_tray_notifier();
372 tray_notifier->RemoveIMEObserver(this); 372 tray_notifier->RemoveIMEObserver(this);
373 tray_notifier->RemoveVirtualKeyboardObserver(this); 373 tray_notifier->RemoveVirtualKeyboardObserver(this);
374 keyboard::KeyboardController* keyboard_controller = 374 keyboard::KeyboardController* keyboard_controller =
375 keyboard::KeyboardController::GetInstance(); 375 keyboard::KeyboardController::GetInstance();
376 if (keyboard_controller) 376 if (keyboard_controller)
377 keyboard_controller->RemoveObserver(this); 377 keyboard_controller->RemoveObserver(this);
378 } 378 }
379 379
380 void ImeMenuTray::ShowImeMenuBubble() { 380 void ImeMenuTray::ShowImeMenuBubble() {
381 keyboard::KeyboardController* keyboard_controller = 381 keyboard::KeyboardController* keyboard_controller =
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 Shell::Get()->system_tray_delegate()->GetCurrentIME(&current_ime_); 639 Shell::Get()->system_tray_delegate()->GetCurrentIME(&current_ime_);
640 640
641 // Updates the tray label based on the current input method. 641 // Updates the tray label based on the current input method.
642 if (current_ime_.third_party) 642 if (current_ime_.third_party)
643 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*")); 643 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*"));
644 else 644 else
645 label_->SetText(current_ime_.short_name); 645 label_->SetText(current_ime_.short_name);
646 } 646 }
647 647
648 } // namespace ash 648 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698