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

Unified Diff: goopdate/app_state.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « goopdate/app_manager_unittest.cc ('k') | goopdate/app_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: goopdate/app_state.h
diff --git a/goopdate/app_state.h b/goopdate/app_state.h
deleted file mode 100644
index 98820252a24a74f4eb3583eef8e1806cff96bf03..0000000000000000000000000000000000000000
--- a/goopdate/app_state.h
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright 2009-2010 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ========================================================================
-
-#ifndef OMAHA_GOOPDATE_APP_STATE_H_
-#define OMAHA_GOOPDATE_APP_STATE_H_
-
-#include <windows.h>
-#include <atlstr.h>
-#include "base/basictypes.h"
-#include "base/scoped_ptr.h"
-#include "omaha/common/const_goopdate.h"
-#include "omaha/common/ping_event.h"
-#include "omaha/goopdate/installer_result_info.h"
-#include "goopdate/omaha3_idl.h"
-
-namespace omaha {
-
-class App;
-struct ErrorContext;
-class DownloadManagerInterface;
-class InstallManagerInterface;
-
-namespace xml {
-
-class UpdateRequest;
-class UpdateResponse;
-
-} // namespace xml
-
-namespace fsm {
-
-// Defines the interface for encapsulating behavior associated with a particular
-// state of the App object.
-// All state transition calls should go through App, meaning it is the only
-// class that should use this interface.
-class AppState {
- public:
- virtual ~AppState() {}
-
- // Design note: avoid switch and conditional statements on CurrentState. They
- // break polymorphism and they are a poor substitute for RTTI.
- CurrentState state() const { return state_; }
-
- // Creates a ping event for the current state. The caller owns the returned
- // object.
- virtual const PingEvent* CreatePingEvent(App* app,
- CurrentState previous_state) const;
-
- virtual void QueueUpdateCheck(App* app);
-
- virtual void PreUpdateCheck(App* app, xml::UpdateRequest* update_request);
-
- virtual void PostUpdateCheck(App* app,
- HRESULT result,
- xml::UpdateResponse* update_response);
-
- virtual void QueueDownload(App* app);
-
- // Queues the download for a download and install operation.
- virtual void QueueDownloadOrInstall(App* app);
-
- virtual void Download(App* app, DownloadManagerInterface* download_manager);
-
- virtual void Downloading(App* app);
-
- virtual void DownloadComplete(App* app);
-
- virtual void MarkReadyToInstall(App* app);
-
- virtual void QueueInstall(App* app);
-
- virtual void Install(App* app, InstallManagerInterface* install_manager);
-
- virtual void Installing(App* app);
-
- virtual void ReportInstallerComplete(App* app,
- const InstallerResultInfo& result_info);
-
- virtual void Pause(App* app);
-
- virtual void Cancel(App* app);
-
- virtual void Error(App* app,
- const ErrorContext& error_context,
- const CString& message);
-
- protected:
- explicit AppState(CurrentState state) : state_(state) {}
-
- // After calling this method, the old state (this object) is deleted and the
- // code may not reference the members of the old state anymore.
- void ChangeState(App* app, AppState* app_state);
-
- void HandleInvalidStateTransition(App* app, const TCHAR* function_name);
-
- static PingEvent::Results GetCompletionResult(const App& app);
-
- private:
- // TODO(omaha): rename to CurrentStateId or similar.
- const CurrentState state_;
-
- DISALLOW_COPY_AND_ASSIGN(AppState);
-};
-
-} // namespace fsm
-
-} // namespace omaha
-
-#endif // OMAHA_GOOPDATE_APP_STATE_H_
« no previous file with comments | « goopdate/app_manager_unittest.cc ('k') | goopdate/app_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698