| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2010 The Chromium OS 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. |
| 4 |
| 5 #ifndef SRC_POLICY_H_ |
| 6 #define SRC_POLICY_H_ |
| 7 |
| 8 #include <glib.h> |
| 9 |
| 10 #include <string> |
| 11 |
| 12 #include "src/data_plan.h" |
| 13 |
| 14 namespace cashew { |
| 15 |
| 16 // interface for carrier policy |
| 17 class Policy { |
| 18 public: |
| 19 virtual ~Policy() {} |
| 20 |
| 21 // what carrier is associated with this policy? |
| 22 virtual const std::string& GetCarrier() const = 0; |
| 23 |
| 24 // how often should a service request updates via the carrier usage API? |
| 25 // return value is in seconds |
| 26 virtual guint GetUpdateTimerIdleSecs(const DataPlanList& plans) const = 0; |
| 27 |
| 28 // should we emit a data plans update for the change from |old_plans| |
| 29 // to |new_plans|? |
| 30 // NOTE: user might also want to influence this from the Chrome side |
| 31 virtual bool ShouldEmitDataPlansUpdate(const DataPlanList& old_plans, |
| 32 const DataPlanList& new_plans) const = 0; |
| 33 |
| 34 // factory |
| 35 // return appropriate concrete impl for |carrier| |
| 36 // caller owns returned Policy and is responsible for deleting it |
| 37 static Policy* GetPolicy(const std::string& carrier); |
| 38 }; |
| 39 |
| 40 } // namespace cashew |
| 41 |
| 42 #endif // SRC_POLICY_H_ |
| OLD | NEW |