OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/ash/multi_user/multi_user_context_menu.h" | 5 #include "chrome/browser/ui/ash/multi_user/multi_user_context_menu.h" |
6 | 6 |
7 #include "ash/multi_profile_uma.h" | 7 #include "ash/multi_profile_uma.h" |
8 #include "ash/session/session_state_delegate.h" | 8 #include "ash/session/session_state_delegate.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 window_(window) { | 58 window_(window) { |
59 } | 59 } |
60 | 60 |
61 void MultiUserContextMenuChromeos::ExecuteCommand(int command_id, | 61 void MultiUserContextMenuChromeos::ExecuteCommand(int command_id, |
62 int event_flags) { | 62 int event_flags) { |
63 ExecuteVisitDesktopCommand(command_id, window_); | 63 ExecuteVisitDesktopCommand(command_id, window_); |
64 } | 64 } |
65 } // namespace | 65 } // namespace |
66 } // namespace chromeos | 66 } // namespace chromeos |
67 | 67 |
68 scoped_ptr<ui::MenuModel> CreateMultiUserContextMenu(aura::Window* window) { | 68 std::unique_ptr<ui::MenuModel> CreateMultiUserContextMenu( |
69 scoped_ptr<ui::MenuModel> model; | 69 aura::Window* window) { |
| 70 std::unique_ptr<ui::MenuModel> model; |
70 ash::SessionStateDelegate* delegate = | 71 ash::SessionStateDelegate* delegate = |
71 ash::Shell::GetInstance()->session_state_delegate(); | 72 ash::Shell::GetInstance()->session_state_delegate(); |
72 if (!delegate) | 73 if (!delegate) |
73 return model; | 74 return model; |
74 | 75 |
75 int logged_in_users = delegate->NumberOfLoggedInUsers(); | 76 int logged_in_users = delegate->NumberOfLoggedInUsers(); |
76 if (logged_in_users > 1) { | 77 if (logged_in_users > 1) { |
77 // If this window is not owned, we don't show the menu addition. | 78 // If this window is not owned, we don't show the menu addition. |
78 chrome::MultiUserWindowManager* manager = | 79 chrome::MultiUserWindowManager* manager = |
79 chrome::MultiUserWindowManager::GetInstance(); | 80 chrome::MultiUserWindowManager::GetInstance(); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 return; | 143 return; |
143 } | 144 } |
144 } | 145 } |
145 chromeos::ShowMultiprofilesWarningDialog(on_accept); | 146 chromeos::ShowMultiprofilesWarningDialog(on_accept); |
146 return; | 147 return; |
147 } | 148 } |
148 default: | 149 default: |
149 NOTREACHED(); | 150 NOTREACHED(); |
150 } | 151 } |
151 } | 152 } |
OLD | NEW |