| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 } | 233 } |
| 234 | 234 |
| 235 bool PaletteTray::ShowPalette() { | 235 bool PaletteTray::ShowPalette() { |
| 236 if (bubble_) | 236 if (bubble_) |
| 237 return false; | 237 return false; |
| 238 | 238 |
| 239 DCHECK(tray_container()); | 239 DCHECK(tray_container()); |
| 240 | 240 |
| 241 views::TrayBubbleView::InitParams init_params(GetAnchorAlignment(), | 241 views::TrayBubbleView::InitParams init_params(GetAnchorAlignment(), |
| 242 kPaletteWidth, kPaletteWidth); | 242 kPaletteWidth, kPaletteWidth); |
| 243 init_params.can_activate = true; | |
| 244 init_params.close_on_deactivate = true; | 243 init_params.close_on_deactivate = true; |
| 245 | 244 |
| 246 DCHECK(tray_container()); | 245 DCHECK(tray_container()); |
| 247 | 246 |
| 248 // The views::TrayBubbleView ctor will cause a shelf auto hide update check. | 247 // The views::TrayBubbleView ctor will cause a shelf auto hide update check. |
| 249 // Make sure to block auto hiding before that check happens. | 248 // Make sure to block auto hiding before that check happens. |
| 250 should_block_shelf_auto_hide_ = true; | 249 should_block_shelf_auto_hide_ = true; |
| 251 | 250 |
| 252 // TODO(tdanderson): Refactor into common row layout code. | 251 // TODO(tdanderson): Refactor into common row layout code. |
| 253 // TODO(tdanderson|jdufault): Add material design ripple effects to the menu | 252 // TODO(tdanderson|jdufault): Add material design ripple effects to the menu |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 } else { | 463 } else { |
| 465 UpdateIconVisibility(); | 464 UpdateIconVisibility(); |
| 466 } | 465 } |
| 467 } | 466 } |
| 468 | 467 |
| 469 void PaletteTray::UpdateIconVisibility() { | 468 void PaletteTray::UpdateIconVisibility() { |
| 470 SetVisible(is_palette_enabled_ && IsInUserSession()); | 469 SetVisible(is_palette_enabled_ && IsInUserSession()); |
| 471 } | 470 } |
| 472 | 471 |
| 473 } // namespace ash | 472 } // namespace ash |
| OLD | NEW |