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

Side by Side Diff: chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698