| 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/system/overview/overview_button_tray.h" | 5 #include "ash/system/overview/overview_button_tray.h" |
| 6 | 6 |
| 7 #include "ash/shelf/shelf_types.h" | 7 #include "ash/shelf/shelf_types.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
| 10 #include "ash/system/tray/tray_utils.h" | 10 #include "ash/system/tray/tray_utils.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // border of the icon, depending on the current shelf_alignment() | 22 // border of the icon, depending on the current shelf_alignment() |
| 23 const int kHorizontalShelfHorizontalPadding = 8; | 23 const int kHorizontalShelfHorizontalPadding = 8; |
| 24 const int kHorizontalShelfVerticalPadding = 4; | 24 const int kHorizontalShelfVerticalPadding = 4; |
| 25 const int kVerticalShelfHorizontalPadding = 2; | 25 const int kVerticalShelfHorizontalPadding = 2; |
| 26 const int kVerticalShelfVerticalPadding = 5; | 26 const int kVerticalShelfVerticalPadding = 5; |
| 27 | 27 |
| 28 } // namespace | 28 } // namespace |
| 29 | 29 |
| 30 namespace ash { | 30 namespace ash { |
| 31 | 31 |
| 32 OverviewButtonTray::OverviewButtonTray( | 32 OverviewButtonTray::OverviewButtonTray(StatusAreaWidget* status_area_widget) |
| 33 internal::StatusAreaWidget* status_area_widget) | 33 : TrayBackgroundView(status_area_widget), icon_(NULL) { |
| 34 : TrayBackgroundView(status_area_widget), | |
| 35 icon_(NULL) { | |
| 36 SetContentsBackground(); | 34 SetContentsBackground(); |
| 37 | 35 |
| 38 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 36 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
| 39 icon_ = new views::ImageView(); | 37 icon_ = new views::ImageView(); |
| 40 icon_->SetImage( | 38 icon_->SetImage( |
| 41 bundle.GetImageNamed(IDR_AURA_UBER_TRAY_OVERVIEW_MODE).ToImageSkia()); | 39 bundle.GetImageNamed(IDR_AURA_UBER_TRAY_OVERVIEW_MODE).ToImageSkia()); |
| 42 SetIconBorderForShelfAlignment(); | 40 SetIconBorderForShelfAlignment(); |
| 43 tray_container()->AddChildView(icon_); | 41 tray_container()->AddChildView(icon_); |
| 44 | 42 |
| 45 UpdateIconVisibility(Shell::GetInstance()-> | 43 UpdateIconVisibility(Shell::GetInstance()-> |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 kVerticalShelfHorizontalPadding)); | 110 kVerticalShelfHorizontalPadding)); |
| 113 } | 111 } |
| 114 } | 112 } |
| 115 | 113 |
| 116 void OverviewButtonTray::UpdateIconVisibility(bool maximize_mode_enabled) { | 114 void OverviewButtonTray::UpdateIconVisibility(bool maximize_mode_enabled) { |
| 117 SetVisible(maximize_mode_enabled && | 115 SetVisible(maximize_mode_enabled && |
| 118 Shell::GetInstance()->window_selector_controller()->CanSelect()); | 116 Shell::GetInstance()->window_selector_controller()->CanSelect()); |
| 119 } | 117 } |
| 120 | 118 |
| 121 } // namespace ash | 119 } // namespace ash |
| OLD | NEW |