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/customization_document.h" | 5 #include "chrome/browser/chromeos/customization_document.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_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 StartFileFetch(); | 277 StartFileFetch(); |
278 } | 278 } |
279 } | 279 } |
280 | 280 |
281 void ServicesCustomizationDocument::ReadFileInBackground(const FilePath& file) { | 281 void ServicesCustomizationDocument::ReadFileInBackground(const FilePath& file) { |
282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
283 | 283 |
284 std::string manifest; | 284 std::string manifest; |
285 if (file_util::ReadFileToString(file, &manifest)) { | 285 if (file_util::ReadFileToString(file, &manifest)) { |
286 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 286 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
287 base::IgnoreReturn<bool>(base::Bind( | 287 base::Bind( |
288 &ServicesCustomizationDocument::LoadManifestFromString, | 288 base::IgnoreResult( |
289 base::Unretained(this), // this class is a singleton. | 289 &ServicesCustomizationDocument::LoadManifestFromString), |
290 manifest))); | 290 base::Unretained(this), // this class is a singleton. |
| 291 manifest)); |
291 } else { | 292 } else { |
292 VLOG(1) << "Failed to load services customization manifest from: " | 293 VLOG(1) << "Failed to load services customization manifest from: " |
293 << file.value(); | 294 << file.value(); |
294 } | 295 } |
295 } | 296 } |
296 | 297 |
297 void ServicesCustomizationDocument::StartFileFetch() { | 298 void ServicesCustomizationDocument::StartFileFetch() { |
298 DCHECK(url_.is_valid()); | 299 DCHECK(url_.is_valid()); |
299 url_fetcher_.reset(content::URLFetcher::Create( | 300 url_fetcher_.reset(content::URLFetcher::Create( |
300 url_, content::URLFetcher::GET, this)); | 301 url_, content::URLFetcher::GET, this)); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 locale, kAppContentAttr, kInitialStartPageAttr); | 337 locale, kAppContentAttr, kInitialStartPageAttr); |
337 } | 338 } |
338 | 339 |
339 std::string ServicesCustomizationDocument::GetSupportPage( | 340 std::string ServicesCustomizationDocument::GetSupportPage( |
340 const std::string& locale) const { | 341 const std::string& locale) const { |
341 return GetLocaleSpecificString( | 342 return GetLocaleSpecificString( |
342 locale, kAppContentAttr, kSupportPageAttr); | 343 locale, kAppContentAttr, kSupportPageAttr); |
343 } | 344 } |
344 | 345 |
345 } // namespace chromeos | 346 } // namespace chromeos |
OLD | NEW |