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