| 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/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.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 views::View* settings_button_; | 144 views::View* settings_button_; |
| 145 views::View* help_button_; | 145 views::View* help_button_; |
| 146 PaletteTray* palette_tray_; | 146 PaletteTray* palette_tray_; |
| 147 | 147 |
| 148 DISALLOW_COPY_AND_ASSIGN(TitleView); | 148 DISALLOW_COPY_AND_ASSIGN(TitleView); |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 } // namespace | 151 } // namespace |
| 152 | 152 |
| 153 PaletteTray::PaletteTray(WmShelf* wm_shelf) | 153 PaletteTray::PaletteTray(WmShelf* wm_shelf) |
| 154 : TrayBackgroundView(wm_shelf), | 154 : TrayBackgroundView(wm_shelf, false), |
| 155 palette_tool_manager_(new PaletteToolManager(this)), | 155 palette_tool_manager_(new PaletteToolManager(this)), |
| 156 weak_factory_(this) { | 156 weak_factory_(this) { |
| 157 PaletteTool::RegisterToolInstances(palette_tool_manager_.get()); | 157 PaletteTool::RegisterToolInstances(palette_tool_manager_.get()); |
| 158 | 158 |
| 159 if (MaterialDesignController::IsShelfMaterial()) { | 159 if (MaterialDesignController::IsShelfMaterial()) |
| 160 SetInkDropMode(InkDropMode::ON); | 160 SetInkDropMode(InkDropMode::ON); |
| 161 SetContentsBackground(false); | |
| 162 } else { | |
| 163 SetContentsBackground(true); | |
| 164 } | |
| 165 | 161 |
| 166 SetLayoutManager(new views::FillLayout()); | 162 SetLayoutManager(new views::FillLayout()); |
| 167 icon_ = new views::ImageView(); | 163 icon_ = new views::ImageView(); |
| 168 UpdateTrayIcon(); | 164 UpdateTrayIcon(); |
| 169 | 165 |
| 170 tray_container()->SetMargin(kTrayIconMainAxisInset, kTrayIconCrossAxisInset); | 166 tray_container()->SetMargin(kTrayIconMainAxisInset, kTrayIconCrossAxisInset); |
| 171 tray_container()->AddChildView(icon_); | 167 tray_container()->AddChildView(icon_); |
| 172 | 168 |
| 173 WmShell::Get()->AddShellObserver(this); | 169 WmShell::Get()->AddShellObserver(this); |
| 174 WmShell::Get()->GetSessionStateDelegate()->AddSessionStateObserver(this); | 170 WmShell::Get()->GetSessionStateDelegate()->AddSessionStateObserver(this); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 UpdateIconVisibility(); | 426 UpdateIconVisibility(); |
| 431 } | 427 } |
| 432 } | 428 } |
| 433 | 429 |
| 434 void PaletteTray::UpdateIconVisibility() { | 430 void PaletteTray::UpdateIconVisibility() { |
| 435 SetVisible(is_palette_enabled_ && palette_utils::HasStylusInput() && | 431 SetVisible(is_palette_enabled_ && palette_utils::HasStylusInput() && |
| 436 IsInUserSession()); | 432 IsInUserSession()); |
| 437 } | 433 } |
| 438 | 434 |
| 439 } // namespace ash | 435 } // namespace ash |
| OLD | NEW |