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

Side by Side Diff: chrome/browser/component_updater/pnacl/pnacl_profile_observer.cc

Issue 13071002: Turn on component updater on chromeos, only for the pnacl component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: check if logged in first to not waste early ping on the OTR profile Created 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 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/component_updater/pnacl/pnacl_profile_observer.h"
6
7 #include "base/logging.h"
8 #include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h"
9 #include "chrome/common/chrome_notification_types.h"
10 #include "content/public/browser/notification_service.h"
11
12 PnaclProfileObserver::PnaclProfileObserver(
13 PnaclComponentInstaller* installer) : pnacl_installer_(installer) {
14 // We only need to observe NOTIFICATION_LOGIN_USER_CHANGED for ChromeOS
15 // (and it's only defined for ChromeOS).
16 #if defined(OS_CHROMEOS)
17 registrar_.Add(this,
18 chrome::NOTIFICATION_LOGIN_USER_CHANGED,
19 content::NotificationService::AllSources());
20 #endif
21 }
22
23 PnaclProfileObserver::~PnaclProfileObserver() { }
24
25 void PnaclProfileObserver::Observe(
26 int type,
27 const content::NotificationSource& source,
28 const content::NotificationDetails& details) {
29 #if defined(OS_CHROMEOS)
30 if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED) {
31 pnacl_installer_->ReRegisterPnacl();
32 return;
33 }
34 #endif
35 NOTREACHED() << "Unexpected notification observed";
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698