OLD | NEW |
---|---|
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/webui/help/version_updater_chromeos.h" | 5 #include "chrome/browser/ui/webui/help/version_updater_chromeos.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "chrome/browser/chromeos/cros_settings.h" | 11 #include "chrome/browser/chromeos/cros_settings.h" |
12 #include "chrome/browser/chromeos/cros_settings_names.h" | 12 #include "chrome/browser/chromeos/cros_settings_names.h" |
13 #include "chrome/browser/chromeos/login/user_manager.h" | 13 #include "chrome/browser/chromeos/login/user_manager.h" |
14 #include "chrome/browser/chromeos/login/wizard_controller.h" | 14 #include "chrome/browser/chromeos/login/wizard_controller.h" |
15 #include "chrome/browser/google/google_update.h" | |
16 #include "chromeos/dbus/dbus_thread_manager.h" | 15 #include "chromeos/dbus/dbus_thread_manager.h" |
17 #include "chromeos/dbus/power_manager_client.h" | 16 #include "chromeos/dbus/power_manager_client.h" |
18 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
19 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
20 | 19 |
21 using chromeos::CrosSettings; | 20 using chromeos::CrosSettings; |
22 using chromeos::DBusThreadManager; | 21 using chromeos::DBusThreadManager; |
23 using chromeos::UpdateEngineClient; | 22 using chromeos::UpdateEngineClient; |
24 using chromeos::UserManager; | 23 using chromeos::UserManager; |
25 using chromeos::WizardController; | 24 using chromeos::WizardController; |
26 | 25 |
26 // GOOGLE_UPDATE_ERROR_UPDATING from chrome/browser/google/google_update_win.h | |
27 #define GOOGLE_UPDATE_ERROR_UPDATING 7 | |
Daniel Erat
2012/07/13 19:45:54
nit: const int in an anon namespace instead of #de
| |
28 | |
27 VersionUpdater* VersionUpdater::Create() { | 29 VersionUpdater* VersionUpdater::Create() { |
28 return new VersionUpdaterCros; | 30 return new VersionUpdaterCros; |
29 } | 31 } |
30 | 32 |
31 void VersionUpdaterCros::CheckForUpdate(const StatusCallback& callback) { | 33 void VersionUpdaterCros::CheckForUpdate(const StatusCallback& callback) { |
32 callback_ = callback; | 34 callback_ = callback; |
33 | 35 |
34 UpdateEngineClient* update_engine_client = | 36 UpdateEngineClient* update_engine_client = |
35 DBusThreadManager::Get()->GetUpdateEngineClient(); | 37 DBusThreadManager::Get()->GetUpdateEngineClient(); |
36 update_engine_client->AddObserver(this); | 38 update_engine_client->AddObserver(this); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 UpdateEngineClient::UpdateCheckResult result) { | 137 UpdateEngineClient::UpdateCheckResult result) { |
136 // If version updating is not implemented, this binary is the most up-to-date | 138 // If version updating is not implemented, this binary is the most up-to-date |
137 // possible with respect to automatic updating. | 139 // possible with respect to automatic updating. |
138 if (result == UpdateEngineClient::UPDATE_RESULT_NOTIMPLEMENTED) | 140 if (result == UpdateEngineClient::UPDATE_RESULT_NOTIMPLEMENTED) |
139 callback_.Run(UPDATED, 0, string16()); | 141 callback_.Run(UPDATED, 0, string16()); |
140 } | 142 } |
141 | 143 |
142 void VersionUpdaterCros::UpdateSelectedChannel(const std::string& channel) { | 144 void VersionUpdaterCros::UpdateSelectedChannel(const std::string& channel) { |
143 channel_callback_.Run(channel); | 145 channel_callback_.Run(channel); |
144 } | 146 } |
OLD | NEW |