| OLD | NEW |
| 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/system/tray/system_tray_notifier.h" | 7 #include "ash/common/system/tray/system_tray_notifier.h" |
| 8 #include "ash/common/system/tray/tray_constants.h" | 8 #include "ash/common/system/tray/tray_constants.h" |
| 9 #include "ash/common/system/tray/tray_utils.h" | 9 #include "ash/common/system/tray/tray_utils.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 return gfx::Size(kTrayImeIconSize, kTrayImeIconSize); | 28 return gfx::Size(kTrayImeIconSize, kTrayImeIconSize); |
| 29 } | 29 } |
| 30 int GetHeightForWidth(int width) const override { return kTrayImeIconSize; } | 30 int GetHeightForWidth(int width) const override { return kTrayImeIconSize; } |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 DISALLOW_COPY_AND_ASSIGN(ImeMenuLabel); | 33 DISALLOW_COPY_AND_ASSIGN(ImeMenuLabel); |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 ImeMenuTray::ImeMenuTray(WmShelf* wm_shelf) | 38 ImeMenuTray::ImeMenuTray(WmShelf* wm_shelf, ViewObserver* view_observer) |
| 39 : TrayBackgroundView(wm_shelf), label_(new ImeMenuLabel()) { | 39 : TrayBackgroundView(wm_shelf, view_observer), label_(new ImeMenuLabel()) { |
| 40 SetupLabelForTray(label_); | 40 SetupLabelForTray(label_); |
| 41 tray_container()->AddChildView(label_); | 41 tray_container()->AddChildView(label_); |
| 42 SetContentsBackground(); | 42 SetContentsBackground(); |
| 43 WmShell::Get()->system_tray_notifier()->AddIMEObserver(this); | 43 WmShell::Get()->system_tray_notifier()->AddIMEObserver(this); |
| 44 } | 44 } |
| 45 | 45 |
| 46 ImeMenuTray::~ImeMenuTray() { | 46 ImeMenuTray::~ImeMenuTray() { |
| 47 WmShell::Get()->system_tray_notifier()->RemoveIMEObserver(this); | 47 WmShell::Get()->system_tray_notifier()->RemoveIMEObserver(this); |
| 48 } | 48 } |
| 49 | 49 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 else | 87 else |
| 88 label_->SetText(current_ime_.short_name); | 88 label_->SetText(current_ime_.short_name); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void ImeMenuTray::SetTrayActivation(bool is_active) { | 91 void ImeMenuTray::SetTrayActivation(bool is_active) { |
| 92 SetDrawBackgroundAsActive(is_active); | 92 SetDrawBackgroundAsActive(is_active); |
| 93 // TODO(azurewei): Shows/hides the IME menu tray bubble based on |is_active|. | 93 // TODO(azurewei): Shows/hides the IME menu tray bubble based on |is_active|. |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace ash | 96 } // namespace ash |
| OLD | NEW |