Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: ash/system/user/user_card_view.cc

Issue 2816193002: Introduce a type of View background that stays in sync with its host (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/system/tray_accessibility.cc ('k') | ash/system/user/user_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/user/user_card_view.h" 5 #include "ash/system/user/user_card_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 UserCardView::UserCardView(LoginStatus login_status, int user_index) 287 UserCardView::UserCardView(LoginStatus login_status, int user_index)
288 : user_index_(user_index) { 288 : user_index_(user_index) {
289 auto* layout = new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 289 auto* layout = new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0,
290 kTrayPopupLabelHorizontalPadding); 290 kTrayPopupLabelHorizontalPadding);
291 SetLayoutManager(layout); 291 SetLayoutManager(layout);
292 layout->set_minimum_cross_axis_size(kTrayPopupItemMinHeight); 292 layout->set_minimum_cross_axis_size(kTrayPopupItemMinHeight);
293 layout->set_cross_axis_alignment( 293 layout->set_cross_axis_alignment(
294 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); 294 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
295 295
296 set_background(views::Background::CreateSolidBackground(kBackgroundColor)); 296 set_background(views::Background::CreateThemedSolidBackground(
297 this, ui::NativeTheme::kColorId_BubbleBackground));
297 298
298 Shell::Get()->media_controller()->AddObserver(this); 299 Shell::Get()->media_controller()->AddObserver(this);
299 300
300 if (login_status == LoginStatus::PUBLIC) 301 if (login_status == LoginStatus::PUBLIC)
301 AddPublicModeUserContent(); 302 AddPublicModeUserContent();
302 else 303 else
303 AddUserContent(layout, login_status); 304 AddUserContent(layout, login_status);
304 } 305 }
305 306
306 UserCardView::~UserCardView() { 307 UserCardView::~UserCardView() {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 media_capture_container_ = new views::View(); 442 media_capture_container_ = new views::View();
442 media_capture_container_->SetLayoutManager(new views::FillLayout()); 443 media_capture_container_->SetLayoutManager(new views::FillLayout());
443 media_capture_container_->AddChildView(media_capture_icon_); 444 media_capture_container_->AddChildView(media_capture_icon_);
444 AddChildView(media_capture_container_); 445 AddChildView(media_capture_container_);
445 446
446 Shell::Get()->media_controller()->RequestCaptureState(); 447 Shell::Get()->media_controller()->RequestCaptureState();
447 } 448 }
448 449
449 } // namespace tray 450 } // namespace tray
450 } // namespace ash 451 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray_accessibility.cc ('k') | ash/system/user/user_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698