OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tray/tray_background_view.h" | 5 #include "ash/common/system/tray/tray_background_view.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/shelf/shelf_constants.h" | 8 #include "ash/common/shelf/shelf_constants.h" |
9 #include "ash/common/shelf/wm_shelf.h" | 9 #include "ash/common/shelf/wm_shelf.h" |
10 #include "ash/common/shelf/wm_shelf_util.h" | 10 #include "ash/common/shelf/wm_shelf_util.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 if (size_.IsEmpty()) | 179 if (size_.IsEmpty()) |
180 return views::View::GetPreferredSize(); | 180 return views::View::GetPreferredSize(); |
181 return size_; | 181 return size_; |
182 } | 182 } |
183 | 183 |
184 void TrayBackgroundView::TrayContainer::ChildPreferredSizeChanged( | 184 void TrayBackgroundView::TrayContainer::ChildPreferredSizeChanged( |
185 views::View* child) { | 185 views::View* child) { |
186 PreferredSizeChanged(); | 186 PreferredSizeChanged(); |
187 } | 187 } |
188 | 188 |
189 gfx::Insets TrayBackgroundView::TrayContainer::GetInsets() const { | |
190 return views::View::GetInsets() + insets_; | |
xiyuan
2016/08/05 16:18:59
Can we use |insets_| and create a proper empty bor
yoshiki
2016/08/09 16:43:04
Done.
| |
191 } | |
192 | |
189 void TrayBackgroundView::TrayContainer::ChildVisibilityChanged(View* child) { | 193 void TrayBackgroundView::TrayContainer::ChildVisibilityChanged(View* child) { |
190 PreferredSizeChanged(); | 194 PreferredSizeChanged(); |
191 } | 195 } |
192 | 196 |
193 void TrayBackgroundView::TrayContainer::ViewHierarchyChanged( | 197 void TrayBackgroundView::TrayContainer::ViewHierarchyChanged( |
194 const ViewHierarchyChangedDetails& details) { | 198 const ViewHierarchyChangedDetails& details) { |
195 if (details.parent == this) | 199 if (details.parent == this) |
196 PreferredSizeChanged(); | 200 PreferredSizeChanged(); |
197 } | 201 } |
198 | 202 |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
499 } | 503 } |
500 | 504 |
501 void TrayBackgroundView::UpdateShelfItemBackground(int alpha) { | 505 void TrayBackgroundView::UpdateShelfItemBackground(int alpha) { |
502 if (background_) { | 506 if (background_) { |
503 background_->set_alpha(alpha); | 507 background_->set_alpha(alpha); |
504 SchedulePaint(); | 508 SchedulePaint(); |
505 } | 509 } |
506 } | 510 } |
507 | 511 |
508 } // namespace ash | 512 } // namespace ash |
OLD | NEW |