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

Side by Side Diff: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc

Issue 2046783002: Allow deletion of profiles in the old user manager when all profiles are locked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/webui/signin/user_manager_screen_handler.h" 5 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "chrome/browser/ui/user_manager.h" 42 #include "chrome/browser/ui/user_manager.h"
43 #include "chrome/browser/ui/webui/profile_helper.h" 43 #include "chrome/browser/ui/webui/profile_helper.h"
44 #include "chrome/common/pref_names.h" 44 #include "chrome/common/pref_names.h"
45 #include "chrome/common/url_constants.h" 45 #include "chrome/common/url_constants.h"
46 #include "chrome/grit/chromium_strings.h" 46 #include "chrome/grit/chromium_strings.h"
47 #include "chrome/grit/generated_resources.h" 47 #include "chrome/grit/generated_resources.h"
48 #include "chrome/grit/google_chrome_strings.h" 48 #include "chrome/grit/google_chrome_strings.h"
49 #include "components/prefs/pref_service.h" 49 #include "components/prefs/pref_service.h"
50 #include "components/proximity_auth/screenlock_bridge.h" 50 #include "components/proximity_auth/screenlock_bridge.h"
51 #include "components/signin/core/account_id/account_id.h" 51 #include "components/signin/core/account_id/account_id.h"
52 #include "components/signin/core/common/profile_management_switches.h"
52 #include "content/public/browser/notification_service.h" 53 #include "content/public/browser/notification_service.h"
53 #include "content/public/browser/storage_partition.h" 54 #include "content/public/browser/storage_partition.h"
54 #include "content/public/browser/web_contents.h" 55 #include "content/public/browser/web_contents.h"
55 #include "content/public/browser/web_ui.h" 56 #include "content/public/browser/web_ui.h"
56 #include "google_apis/gaia/gaia_auth_fetcher.h" 57 #include "google_apis/gaia/gaia_auth_fetcher.h"
57 #include "google_apis/gaia/gaia_constants.h" 58 #include "google_apis/gaia/gaia_constants.h"
58 #include "grit/components_strings.h" 59 #include "grit/components_strings.h"
59 #include "third_party/skia/include/core/SkBitmap.h" 60 #include "third_party/skia/include/core/SkBitmap.h"
60 #include "ui/base/l10n/l10n_util.h" 61 #include "ui/base/l10n/l10n_util.h"
61 #include "ui/base/resource/resource_bundle.h" 62 #include "ui/base/resource/resource_bundle.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 } 463 }
463 464
464 base::FilePath profile_path; 465 base::FilePath profile_path;
465 if (!base::GetValueAsFilePath(*profile_path_value, &profile_path)) { 466 if (!base::GetValueAsFilePath(*profile_path_value, &profile_path)) {
466 NOTREACHED(); 467 NOTREACHED();
467 return; 468 return;
468 } 469 }
469 470
470 DCHECK(profiles::IsMultipleProfilesEnabled()); 471 DCHECK(profiles::IsMultipleProfilesEnabled());
471 472
472 if (profiles::AreAllProfilesLocked()) { 473 if (switches::IsMaterialDesignUserManager() &&
474 profiles::AreAllProfilesLocked()) {
473 web_ui()->CallJavascriptFunctionUnsafe( 475 web_ui()->CallJavascriptFunctionUnsafe(
474 "cr.webUIListenerCallback", base::StringValue("show-error-dialog"), 476 "cr.webUIListenerCallback",
477 base::StringValue("show-error-dialog"),
475 base::StringValue(l10n_util::GetStringUTF8( 478 base::StringValue(l10n_util::GetStringUTF8(
476 IDS_USER_MANAGER_REMOVE_PROFILE_PROFILES_LOCKED_ERROR))); 479 IDS_USER_MANAGER_REMOVE_PROFILE_PROFILES_LOCKED_ERROR)));
477 return; 480 return;
478 } 481 }
479 482
480 // The callback is run if the only profile has been deleted, and a new 483 // The callback is run if the only profile has been deleted, and a new
481 // profile has been created to replace it. 484 // profile has been created to replace it.
482 webui::DeleteProfileAtPath(profile_path, 485 webui::DeleteProfileAtPath(profile_path,
483 web_ui(), 486 web_ui(),
484 ProfileMetrics::DELETE_PROFILE_USER_MANAGER); 487 ProfileMetrics::DELETE_PROFILE_USER_MANAGER);
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 Profile* profile, Profile::CreateStatus profile_create_status) { 1016 Profile* profile, Profile::CreateStatus profile_create_status) {
1014 Browser* browser = chrome::FindAnyBrowser(profile, false); 1017 Browser* browser = chrome::FindAnyBrowser(profile, false);
1015 if (browser && browser->window()) { 1018 if (browser && browser->window()) {
1016 OnBrowserWindowReady(browser); 1019 OnBrowserWindowReady(browser);
1017 } else { 1020 } else {
1018 registrar_.Add(this, 1021 registrar_.Add(this,
1019 chrome::NOTIFICATION_BROWSER_WINDOW_READY, 1022 chrome::NOTIFICATION_BROWSER_WINDOW_READY,
1020 content::NotificationService::AllSources()); 1023 content::NotificationService::AllSources());
1021 } 1024 }
1022 } 1025 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698