| 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/system/tray/tray_details_view.h" | 5 #include "ash/system/tray/tray_details_view.h" |
| 6 | 6 |
| 7 #include "ash/ash_view_ids.h" | 7 #include "ash/ash_view_ids.h" |
| 8 #include "ash/strings/grit/ash_strings.h" | 8 #include "ash/strings/grit/ash_strings.h" |
| 9 #include "ash/system/tray/system_menu_button.h" | 9 #include "ash/system/tray/system_menu_button.h" |
| 10 #include "ash/system/tray/system_tray.h" | 10 #include "ash/system/tray/system_tray.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 231 |
| 232 TrayDetailsView::TrayDetailsView(SystemTrayItem* owner) | 232 TrayDetailsView::TrayDetailsView(SystemTrayItem* owner) |
| 233 : owner_(owner), | 233 : owner_(owner), |
| 234 box_layout_(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)), | 234 box_layout_(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)), |
| 235 scroller_(nullptr), | 235 scroller_(nullptr), |
| 236 scroll_content_(nullptr), | 236 scroll_content_(nullptr), |
| 237 progress_bar_(nullptr), | 237 progress_bar_(nullptr), |
| 238 tri_view_(nullptr), | 238 tri_view_(nullptr), |
| 239 back_button_(nullptr) { | 239 back_button_(nullptr) { |
| 240 SetLayoutManager(box_layout_); | 240 SetLayoutManager(box_layout_); |
| 241 set_background(views::Background::CreateSolidBackground(kBackgroundColor)); | 241 set_background(views::Background::CreateThemedSolidBackground( |
| 242 this, ui::NativeTheme::kColorId_BubbleBackground)); |
| 242 } | 243 } |
| 243 | 244 |
| 244 TrayDetailsView::~TrayDetailsView() {} | 245 TrayDetailsView::~TrayDetailsView() {} |
| 245 | 246 |
| 246 void TrayDetailsView::OnViewClicked(views::View* sender) { | 247 void TrayDetailsView::OnViewClicked(views::View* sender) { |
| 247 HandleViewClicked(sender); | 248 HandleViewClicked(sender); |
| 248 } | 249 } |
| 249 | 250 |
| 250 void TrayDetailsView::ButtonPressed(views::Button* sender, | 251 void TrayDetailsView::ButtonPressed(views::Button* sender, |
| 251 const ui::Event& event) { | 252 const ui::Event& event) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 289 } |
| 289 | 290 |
| 290 void TrayDetailsView::CreateScrollableList() { | 291 void TrayDetailsView::CreateScrollableList() { |
| 291 DCHECK(!scroller_); | 292 DCHECK(!scroller_); |
| 292 scroll_content_ = new ScrollContentsView(); | 293 scroll_content_ = new ScrollContentsView(); |
| 293 scroller_ = new views::ScrollView; | 294 scroller_ = new views::ScrollView; |
| 294 scroller_->SetContents(scroll_content_); | 295 scroller_->SetContents(scroll_content_); |
| 295 // Make the |scroller_| have a layer to clip |scroll_content_|'s children. | 296 // Make the |scroller_| have a layer to clip |scroll_content_|'s children. |
| 296 // TODO(varkha): Make the sticky rows work with EnableViewPortLayer(). | 297 // TODO(varkha): Make the sticky rows work with EnableViewPortLayer(). |
| 297 scroller_->SetPaintToLayer(); | 298 scroller_->SetPaintToLayer(); |
| 298 scroller_->set_background( | 299 scroller_->set_background(views::Background::CreateThemedSolidBackground( |
| 299 views::Background::CreateSolidBackground(kBackgroundColor)); | 300 scroller_, ui::NativeTheme::kColorId_BubbleBackground)); |
| 300 scroller_->layer()->SetMasksToBounds(true); | 301 scroller_->layer()->SetMasksToBounds(true); |
| 301 | 302 |
| 302 AddChildView(scroller_); | 303 AddChildView(scroller_); |
| 303 box_layout_->SetFlexForView(scroller_, 1); | 304 box_layout_->SetFlexForView(scroller_, 1); |
| 304 } | 305 } |
| 305 | 306 |
| 306 void TrayDetailsView::Reset() { | 307 void TrayDetailsView::Reset() { |
| 307 RemoveAllChildViews(true); | 308 RemoveAllChildViews(true); |
| 308 scroller_ = nullptr; | 309 scroller_ = nullptr; |
| 309 scroll_content_ = nullptr; | 310 scroll_content_ = nullptr; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 if (bounds().IsEmpty()) | 392 if (bounds().IsEmpty()) |
| 392 return views::View::GetHeightForWidth(width); | 393 return views::View::GetHeightForWidth(width); |
| 393 | 394 |
| 394 // The height of the bubble that contains this detailed view is set to | 395 // The height of the bubble that contains this detailed view is set to |
| 395 // the preferred height of the default view, and that determines the | 396 // the preferred height of the default view, and that determines the |
| 396 // initial height of |this|. Always request to stay the same height. | 397 // initial height of |this|. Always request to stay the same height. |
| 397 return height(); | 398 return height(); |
| 398 } | 399 } |
| 399 | 400 |
| 400 } // namespace ash | 401 } // namespace ash |
| OLD | NEW |