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

Side by Side Diff: ash/system/user/tray_user.h

Issue 184113005: Removal of drag window to user tray icon functionality (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
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 #ifndef ASH_SYSTEM_USER_TRAY_USER_H_ 5 #ifndef ASH_SYSTEM_USER_TRAY_USER_H_
6 #define ASH_SYSTEM_USER_TRAY_USER_H_ 6 #define ASH_SYSTEM_USER_TRAY_USER_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/session_state_delegate.h" 9 #include "ash/session_state_delegate.h"
10 #include "ash/system/tray/system_tray_item.h" 10 #include "ash/system/tray/system_tray_item.h"
11 #include "ash/system/user/user_observer.h" 11 #include "ash/system/user/user_observer.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 13
14 namespace gfx { 14 namespace gfx {
15 class Rect; 15 class Rect;
16 class Point; 16 class Point;
oshima 2014/02/28 23:29:33 this is no longer used?
Mr4D (OOO till 08-26) 2014/03/01 17:21:34 Done.
17 } 17 }
18 18
19 namespace views { 19 namespace views {
20 class ImageView; 20 class ImageView;
21 class Label; 21 class Label;
22 } 22 }
23 23
24 namespace ash { 24 namespace ash {
25 namespace internal { 25 namespace internal {
26 26
(...skipping 15 matching lines...) Expand all
42 // Allows unit tests to see if the item was created. 42 // Allows unit tests to see if the item was created.
43 enum TestState { 43 enum TestState {
44 HIDDEN, // The item is hidden. 44 HIDDEN, // The item is hidden.
45 SHOWN, // The item gets presented to the user. 45 SHOWN, // The item gets presented to the user.
46 HOVERED, // The item is hovered and presented to the user. 46 HOVERED, // The item is hovered and presented to the user.
47 ACTIVE, // The item was clicked and can add a user. 47 ACTIVE, // The item was clicked and can add a user.
48 ACTIVE_BUT_DISABLED // The item was clicked anc cannot add a user. 48 ACTIVE_BUT_DISABLED // The item was clicked anc cannot add a user.
49 }; 49 };
50 TestState GetStateForTest() const; 50 TestState GetStateForTest() const;
51 51
52 // Checks if a drag and drop operation would be able to land a window on this
53 // |point_in_screen|.
54 bool CanDropWindowHereToTransferToUser(const gfx::Point& point_in_screen);
55
56 // Try to re-parent the |window| to a new owner. Returns true if the window
57 // got transfered.
58 bool TransferWindowToUser(aura::Window* window);
59
60 // Returns the bounds of the user panel in screen coordinates. 52 // Returns the bounds of the user panel in screen coordinates.
61 // Note: This only works when the panel shown. 53 // Note: This only works when the panel shown.
62 gfx::Rect GetUserPanelBoundsInScreenForTest() const; 54 gfx::Rect GetUserPanelBoundsInScreenForTest() const;
63 55
64 private: 56 private:
65 // Overridden from SystemTrayItem. 57 // Overridden from SystemTrayItem.
66 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; 58 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE;
67 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; 59 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
68 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; 60 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
69 virtual void DestroyTrayView() OVERRIDE; 61 virtual void DestroyTrayView() OVERRIDE;
70 virtual void DestroyDefaultView() OVERRIDE; 62 virtual void DestroyDefaultView() OVERRIDE;
71 virtual void DestroyDetailedView() OVERRIDE; 63 virtual void DestroyDetailedView() OVERRIDE;
72 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; 64 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE;
73 virtual void UpdateAfterShelfAlignmentChange( 65 virtual void UpdateAfterShelfAlignmentChange(
74 ShelfAlignment alignment) OVERRIDE; 66 ShelfAlignment alignment) OVERRIDE;
75 67
76 // Overridden from UserObserver. 68 // Overridden from UserObserver.
77 virtual void OnUserUpdate() OVERRIDE; 69 virtual void OnUserUpdate() OVERRIDE;
78 virtual void OnUserAddedToSession() OVERRIDE; 70 virtual void OnUserAddedToSession() OVERRIDE;
79 71
80 void UpdateAvatarImage(user::LoginStatus status); 72 void UpdateAvatarImage(user::LoginStatus status);
81 73
82 // Get the user index which should be used for the tray icon of this item. 74 // Get the user index which should be used for the tray icon of this item.
83 MultiProfileIndex GetTrayIndex(); 75 MultiProfileIndex GetTrayIndex();
84 76
85 // Return the radius for the tray item to use.
86 int GetTrayItemRadius();
87
88 // Updates the layout of this item. 77 // Updates the layout of this item.
89 void UpdateLayoutOfItem(); 78 void UpdateLayoutOfItem();
90 79
91 // The user index to use. 80 // The user index to use.
92 MultiProfileIndex multiprofile_index_; 81 MultiProfileIndex multiprofile_index_;
93 82
94 tray::UserView* user_; 83 tray::UserView* user_;
95 84
96 // View that contains label and/or avatar. 85 // View that contains label and/or avatar.
97 views::View* layout_view_; 86 views::View* layout_view_;
98 tray::RoundedImageView* avatar_; 87 tray::RoundedImageView* avatar_;
99 views::Label* label_; 88 views::Label* label_;
100 89
101 DISALLOW_COPY_AND_ASSIGN(TrayUser); 90 DISALLOW_COPY_AND_ASSIGN(TrayUser);
102 }; 91 };
103 92
104 } // namespace internal 93 } // namespace internal
105 } // namespace ash 94 } // namespace ash
106 95
107 #endif // ASH_SYSTEM_USER_TRAY_USER_H_ 96 #endif // ASH_SYSTEM_USER_TRAY_USER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698