1 // Copyright 2014 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.
5 #include "chrome/browser/google/did_run_updater_win.h"
7 #include "base/base_paths.h"
8 #include "base/files/file_path.h"
9 #include "base/path_service.h"
10 #include "chrome/installer/util/google_update_settings.h"
11 #include "chrome/installer/util/install_util.h"
12 #include "content/public/browser/notification_details.h"
13 #include "content/public/browser/notification_service.h"
14 #include "content/public/browser/notification_source.h"
15 #include "content/public/browser/notification_types.h"
17 DidRunUpdater::DidRunUpdater() : system_level_(false) {
18 base::FilePath exe_path
;
19 if (PathService::Get(base::FILE_EXE
, &exe_path
))
20 system_level_
= !InstallUtil::IsPerUserInstall(exe_path
);
22 registrar_
.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED
,
23 content::NotificationService::AllSources());
26 DidRunUpdater::~DidRunUpdater() {
29 void DidRunUpdater::Observe(int type
,
30 const content::NotificationSource
& source
,
31 const content::NotificationDetails
& details
) {
32 GoogleUpdateSettings::UpdateDidRunState(true, system_level_
);