| 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/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/shelf/shelf_constants.h" | 9 #include "ash/common/shelf/shelf_constants.h" |
| 9 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| 10 #include "ash/common/shelf/wm_shelf_util.h" | 11 #include "ash/common/shelf/wm_shelf_util.h" |
| 11 #include "ash/common/shell_window_ids.h" | 12 #include "ash/common/shell_window_ids.h" |
| 12 #include "ash/common/system/chromeos/palette/palette_tool.h" | 13 #include "ash/common/system/chromeos/palette/palette_tool.h" |
| 13 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" | 14 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" |
| 14 #include "ash/common/system/tray/system_tray_delegate.h" | 15 #include "ash/common/system/tray/system_tray_delegate.h" |
| 15 #include "ash/common/system/tray/tray_bubble_wrapper.h" | 16 #include "ash/common/system/tray/tray_bubble_wrapper.h" |
| 16 #include "ash/common/system/tray/tray_constants.h" | 17 #include "ash/common/system/tray/tray_constants.h" |
| 17 #include "ash/common/system/tray/tray_popup_header_button.h" | 18 #include "ash/common/system/tray/tray_popup_header_button.h" |
| 18 #include "ash/common/wm_lookup.h" | 19 #include "ash/common/wm_lookup.h" |
| 19 #include "ash/common/wm_root_window_controller.h" | 20 #include "ash/common/wm_root_window_controller.h" |
| 20 #include "ash/common/wm_shell.h" | 21 #include "ash/common/wm_shell.h" |
| 21 #include "ash/common/wm_window.h" | 22 #include "ash/common/wm_window.h" |
| 23 #include "base/command_line.h" |
| 22 #include "base/sys_info.h" | 24 #include "base/sys_info.h" |
| 23 #include "grit/ash_resources.h" | 25 #include "grit/ash_resources.h" |
| 24 #include "grit/ash_strings.h" | 26 #include "grit/ash_strings.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
| 26 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
| 27 #include "ui/gfx/paint_vector_icon.h" | 29 #include "ui/gfx/paint_vector_icon.h" |
| 28 #include "ui/gfx/vector_icons_public.h" | 30 #include "ui/gfx/vector_icons_public.h" |
| 29 #include "ui/views/controls/image_view.h" | 31 #include "ui/views/controls/image_view.h" |
| 30 #include "ui/views/controls/label.h" | 32 #include "ui/views/controls/label.h" |
| 31 #include "ui/views/controls/separator.h" | 33 #include "ui/views/controls/separator.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 43 | 45 |
| 44 // Width of the palette itself. | 46 // Width of the palette itself. |
| 45 const int kPaletteWidth = 360; | 47 const int kPaletteWidth = 360; |
| 46 | 48 |
| 47 const int kSeparatorInset = 10; | 49 const int kSeparatorInset = 10; |
| 48 | 50 |
| 49 const int kBubbleViewTopMargin = 7; | 51 const int kBubbleViewTopMargin = 7; |
| 50 | 52 |
| 51 // Returns true if the command line flag is present that enables the palette. | 53 // Returns true if the command line flag is present that enables the palette. |
| 52 bool IsPaletteEnabled() { | 54 bool IsPaletteEnabled() { |
| 53 // TODO(jdufault): Hookup this function when the flag is in Chrome. | 55 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 54 return false; | 56 ash::switches::kAshEnablePalette); |
| 55 } | 57 } |
| 56 | 58 |
| 57 // Creates a separator. | 59 // Creates a separator. |
| 58 views::Separator* CreateSeparator(views::Separator::Orientation orientation) { | 60 views::Separator* CreateSeparator(views::Separator::Orientation orientation) { |
| 59 views::Separator* separator = | 61 views::Separator* separator = |
| 60 new views::Separator(views::Separator::HORIZONTAL); | 62 new views::Separator(views::Separator::HORIZONTAL); |
| 61 separator->SetColor(ash::kBorderDarkColor); | 63 separator->SetColor(ash::kBorderDarkColor); |
| 62 separator->SetBorder( | 64 separator->SetBorder( |
| 63 views::Border::CreateEmptyBorder(kSeparatorInset, 0, kSeparatorInset, 0)); | 65 views::Border::CreateEmptyBorder(kSeparatorInset, 0, kSeparatorInset, 0)); |
| 64 return separator; | 66 return separator; |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 WmShell::Get()->GetSessionStateDelegate(); | 320 WmShell::Get()->GetSessionStateDelegate(); |
| 319 | 321 |
| 320 SetVisible(!session_state_delegate->IsScreenLocked() && | 322 SetVisible(!session_state_delegate->IsScreenLocked() && |
| 321 session_state_delegate->GetSessionState() == | 323 session_state_delegate->GetSessionState() == |
| 322 SessionStateDelegate::SESSION_STATE_ACTIVE && | 324 SessionStateDelegate::SESSION_STATE_ACTIVE && |
| 323 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != | 325 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != |
| 324 LoginStatus::KIOSK_APP); | 326 LoginStatus::KIOSK_APP); |
| 325 } | 327 } |
| 326 | 328 |
| 327 } // namespace ash | 329 } // namespace ash |
| OLD | NEW |