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

Side by Side Diff: chrome/browser/chromeos/extensions/default_app_order.cc

Issue 16032004: Call CreateDefaultOrdinals() when needed, instead of on construction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_sorting.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_sorting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698