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

Side by Side Diff: chrome/browser/extensions/api/principals_private/principals_private_api.cc

Issue 1806723003: [Extensions] Remove principalsPrivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extraneous mods Created 4 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/api/principals_private/principals_private_ap i.h"
6
7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/profiles/avatar_menu.h"
9 #include "chrome/browser/profiles/profile_window.h"
10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/browser_window.h"
12 #include "components/signin/core/browser/signin_header_helper.h"
13 #include "components/signin/core/browser/signin_metrics.h"
14 #include "components/signin/core/common/profile_management_switches.h"
15
16 namespace extensions {
17
18 bool PrincipalsPrivateExtensionFunction::RunSync() {
19 if (!switches::IsEnableAccountConsistency()) {
20 SetError(
21 "Need to enable account consistency to use principalsPrivate API.");
22 return false;
23 }
24 return RunSyncSafe();
25 }
26
27 bool PrincipalsPrivateSignOutFunction::RunSyncSafe() {
28 Browser* browser = GetCurrentBrowser();
29 if (browser) {
30 profiles::LockProfile(browser->profile());
31 }
32 return true;
33 }
34
35 bool PrincipalsPrivateShowAvatarBubbleFunction::RunSyncSafe() {
36 Browser* browser = GetCurrentBrowser();
37 if (browser) {
38 browser->window()->ShowAvatarBubbleFromAvatarButton(
39 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT,
40 signin::ManageAccountsParams(),
41 signin_metrics::AccessPoint::ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN);
42 }
43 return true;
44 }
45
46 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/principals_private/principals_private_api.h ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698