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