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

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: Non POD variables are not allowed to be set as static. 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"
78 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
77 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" 79 #include "chrome/browser/ui/ash/volume_controller_chromeos.h"
78 #include "chrome/browser/ui/browser.h" 80 #include "chrome/browser/ui/browser.h"
79 #include "chrome/browser/ui/browser_finder.h" 81 #include "chrome/browser/ui/browser_finder.h"
80 #include "chrome/browser/ui/chrome_pages.h" 82 #include "chrome/browser/ui/chrome_pages.h"
81 #include "chrome/browser/ui/host_desktop.h" 83 #include "chrome/browser/ui/host_desktop.h"
82 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" 84 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
83 #include "chrome/browser/ui/singleton_tabs.h" 85 #include "chrome/browser/ui/singleton_tabs.h"
84 #include "chrome/browser/ui/tabs/tab_strip_model.h" 86 #include "chrome/browser/ui/tabs/tab_strip_model.h"
85 #include "chrome/browser/ui/webui/chromeos/charger_replacement_handler.h" 87 #include "chrome/browser/ui/webui/chromeos/charger_replacement_handler.h"
86 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" 88 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 void ShowNetworkSettingsPage(const std::string& service_path) { 233 void ShowNetworkSettingsPage(const std::string& service_path) {
232 std::string page = chrome::kInternetOptionsSubPage; 234 std::string page = chrome::kInternetOptionsSubPage;
233 page += "?servicePath=" + net::EscapeUrlEncodedData(service_path, true); 235 page += "?servicePath=" + net::EscapeUrlEncodedData(service_path, true);
234 content::RecordAction( 236 content::RecordAction(
235 base::UserMetricsAction("OpenInternetOptionsDialog")); 237 base::UserMetricsAction("OpenInternetOptionsDialog"));
236 ShowSettingsSubPageForAppropriateBrowser( 238 ShowSettingsSubPageForAppropriateBrowser(
237 page, 239 page,
238 ProfileManager::GetPrimaryUserProfile()); 240 ProfileManager::GetPrimaryUserProfile());
239 } 241 }
240 242
243 void OnAcceptMultiprofilesIntro(bool no_show_again) {
244 PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs();
245 prefs->SetBoolean(prefs::kMultiProfileNeverShowIntro, no_show_again);
246 UserAddingScreen::Get()->Start();
247 }
248
241 class SystemTrayDelegate : public ash::SystemTrayDelegate, 249 class SystemTrayDelegate : public ash::SystemTrayDelegate,
242 public SessionManagerClient::Observer, 250 public SessionManagerClient::Observer,
243 public drive::JobListObserver, 251 public drive::JobListObserver,
244 public content::NotificationObserver, 252 public content::NotificationObserver,
245 public input_method::InputMethodManager::Observer, 253 public input_method::InputMethodManager::Observer,
246 public chromeos::LoginState::Observer, 254 public chromeos::LoginState::Observer,
247 public device::BluetoothAdapter::Observer, 255 public device::BluetoothAdapter::Observer,
248 public SystemKeyEventListener::CapsLockObserver, 256 public SystemKeyEventListener::CapsLockObserver,
249 public policy::CloudPolicyStore::Observer, 257 public policy::CloudPolicyStore::Observer,
250 public ash::SessionStateObserver { 258 public ash::SessionStateObserver {
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 if (UserManager::Get()->GetActiveUser()->GetType() != 630 if (UserManager::Get()->GetActiveUser()->GetType() !=
623 User::USER_TYPE_REGULAR) { 631 User::USER_TYPE_REGULAR) {
624 return; 632 return;
625 } 633 }
626 634
627 if (static_cast<int>(UserManager::Get()->GetLoggedInUsers().size()) >= 635 if (static_cast<int>(UserManager::Get()->GetLoggedInUsers().size()) >=
628 shell->session_state_delegate()->GetMaximumNumberOfLoggedInUsers()) 636 shell->session_state_delegate()->GetMaximumNumberOfLoggedInUsers())
629 return; 637 return;
630 638
631 // Launch sign in screen to add another user to current session. 639 // Launch sign in screen to add another user to current session.
632 if (UserManager::Get()->GetUsersAdmittedForMultiProfile().size()) 640 if (UserManager::Get()->GetUsersAdmittedForMultiProfile().size()) {
633 UserAddingScreen::Get()->Start(); 641 // Don't show dialog if any logged in user in multi-profiles session
642 // dismissed it.
643 bool show_intro = true;
644 const UserList logged_in_users = UserManager::Get()->GetLoggedInUsers();
645 for (UserList::const_iterator it = logged_in_users.begin();
646 it != logged_in_users.end(); ++it) {
647 show_intro &= !multi_user_util::GetProfileFromUserID(
648 multi_user_util::GetUserIDFromEmail((*it)->email()))->GetPrefs()->
649 GetBoolean(prefs::kMultiProfileNeverShowIntro);
650 if (!show_intro)
651 break;
652 }
653 if (show_intro) {
654 base::Callback<void(bool)> on_accept =
655 base::Bind(&OnAcceptMultiprofilesIntro);
656 ShowMultiprofilesIntroDialog(on_accept);
657 } else {
658 UserAddingScreen::Get()->Start();
659 }
660 }
634 } 661 }
635 662
636 virtual void ShowSpringChargerReplacementDialog() OVERRIDE { 663 virtual void ShowSpringChargerReplacementDialog() OVERRIDE {
637 if (!ChargerReplacementDialog::ShouldShowDialog()) 664 if (!ChargerReplacementDialog::ShouldShowDialog())
638 return; 665 return;
639 666
640 ChargerReplacementDialog* dialog = 667 ChargerReplacementDialog* dialog =
641 new ChargerReplacementDialog(GetNativeWindow()); 668 new ChargerReplacementDialog(GetNativeWindow());
642 dialog->Show(); 669 dialog->Show();
643 } 670 }
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); 1325 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate);
1299 }; 1326 };
1300 1327
1301 } // namespace 1328 } // namespace
1302 1329
1303 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1330 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1304 return new chromeos::SystemTrayDelegate(); 1331 return new chromeos::SystemTrayDelegate();
1305 } 1332 }
1306 1333
1307 } // namespace chromeos 1334 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.cc ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698