| 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/ash_switches.h" | 7 #include "ash/common/ash_switches.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.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| 11 #include "ash/common/shelf/wm_shelf_util.h" | 11 #include "ash/common/shelf/wm_shelf_util.h" |
| 12 #include "ash/common/shell_window_ids.h" | 12 #include "ash/common/shell_window_ids.h" |
| 13 #include "ash/common/system/chromeos/palette/palette_tool.h" | 13 #include "ash/common/system/chromeos/palette/palette_tool.h" |
| 14 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" | 14 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" |
| 15 #include "ash/common/system/chromeos/palette/palette_utils.h" |
| 15 #include "ash/common/system/tray/system_tray_delegate.h" | 16 #include "ash/common/system/tray/system_tray_delegate.h" |
| 16 #include "ash/common/system/tray/tray_bubble_wrapper.h" | 17 #include "ash/common/system/tray/tray_bubble_wrapper.h" |
| 17 #include "ash/common/system/tray/tray_constants.h" | 18 #include "ash/common/system/tray/tray_constants.h" |
| 18 #include "ash/common/system/tray/tray_popup_header_button.h" | 19 #include "ash/common/system/tray/tray_popup_header_button.h" |
| 19 #include "ash/common/wm_lookup.h" | 20 #include "ash/common/wm_lookup.h" |
| 20 #include "ash/common/wm_root_window_controller.h" | 21 #include "ash/common/wm_root_window_controller.h" |
| 21 #include "ash/common/wm_shell.h" | 22 #include "ash/common/wm_shell.h" |
| 22 #include "ash/common/wm_window.h" | 23 #include "ash/common/wm_window.h" |
| 23 #include "base/command_line.h" | 24 #include "base/command_line.h" |
| 24 #include "base/sys_info.h" | 25 #include "base/sys_info.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 40 // Predefined padding for the icon used in this tray. These are to be set to the | 41 // Predefined padding for the icon used in this tray. These are to be set to the |
| 41 // border of the icon, depending on the current |shelf_alignment()|. | 42 // border of the icon, depending on the current |shelf_alignment()|. |
| 42 const int kHorizontalShelfHorizontalPadding = 8; | 43 const int kHorizontalShelfHorizontalPadding = 8; |
| 43 const int kHorizontalShelfVerticalPadding = 4; | 44 const int kHorizontalShelfVerticalPadding = 4; |
| 44 const int kVerticalShelfHorizontalPadding = 2; | 45 const int kVerticalShelfHorizontalPadding = 2; |
| 45 const int kVerticalShelfVerticalPadding = 5; | 46 const int kVerticalShelfVerticalPadding = 5; |
| 46 | 47 |
| 47 // Width of the palette itself (dp). | 48 // Width of the palette itself (dp). |
| 48 const int kPaletteWidth = 360; | 49 const int kPaletteWidth = 360; |
| 49 | 50 |
| 50 // Returns true if the command line flag is present that enables the palette. | |
| 51 bool IsPaletteEnabled() { | |
| 52 return base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 53 ash::switches::kAshEnablePalette); | |
| 54 } | |
| 55 | |
| 56 // Creates a separator. | 51 // Creates a separator. |
| 57 views::Separator* CreateSeparator(views::Separator::Orientation orientation) { | 52 views::Separator* CreateSeparator(views::Separator::Orientation orientation) { |
| 58 const int kSeparatorInset = 10; | 53 const int kSeparatorInset = 10; |
| 59 | 54 |
| 60 views::Separator* separator = | 55 views::Separator* separator = |
| 61 new views::Separator(views::Separator::HORIZONTAL); | 56 new views::Separator(views::Separator::HORIZONTAL); |
| 62 separator->SetColor(ash::kBorderDarkColor); | 57 separator->SetColor(ash::kBorderDarkColor); |
| 63 separator->SetBorder( | 58 separator->SetBorder( |
| 64 views::Border::CreateEmptyBorder(kSeparatorInset, 0, kSeparatorInset, 0)); | 59 views::Border::CreateEmptyBorder(kSeparatorInset, 0, kSeparatorInset, 0)); |
| 65 return separator; | 60 return separator; |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 WmShell::Get()->GetSessionStateDelegate(); | 304 WmShell::Get()->GetSessionStateDelegate(); |
| 310 | 305 |
| 311 SetVisible(!session_state_delegate->IsScreenLocked() && | 306 SetVisible(!session_state_delegate->IsScreenLocked() && |
| 312 session_state_delegate->GetSessionState() == | 307 session_state_delegate->GetSessionState() == |
| 313 SessionStateDelegate::SESSION_STATE_ACTIVE && | 308 SessionStateDelegate::SESSION_STATE_ACTIVE && |
| 314 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != | 309 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != |
| 315 LoginStatus::KIOSK_APP); | 310 LoginStatus::KIOSK_APP); |
| 316 } | 311 } |
| 317 | 312 |
| 318 } // namespace ash | 313 } // namespace ash |
| OLD | NEW |