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

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

Issue 117263002: Prevent ONC-pushed certificates from being used with multiprofiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chrome_shell_delegate.h" 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
6 6
7 #include "apps/shell_window.h" 7 #include "apps/shell_window.h"
8 #include "apps/shell_window_registry.h" 8 #include "apps/shell_window_registry.h"
9 #include "ash/host/root_window_host_factory.h" 9 #include "ash/host/root_window_host_factory.h"
10 #include "ash/magnifier/magnifier_constants.h" 10 #include "ash/magnifier/magnifier_constants.h"
11 #include "ash/wm/window_state.h" 11 #include "ash/wm/window_state.h"
12 #include "ash/wm/window_util.h" 12 #include "ash/wm/window_util.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "chrome/browser/app_mode/app_mode_utils.h" 14 #include "chrome/browser/app_mode/app_mode_utils.h"
15 #include "chrome/browser/lifetime/application_lifetime.h" 15 #include "chrome/browser/lifetime/application_lifetime.h"
16 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/profiles/profile_manager.h" 17 #include "chrome/browser/profiles/profile_manager.h"
17 #include "chrome/browser/ui/app_list/app_list_service.h" 18 #include "chrome/browser/ui/app_list/app_list_service.h"
18 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" 19 #include "chrome/browser/ui/app_list/app_list_view_delegate.h"
19 #include "chrome/browser/ui/ash/app_list/app_list_controller_ash.h" 20 #include "chrome/browser/ui/ash/app_list/app_list_controller_ash.h"
20 #include "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h" 21 #include "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h"
21 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 22 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
22 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" 23 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h"
23 #include "chrome/browser/ui/ash/user_action_handler.h" 24 #include "chrome/browser/ui/ash/user_action_handler.h"
24 #include "chrome/browser/ui/browser_commands.h" 25 #include "chrome/browser/ui/browser_commands.h"
25 #include "chrome/common/chrome_switches.h" 26 #include "chrome/common/chrome_switches.h"
26 #include "grit/chromium_strings.h" 27 #include "grit/chromium_strings.h"
27 #include "grit/generated_resources.h" 28 #include "grit/generated_resources.h"
28 #include "ui/base/l10n/l10n_util.h" 29 #include "ui/base/l10n/l10n_util.h"
29 30
30 #if defined(OS_CHROMEOS) 31 #if defined(OS_CHROMEOS)
31 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 32 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
33 #include "chrome/browser/chromeos/login/user.h"
32 #include "chrome/browser/chromeos/login/user_manager.h" 34 #include "chrome/browser/chromeos/login/user_manager.h"
35 #include "chrome/browser/chromeos/policy/policy_cert_service.h"
36 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
33 #endif 37 #endif
34 38
35 // static 39 // static
36 ChromeShellDelegate* ChromeShellDelegate::instance_ = NULL; 40 ChromeShellDelegate* ChromeShellDelegate::instance_ = NULL;
37 41
38 ChromeShellDelegate::ChromeShellDelegate() 42 ChromeShellDelegate::ChromeShellDelegate()
39 : shelf_delegate_(NULL) { 43 : shelf_delegate_(NULL) {
40 instance_ = this; 44 instance_ = this;
41 PlatformInit(); 45 PlatformInit();
42 } 46 }
(...skipping 24 matching lines...) Expand all
67 // in. For special cases like Kiosk mode and / or guest mode this isn't a 71 // in. For special cases like Kiosk mode and / or guest mode this isn't a
68 // problem since either the browser gets restarted and / or the flag is not 72 // problem since either the browser gets restarted and / or the flag is not
69 // allowed, but for an "ephermal" user (see crbug.com/312324) it is not 73 // allowed, but for an "ephermal" user (see crbug.com/312324) it is not
70 // decided yet if he could add other users to his session or not. 74 // decided yet if he could add other users to his session or not.
71 // TODO(skuhne): As soon as the issue above needs to be resolved, this logic 75 // TODO(skuhne): As soon as the issue above needs to be resolved, this logic
72 // should change. 76 // should change.
73 logged_in_users = 1; 77 logged_in_users = 1;
74 } 78 }
75 if (admitted_users_to_be_added + logged_in_users <= 1) 79 if (admitted_users_to_be_added + logged_in_users <= 1)
76 return false; 80 return false;
81
82 chromeos::User* active = chromeos::UserManager::Get()->GetActiveUser();
83 Profile* profile = NULL;
84 policy::PolicyCertService* service = NULL;
85 if (active)
pneubeck (no reviews) 2013/12/17 15:25:31 are !active and !profile errors? DCHECK/LOG?
Joao da Silva 2013/12/17 16:36:41 !active means that no-one is signed in yet, so it'
86 profile = chromeos::UserManager::Get()->GetProfileByUser(active);
87 if (profile)
88 service = policy::PolicyCertServiceFactory::GetForProfile(profile);
89 if (service && service->IsTainted()) {
90 LOG(ERROR) << "Disabling multi-profiles because the current Profile is "
91 << "exposed to policy-pushed certificates.";
92 return false;
93 }
77 #endif 94 #endif
78 return true; 95 return true;
79 } 96 }
80 97
81 bool ChromeShellDelegate::IsIncognitoAllowed() const { 98 bool ChromeShellDelegate::IsIncognitoAllowed() const {
82 #if defined(OS_CHROMEOS) 99 #if defined(OS_CHROMEOS)
83 return chromeos::AccessibilityManager::Get()->IsIncognitoAllowed(); 100 return chromeos::AccessibilityManager::Get()->IsIncognitoAllowed();
84 #endif 101 #endif
85 return true; 102 return true;
86 } 103 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 159 }
143 160
144 base::string16 ChromeShellDelegate::GetProductName() const { 161 base::string16 ChromeShellDelegate::GetProductName() const {
145 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); 162 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
146 } 163 }
147 164
148 keyboard::KeyboardControllerProxy* 165 keyboard::KeyboardControllerProxy*
149 ChromeShellDelegate::CreateKeyboardControllerProxy() { 166 ChromeShellDelegate::CreateKeyboardControllerProxy() {
150 return new AshKeyboardControllerProxy(); 167 return new AshKeyboardControllerProxy();
151 } 168 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698