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

Side by Side Diff: ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc

Issue 2103603002: mash: Remove StatusAreaWidget references from system tray classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments, rename SetSystemTrayHeight to SetTrayBubbleHeight Created 4 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/virtual_keyboard/virtual_keyboard_tray.h" 5 #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h"
6 6
7 #include "ash/common/keyboard/keyboard_ui.h" 7 #include "ash/common/keyboard/keyboard_ui.h"
8 #include "ash/common/material_design/material_design_controller.h" 8 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/shelf/shelf_constants.h" 9 #include "ash/common/shelf/shelf_constants.h"
10 #include "ash/common/shelf/wm_shelf_util.h" 10 #include "ash/common/shelf/wm_shelf_util.h"
11 #include "ash/common/system/tray/tray_constants.h" 11 #include "ash/common/system/tray/tray_constants.h"
12 #include "ash/common/system/tray/tray_utils.h" 12 #include "ash/common/system/tray/tray_utils.h"
13 #include "ash/shell.h" 13 #include "ash/shell.h"
14 #include "ash/system/status_area_widget.h"
15 #include "grit/ash_resources.h" 14 #include "grit/ash_resources.h"
16 #include "grit/ash_strings.h" 15 #include "grit/ash_strings.h"
17 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
18 #include "ui/base/resource/resource_bundle.h" 17 #include "ui/base/resource/resource_bundle.h"
19 #include "ui/events/event.h" 18 #include "ui/events/event.h"
20 #include "ui/gfx/image/image_skia.h" 19 #include "ui/gfx/image/image_skia.h"
21 #include "ui/gfx/paint_vector_icon.h" 20 #include "ui/gfx/paint_vector_icon.h"
22 #include "ui/gfx/vector_icons_public.h" 21 #include "ui/gfx/vector_icons_public.h"
23 #include "ui/views/controls/button/image_button.h" 22 #include "ui/views/controls/button/image_button.h"
24 23
25 namespace ash { 24 namespace ash {
26 25
27 VirtualKeyboardTray::VirtualKeyboardTray(StatusAreaWidget* status_area_widget) 26 VirtualKeyboardTray::VirtualKeyboardTray(WmShelf* wm_shelf)
28 : TrayBackgroundView(status_area_widget->wm_shelf()), button_(nullptr) { 27 : TrayBackgroundView(wm_shelf), button_(nullptr) {
29 button_ = new views::ImageButton(this); 28 button_ = new views::ImageButton(this);
30 if (MaterialDesignController::IsShelfMaterial()) { 29 if (MaterialDesignController::IsShelfMaterial()) {
31 gfx::ImageSkia image_md = 30 gfx::ImageSkia image_md =
32 CreateVectorIcon(gfx::VectorIconId::SHELF_KEYBOARD, kShelfIconColor); 31 CreateVectorIcon(gfx::VectorIconId::SHELF_KEYBOARD, kShelfIconColor);
33 button_->SetImage(views::CustomButton::STATE_NORMAL, &image_md); 32 button_->SetImage(views::CustomButton::STATE_NORMAL, &image_md);
34 } else { 33 } else {
35 gfx::ImageSkia* image_non_md = 34 gfx::ImageSkia* image_non_md =
36 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 35 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
37 IDR_AURA_UBER_TRAY_VIRTUAL_KEYBOARD); 36 IDR_AURA_UBER_TRAY_VIRTUAL_KEYBOARD);
38 button_->SetImage(views::CustomButton::STATE_NORMAL, image_non_md); 37 button_->SetImage(views::CustomButton::STATE_NORMAL, image_non_md);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 const ui::Event& event) { 97 const ui::Event& event) {
99 DCHECK_EQ(button_, sender); 98 DCHECK_EQ(button_, sender);
100 PerformAction(event); 99 PerformAction(event);
101 } 100 }
102 101
103 void VirtualKeyboardTray::OnKeyboardEnabledStateChanged(bool new_value) { 102 void VirtualKeyboardTray::OnKeyboardEnabledStateChanged(bool new_value) {
104 SetVisible(Shell::GetInstance()->keyboard_ui()->IsEnabled()); 103 SetVisible(Shell::GetInstance()->keyboard_ui()->IsEnabled());
105 } 104 }
106 105
107 } // namespace ash 106 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h ('k') | ash/system/overview/overview_button_tray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698