| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_DEFAULT_APP_ORDER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_DEFAULT_APP_ORDER_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 #include "base/synchronization/waitable_event.h" |
| 13 |
| 14 namespace chromeos { |
| 15 namespace default_app_order { |
| 16 |
| 17 // ExternalLoader checks FILE_DEFAULT_APP_ORDER and loads it if the file |
| 18 // exists. Otherwise, it uses the default built-in order. The file loading runs |
| 19 // asynchronously on start up except for the browser restart path, in which |
| 20 // case, start up will wait for the file check to finish because user profile |
| 21 // might need to access the ordinals data. |
| 22 class ExternalLoader { |
| 23 public: |
| 24 ExternalLoader(); |
| 25 ~ExternalLoader(); |
| 26 |
| 27 bool IsLoaded(); |
| 28 void WaitForLoad(); |
| 29 |
| 30 const std::vector<std::string>& app_ids() const { return app_ids_; } |
| 31 |
| 32 private: |
| 33 void LoadOnBlockingPool(); |
| 34 |
| 35 // A vector of app id strings that defines the default order of apps. |
| 36 std::vector<std::string> app_ids_; |
| 37 |
| 38 base::WaitableEvent loaded_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(ExternalLoader); |
| 41 }; |
| 42 |
| 43 // Gets the ordered list of app ids. |
| 44 void Get(std::vector<std::string>* app_ids); |
| 45 |
| 46 } // namespace default_app_order |
| 47 } // namespace chromeos |
| 48 |
| 49 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_DEFAULT_APP_ORDER_H_ |
| OLD | NEW |