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

Side by Side Diff: ash/common/system/user/user_card_view.h

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 years, 9 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/common/system/user/tray_user_unittest.cc ('k') | ash/common/system/user/user_card_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef ASH_COMMON_SYSTEM_USER_USER_CARD_VIEW_H_
6 #define ASH_COMMON_SYSTEM_USER_USER_CARD_VIEW_H_
7
8 #include "ash/common/media_controller.h"
9 #include "base/macros.h"
10 #include "ui/views/view.h"
11
12 namespace views {
13 class BoxLayout;
14 class ImageView;
15 class Label;
16 }
17
18 namespace ash {
19
20 enum class LoginStatus;
21
22 namespace tray {
23
24 // The view displaying information about the user, such as user's avatar, email
25 // address, name, and more. View has no borders.
26 class UserCardView : public views::View, public MediaCaptureObserver {
27 public:
28 // |max_width| takes effect only if |login_status| is LOGGED_IN_PUBLIC.
29 UserCardView(LoginStatus login_status, int max_width, int user_index);
30 ~UserCardView() override;
31
32 // View:
33 void PaintChildren(const ui::PaintContext& context) override;
34 void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
35
36 // MediaCaptureObserver:
37 void OnMediaCaptureChanged(
38 const std::vector<mojom::MediaCaptureState>& capture_states) override;
39
40 private:
41 // Creates the content for the public mode.
42 void AddPublicModeUserContent(int max_width);
43
44 void AddUserContent(views::BoxLayout* layout, LoginStatus login_status);
45
46 bool is_active_user() const { return !user_index_; }
47
48 int user_index_;
49
50 views::Label* user_name_;
51 views::Label* media_capture_label_;
52 views::ImageView* media_capture_icon_;
53
54 DISALLOW_COPY_AND_ASSIGN(UserCardView);
55 };
56
57 } // namespace tray
58 } // namespace ash
59
60 #endif // ASH_COMMON_SYSTEM_USER_USER_CARD_VIEW_H_
OLDNEW
« no previous file with comments | « ash/common/system/user/tray_user_unittest.cc ('k') | ash/common/system/user/user_card_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698