| 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/session/session_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/shelf/wm_shelf_observer.h" |
| 8 #include "ash/common/shelf/wm_shelf_util.h" | 9 #include "ash/common/shelf/wm_shelf_util.h" |
| 9 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
| 10 #include "ash/common/system/chromeos/ime_menu/ime_list_view.h" | 11 #include "ash/common/system/chromeos/ime_menu/ime_list_view.h" |
| 11 #include "ash/common/system/tray/system_tray_delegate.h" | 12 #include "ash/common/system/tray/system_tray_delegate.h" |
| 12 #include "ash/common/system/tray/system_tray_notifier.h" | 13 #include "ash/common/system/tray/system_tray_notifier.h" |
| 13 #include "ash/common/system/tray/tray_constants.h" | 14 #include "ash/common/system/tray/tray_constants.h" |
| 14 #include "ash/common/system/tray/tray_popup_header_button.h" | 15 #include "ash/common/system/tray/tray_popup_header_button.h" |
| 15 #include "ash/common/system/tray/tray_utils.h" | 16 #include "ash/common/system/tray/tray_utils.h" |
| 16 #include "ash/common/wm_lookup.h" | 17 #include "ash/common/wm_lookup.h" |
| 17 #include "ash/common/wm_root_window_controller.h" | 18 #include "ash/common/wm_root_window_controller.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 TrayPopupHeaderButton* emoji_button_; | 131 TrayPopupHeaderButton* emoji_button_; |
| 131 TrayPopupHeaderButton* voice_button_; | 132 TrayPopupHeaderButton* voice_button_; |
| 132 TrayPopupHeaderButton* handwriting_button_; | 133 TrayPopupHeaderButton* handwriting_button_; |
| 133 TrayPopupHeaderButton* settings_button_; | 134 TrayPopupHeaderButton* settings_button_; |
| 134 | 135 |
| 135 DISALLOW_COPY_AND_ASSIGN(ImeButtonsView); | 136 DISALLOW_COPY_AND_ASSIGN(ImeButtonsView); |
| 136 }; | 137 }; |
| 137 | 138 |
| 138 } // namespace | 139 } // namespace |
| 139 | 140 |
| 140 ImeMenuTray::ImeMenuTray(WmShelf* wm_shelf) | 141 ImeMenuTray::ImeMenuTray(WmShelf* wm_shelf, WmShelfObserver* wm_shelf_observer) |
| 141 : TrayBackgroundView(wm_shelf), label_(new ImeMenuLabel()) { | 142 : TrayBackgroundView(wm_shelf, wm_shelf_observer), |
| 143 label_(new ImeMenuLabel()) { |
| 142 SetupLabelForTray(label_); | 144 SetupLabelForTray(label_); |
| 143 tray_container()->AddChildView(label_); | 145 tray_container()->AddChildView(label_); |
| 144 SetContentsBackground(); | 146 SetContentsBackground(); |
| 145 WmShell::Get()->system_tray_notifier()->AddIMEObserver(this); | 147 WmShell::Get()->system_tray_notifier()->AddIMEObserver(this); |
| 146 } | 148 } |
| 147 | 149 |
| 148 ImeMenuTray::~ImeMenuTray() { | 150 ImeMenuTray::~ImeMenuTray() { |
| 149 WmShell::Get()->system_tray_notifier()->RemoveIMEObserver(this); | 151 WmShell::Get()->system_tray_notifier()->RemoveIMEObserver(this); |
| 150 } | 152 } |
| 151 | 153 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 bubble_.reset(new ash::TrayBubbleWrapper(this, bubble_view)); | 274 bubble_.reset(new ash::TrayBubbleWrapper(this, bubble_view)); |
| 273 SetDrawBackgroundAsActive(true); | 275 SetDrawBackgroundAsActive(true); |
| 274 } | 276 } |
| 275 | 277 |
| 276 void ImeMenuTray::HideImeMenuBubble() { | 278 void ImeMenuTray::HideImeMenuBubble() { |
| 277 bubble_.reset(); | 279 bubble_.reset(); |
| 278 SetDrawBackgroundAsActive(false); | 280 SetDrawBackgroundAsActive(false); |
| 279 } | 281 } |
| 280 | 282 |
| 281 } // namespace ash | 283 } // namespace ash |
| OLD | NEW |