| 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/chromeos/extensions/default_app_order.h" | 5 #include "chrome/browser/chromeos/extensions/default_app_order.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 | 98 |
| 99 ExternalLoader::~ExternalLoader() { | 99 ExternalLoader::~ExternalLoader() { |
| 100 DCHECK(loaded_.IsSignaled()); | 100 DCHECK(loaded_.IsSignaled()); |
| 101 DCHECK_EQ(loader_instance, this); | 101 DCHECK_EQ(loader_instance, this); |
| 102 loader_instance = NULL; | 102 loader_instance = NULL; |
| 103 } | 103 } |
| 104 | 104 |
| 105 const std::vector<std::string>& ExternalLoader::GetAppIds() { | 105 const std::vector<std::string>& ExternalLoader::GetAppIds() { |
| 106 CHECK(loaded_.IsSignaled()); | 106 if (!loaded_.IsSignaled()) |
| 107 LOG(ERROR) << "GetAppIds() called before loaded."; |
| 107 return app_ids_; | 108 return app_ids_; |
| 108 } | 109 } |
| 109 | 110 |
| 110 void ExternalLoader::Load() { | 111 void ExternalLoader::Load() { |
| 111 base::FilePath ordinals_file; | 112 base::FilePath ordinals_file; |
| 112 CHECK(PathService::Get(chromeos::FILE_DEFAULT_APP_ORDER, &ordinals_file)); | 113 CHECK(PathService::Get(chromeos::FILE_DEFAULT_APP_ORDER, &ordinals_file)); |
| 113 | 114 |
| 114 scoped_ptr<base::ListValue> ordinals_value( | 115 scoped_ptr<base::ListValue> ordinals_value( |
| 115 ReadExternalOrdinalFile(ordinals_file)); | 116 ReadExternalOrdinalFile(ordinals_file)); |
| 116 if (ordinals_value) { | 117 if (ordinals_value) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 131 if (!loader_instance) { | 132 if (!loader_instance) { |
| 132 GetDefault(app_ids); | 133 GetDefault(app_ids); |
| 133 return; | 134 return; |
| 134 } | 135 } |
| 135 | 136 |
| 136 *app_ids = loader_instance->GetAppIds(); | 137 *app_ids = loader_instance->GetAppIds(); |
| 137 } | 138 } |
| 138 | 139 |
| 139 } // namespace default_app_order | 140 } // namespace default_app_order |
| 140 } // namespace chromeos | 141 } // namespace chromeos |
| OLD | NEW |