| OLD | NEW |
| 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/common/system/overview/overview_button_tray.h" | 5 #include "ash/common/system/overview/overview_button_tray.h" |
| 6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.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/system_tray_delegate.h" | 11 #include "ash/common/system/tray/system_tray_delegate.h" |
| 12 #include "ash/common/system/tray/tray_constants.h" | 12 #include "ash/common/system/tray/tray_constants.h" |
| 13 #include "ash/common/system/tray/tray_utils.h" | 13 #include "ash/common/system/tray/tray_utils.h" |
| 14 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 14 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 15 #include "ash/common/wm/overview/window_selector_controller.h" | 15 #include "ash/common/wm/overview/window_selector_controller.h" |
| 16 #include "ash/common/wm_shell.h" | 16 #include "ash/common/wm_shell.h" |
| 17 #include "ash/public/cpp/shelf_types.h" | 17 #include "ash/public/cpp/shelf_types.h" |
| 18 #include "ash/resources/vector_icons/vector_icons.h" |
| 18 #include "grit/ash_resources.h" | 19 #include "grit/ash_resources.h" |
| 19 #include "grit/ash_strings.h" | 20 #include "grit/ash_strings.h" |
| 20 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 21 #include "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
| 22 #include "ui/gfx/paint_vector_icon.h" | 23 #include "ui/gfx/paint_vector_icon.h" |
| 23 #include "ui/gfx/vector_icons_public.h" | |
| 24 #include "ui/views/border.h" | 24 #include "ui/views/border.h" |
| 25 #include "ui/views/controls/image_view.h" | 25 #include "ui/views/controls/image_view.h" |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 // Predefined padding for the icon used in this tray. These are to be set to the | 29 // Predefined padding for the icon used in this tray. These are to be set to the |
| 30 // border of the icon, depending on the current shelf_alignment() | 30 // border of the icon, depending on the current shelf_alignment() |
| 31 const int kHorizontalShelfHorizontalPadding = 8; | 31 const int kHorizontalShelfHorizontalPadding = 8; |
| 32 const int kHorizontalShelfVerticalPadding = 4; | 32 const int kHorizontalShelfVerticalPadding = 4; |
| 33 const int kVerticalShelfHorizontalPadding = 2; | 33 const int kVerticalShelfHorizontalPadding = 2; |
| 34 const int kVerticalShelfVerticalPadding = 5; | 34 const int kVerticalShelfVerticalPadding = 5; |
| 35 | 35 |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 namespace ash { | 38 namespace ash { |
| 39 | 39 |
| 40 OverviewButtonTray::OverviewButtonTray(WmShelf* wm_shelf) | 40 OverviewButtonTray::OverviewButtonTray(WmShelf* wm_shelf) |
| 41 : TrayBackgroundView(wm_shelf), icon_(nullptr) { | 41 : TrayBackgroundView(wm_shelf), icon_(nullptr) { |
| 42 icon_ = new views::ImageView(); | 42 icon_ = new views::ImageView(); |
| 43 if (MaterialDesignController::IsShelfMaterial()) { | 43 if (MaterialDesignController::IsShelfMaterial()) { |
| 44 SetInkDropMode(InkDropMode::ON); | 44 SetInkDropMode(InkDropMode::ON); |
| 45 SetContentsBackground(false); | 45 SetContentsBackground(false); |
| 46 gfx::ImageSkia image_md = | 46 gfx::ImageSkia image_md = |
| 47 CreateVectorIcon(gfx::VectorIconId::SHELF_OVERVIEW, kShelfIconColor); | 47 CreateVectorIcon(kShelfOverviewIcon, kShelfIconColor); |
| 48 icon_->SetImage(image_md); | 48 icon_->SetImage(image_md); |
| 49 } else { | 49 } else { |
| 50 SetContentsBackground(true); | 50 SetContentsBackground(true); |
| 51 gfx::ImageSkia* image_non_md = | 51 gfx::ImageSkia* image_non_md = |
| 52 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 52 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 53 IDR_AURA_UBER_TRAY_OVERVIEW_MODE); | 53 IDR_AURA_UBER_TRAY_OVERVIEW_MODE); |
| 54 icon_->SetImage(image_non_md); | 54 icon_->SetImage(image_non_md); |
| 55 } | 55 } |
| 56 SetIconBorderForShelfAlignment(); | 56 SetIconBorderForShelfAlignment(); |
| 57 tray_container()->AddChildView(icon_); | 57 tray_container()->AddChildView(icon_); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 !session_state_delegate->IsScreenLocked() && | 151 !session_state_delegate->IsScreenLocked() && |
| 152 session_state_delegate->GetSessionState() == | 152 session_state_delegate->GetSessionState() == |
| 153 session_manager::SessionState::ACTIVE && | 153 session_manager::SessionState::ACTIVE && |
| 154 shell->system_tray_delegate()->GetUserLoginStatus() != | 154 shell->system_tray_delegate()->GetUserLoginStatus() != |
| 155 LoginStatus::KIOSK_APP && | 155 LoginStatus::KIOSK_APP && |
| 156 shell->system_tray_delegate()->GetUserLoginStatus() != | 156 shell->system_tray_delegate()->GetUserLoginStatus() != |
| 157 LoginStatus::ARC_KIOSK_APP); | 157 LoginStatus::ARC_KIOSK_APP); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace ash | 160 } // namespace ash |
| OLD | NEW |