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

Side by Side Diff: goopdate/app_state_installing.cc

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « goopdate/app_state_installing.h ('k') | goopdate/app_state_no_update.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2009 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 // ========================================================================
15
16 #include "omaha/goopdate/app_state_installing.h"
17 #include "omaha/base/debug.h"
18 #include "omaha/base/logging.h"
19 #include "omaha/goopdate/app_state_error.h"
20 #include "omaha/goopdate/app_state_install_complete.h"
21 #include "omaha/goopdate/model.h"
22
23 namespace omaha {
24
25 namespace fsm {
26
27 AppStateInstalling::AppStateInstalling()
28 : AppState(STATE_INSTALLING) {
29 }
30
31 const PingEvent* AppStateInstalling::CreatePingEvent(
32 App* app,
33 CurrentState previous_state) const {
34 ASSERT1(app);
35 UNREFERENCED_PARAMETER(previous_state);
36
37 const PingEvent::Types event_type(app->is_update() ?
38 PingEvent::EVENT_UPDATE_INSTALLER_START :
39 PingEvent::EVENT_INSTALL_INSTALLER_START);
40
41
42 const HRESULT error_code = app->error_code();
43 ASSERT1(SUCCEEDED(error_code));
44
45 return new PingEvent(event_type, GetCompletionResult(*app), error_code, 0);
46 }
47
48 // The state does not change if already in the Installing state.
49 void AppStateInstalling::Installing(App* app) {
50 CORE_LOG(L3, (_T("[AppStateInstalling::Installing][0x%p]"), app));
51 ASSERT1(app);
52 ASSERT(false, (_T("This might be valid when we support install progress.")));
53
54 UNREFERENCED_PARAMETER(app);
55 }
56
57 void AppStateInstalling::ReportInstallerComplete(
58 App* app,
59 const InstallerResultInfo& result_info) {
60 CORE_LOG(L3, (_T("[AppStateInstalling::ReportInstallerComplete][%p]"), app));
61 ASSERT1(app);
62
63 app->SetInstallerResult(result_info);
64
65 ChangeState(app, result_info.type == INSTALLER_RESULT_SUCCESS ?
66 static_cast<AppState*>(new AppStateInstallComplete(app)) :
67 static_cast<AppState*>(new AppStateError));
68 }
69
70 // Cancel in installing state has no effect because currently we cannot cancel
71 // installers.. Override the function to avoid moving app into error state.
72 // The app will automatically enter the completion state when the installer
73 // completes.
74 void AppStateInstalling::Cancel(App* app) {
75 CORE_LOG(L3, (_T("[AppStateInstalling::Cancel][0x%p]"), app));
76 ASSERT1(app);
77
78 UNREFERENCED_PARAMETER(app);
79 }
80
81 } // namespace fsm
82
83 } // namespace omaha
OLDNEW
« no previous file with comments | « goopdate/app_state_installing.h ('k') | goopdate/app_state_no_update.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698