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

Side by Side Diff: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc

Issue 93633007: Created optional multiprofiles introduction dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 6 years, 11 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/system_tray_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 #include "chrome/browser/chromeos/login/login_display_host.h" 58 #include "chrome/browser/chromeos/login/login_display_host.h"
59 #include "chrome/browser/chromeos/login/login_display_host_impl.h" 59 #include "chrome/browser/chromeos/login/login_display_host_impl.h"
60 #include "chrome/browser/chromeos/login/login_wizard.h" 60 #include "chrome/browser/chromeos/login/login_wizard.h"
61 #include "chrome/browser/chromeos/login/startup_utils.h" 61 #include "chrome/browser/chromeos/login/startup_utils.h"
62 #include "chrome/browser/chromeos/login/supervised_user_manager.h" 62 #include "chrome/browser/chromeos/login/supervised_user_manager.h"
63 #include "chrome/browser/chromeos/login/user.h" 63 #include "chrome/browser/chromeos/login/user.h"
64 #include "chrome/browser/chromeos/login/user_adding_screen.h" 64 #include "chrome/browser/chromeos/login/user_adding_screen.h"
65 #include "chrome/browser/chromeos/login/user_manager.h" 65 #include "chrome/browser/chromeos/login/user_manager.h"
66 #include "chrome/browser/chromeos/options/network_config_view.h" 66 #include "chrome/browser/chromeos/options/network_config_view.h"
67 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" 67 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
68 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h"
68 #include "chrome/browser/chromeos/settings/cros_settings.h" 69 #include "chrome/browser/chromeos/settings/cros_settings.h"
69 #include "chrome/browser/chromeos/sim_dialog_delegate.h" 70 #include "chrome/browser/chromeos/sim_dialog_delegate.h"
70 #include "chrome/browser/chromeos/system_key_event_listener.h" 71 #include "chrome/browser/chromeos/system_key_event_listener.h"
71 #include "chrome/browser/drive/drive_service_interface.h" 72 #include "chrome/browser/drive/drive_service_interface.h"
72 #include "chrome/browser/feedback/tracing_manager.h" 73 #include "chrome/browser/feedback/tracing_manager.h"
73 #include "chrome/browser/google/google_util.h" 74 #include "chrome/browser/google/google_util.h"
74 #include "chrome/browser/lifetime/application_lifetime.h" 75 #include "chrome/browser/lifetime/application_lifetime.h"
75 #include "chrome/browser/policy/browser_policy_connector.h" 76 #include "chrome/browser/policy/browser_policy_connector.h"
76 #include "chrome/browser/profiles/profile_manager.h" 77 #include "chrome/browser/profiles/profile_manager.h"
77 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" 78 #include "chrome/browser/ui/ash/volume_controller_chromeos.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 void ShowNetworkSettingsPage(const std::string& service_path) { 232 void ShowNetworkSettingsPage(const std::string& service_path) {
232 std::string page = chrome::kInternetOptionsSubPage; 233 std::string page = chrome::kInternetOptionsSubPage;
233 page += "?servicePath=" + net::EscapeUrlEncodedData(service_path, true); 234 page += "?servicePath=" + net::EscapeUrlEncodedData(service_path, true);
234 content::RecordAction( 235 content::RecordAction(
235 base::UserMetricsAction("OpenInternetOptionsDialog")); 236 base::UserMetricsAction("OpenInternetOptionsDialog"));
236 ShowSettingsSubPageForAppropriateBrowser( 237 ShowSettingsSubPageForAppropriateBrowser(
237 page, 238 page,
238 ProfileManager::GetPrimaryUserProfile()); 239 ProfileManager::GetPrimaryUserProfile());
239 } 240 }
240 241
242 void onAcceptMultiprofilesIntro(bool no_show_again) {
Nikita (slow) 2014/01/14 13:44:11 nit: Capitalize.
merkulova 2014/01/14 14:29:34 Done.
243 PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs();
244 prefs->SetBoolean(prefs::kMultiProfileNeverShowIntro, no_show_again);
245 UserAddingScreen::Get()->Start();
246 }
247
241 class SystemTrayDelegate : public ash::SystemTrayDelegate, 248 class SystemTrayDelegate : public ash::SystemTrayDelegate,
242 public SessionManagerClient::Observer, 249 public SessionManagerClient::Observer,
243 public drive::JobListObserver, 250 public drive::JobListObserver,
244 public content::NotificationObserver, 251 public content::NotificationObserver,
245 public input_method::InputMethodManager::Observer, 252 public input_method::InputMethodManager::Observer,
246 public chromeos::LoginState::Observer, 253 public chromeos::LoginState::Observer,
247 public device::BluetoothAdapter::Observer, 254 public device::BluetoothAdapter::Observer,
248 public SystemKeyEventListener::CapsLockObserver, 255 public SystemKeyEventListener::CapsLockObserver,
249 public policy::CloudPolicyStore::Observer, 256 public policy::CloudPolicyStore::Observer,
250 public ash::SessionStateObserver { 257 public ash::SessionStateObserver {
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 if (UserManager::Get()->GetActiveUser()->GetType() != 629 if (UserManager::Get()->GetActiveUser()->GetType() !=
623 User::USER_TYPE_REGULAR) { 630 User::USER_TYPE_REGULAR) {
624 return; 631 return;
625 } 632 }
626 633
627 if (static_cast<int>(UserManager::Get()->GetLoggedInUsers().size()) >= 634 if (static_cast<int>(UserManager::Get()->GetLoggedInUsers().size()) >=
628 shell->session_state_delegate()->GetMaximumNumberOfLoggedInUsers()) 635 shell->session_state_delegate()->GetMaximumNumberOfLoggedInUsers())
629 return; 636 return;
630 637
631 // Launch sign in screen to add another user to current session. 638 // Launch sign in screen to add another user to current session.
632 if (UserManager::Get()->GetUsersAdmittedForMultiProfile().size()) 639 if (UserManager::Get()->GetUsersAdmittedForMultiProfile().size()) {
633 UserAddingScreen::Get()->Start(); 640 bool show_intro = !ProfileManager::GetActiveUserProfile()->
641 GetPrefs()->GetBoolean(prefs::kMultiProfileNeverShowIntro);
642 base::Callback<void(bool)> on_accept = base::Bind(
Nikita (slow) 2014/01/14 13:44:11 nit: Move base::Bind( to next line so that whole c
merkulova 2014/01/14 14:29:34 Done.
643 &onAcceptMultiprofilesIntro);
644 if (show_intro)
645 ShowMultiprofilesIntroDialog(on_accept);
646 else
647 UserAddingScreen::Get()->Start();
648 }
634 } 649 }
635 650
636 virtual void ShowSpringChargerReplacementDialog() OVERRIDE { 651 virtual void ShowSpringChargerReplacementDialog() OVERRIDE {
637 if (!ChargerReplacementDialog::ShouldShowDialog()) 652 if (!ChargerReplacementDialog::ShouldShowDialog())
638 return; 653 return;
639 654
640 ChargerReplacementDialog* dialog = 655 ChargerReplacementDialog* dialog =
641 new ChargerReplacementDialog(GetNativeWindow()); 656 new ChargerReplacementDialog(GetNativeWindow());
642 dialog->Show(); 657 dialog->Show();
643 } 658 }
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); 1313 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate);
1299 }; 1314 };
1300 1315
1301 } // namespace 1316 } // namespace
1302 1317
1303 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1318 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1304 return new chromeos::SystemTrayDelegate(); 1319 return new chromeos::SystemTrayDelegate();
1305 } 1320 }
1306 1321
1307 } // namespace chromeos 1322 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698