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/palette/palette_tray.h" | 5 #include "ash/common/system/chromeos/palette/palette_tray.h" |
6 | 6 |
7 #include "ash/common/shelf/shelf_constants.h" | 7 #include "ash/common/shelf/shelf_constants.h" |
8 #include "ash/common/shelf/wm_shelf.h" | 8 #include "ash/common/shelf/wm_shelf.h" |
9 #include "ash/common/shelf/wm_shelf_util.h" | 9 #include "ash/common/shelf/wm_shelf_util.h" |
10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
11 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" | 11 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" |
12 #include "ash/common/system/chromeos/palette/palette_utils.h" | 12 #include "ash/common/system/chromeos/palette/palette_utils.h" |
| 13 #include "ash/common/system/tray/system_tray_controller.h" |
13 #include "ash/common/system/tray/system_tray_delegate.h" | 14 #include "ash/common/system/tray/system_tray_delegate.h" |
14 #include "ash/common/system/tray/tray_bubble_wrapper.h" | 15 #include "ash/common/system/tray/tray_bubble_wrapper.h" |
15 #include "ash/common/system/tray/tray_constants.h" | 16 #include "ash/common/system/tray/tray_constants.h" |
16 #include "ash/common/system/tray/tray_popup_header_button.h" | 17 #include "ash/common/system/tray/tray_popup_header_button.h" |
17 #include "ash/common/wm_lookup.h" | 18 #include "ash/common/wm_lookup.h" |
18 #include "ash/common/wm_root_window_controller.h" | 19 #include "ash/common/wm_root_window_controller.h" |
19 #include "ash/common/wm_shell.h" | 20 #include "ash/common/wm_shell.h" |
20 #include "ash/common/wm_window.h" | 21 #include "ash/common/wm_window.h" |
21 #include "ash/resources/vector_icons/vector_icons.h" | 22 #include "ash/resources/vector_icons/vector_icons.h" |
22 #include "base/metrics/histogram_macros.h" | 23 #include "base/metrics/histogram_macros.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 118 } |
118 | 119 |
119 ~TitleView() override {} | 120 ~TitleView() override {} |
120 | 121 |
121 private: | 122 private: |
122 // views::ButtonListener: | 123 // views::ButtonListener: |
123 void ButtonPressed(views::Button* sender, const ui::Event& event) override { | 124 void ButtonPressed(views::Button* sender, const ui::Event& event) override { |
124 if (sender == settings_button_) { | 125 if (sender == settings_button_) { |
125 palette_tray_->RecordPaletteOptionsUsage( | 126 palette_tray_->RecordPaletteOptionsUsage( |
126 PaletteTrayOptions::PALETTE_SETTINGS_BUTTON); | 127 PaletteTrayOptions::PALETTE_SETTINGS_BUTTON); |
127 WmShell::Get()->system_tray_delegate()->ShowPaletteSettings(); | 128 WmShell::Get()->system_tray_controller()->ShowPaletteSettings(); |
128 palette_tray_->HidePalette(); | 129 palette_tray_->HidePalette(); |
129 } else if (sender == help_button_) { | 130 } else if (sender == help_button_) { |
130 palette_tray_->RecordPaletteOptionsUsage( | 131 palette_tray_->RecordPaletteOptionsUsage( |
131 PaletteTrayOptions::PALETTE_HELP_BUTTON); | 132 PaletteTrayOptions::PALETTE_HELP_BUTTON); |
132 WmShell::Get()->system_tray_delegate()->ShowPaletteHelp(); | 133 WmShell::Get()->system_tray_controller()->ShowPaletteHelp(); |
133 palette_tray_->HidePalette(); | 134 palette_tray_->HidePalette(); |
134 } else { | 135 } else { |
135 NOTREACHED(); | 136 NOTREACHED(); |
136 } | 137 } |
137 } | 138 } |
138 | 139 |
139 // Unowned pointers to button views so we can determine which button was | 140 // Unowned pointers to button views so we can determine which button was |
140 // clicked. | 141 // clicked. |
141 ash::TrayPopupHeaderButton* settings_button_; | 142 ash::TrayPopupHeaderButton* settings_button_; |
142 ash::TrayPopupHeaderButton* help_button_; | 143 ash::TrayPopupHeaderButton* help_button_; |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 } else { | 439 } else { |
439 UpdateIconVisibility(); | 440 UpdateIconVisibility(); |
440 } | 441 } |
441 } | 442 } |
442 | 443 |
443 void PaletteTray::UpdateIconVisibility() { | 444 void PaletteTray::UpdateIconVisibility() { |
444 SetVisible(IsInUserSession()); | 445 SetVisible(IsInUserSession()); |
445 } | 446 } |
446 | 447 |
447 } // namespace ash | 448 } // namespace ash |
OLD | NEW |