| 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/ui/webui/about_ui.h" | 5 #include "chrome/browser/ui/webui/about_ui.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 313 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 314 if (path_ == kKeyboardUtilsPath) { | 314 if (path_ == kKeyboardUtilsPath) { |
| 315 contents_ = ResourceBundle::GetSharedInstance() | 315 contents_ = ResourceBundle::GetSharedInstance() |
| 316 .GetRawDataResource(IDR_KEYBOARD_UTILS_JS) | 316 .GetRawDataResource(IDR_KEYBOARD_UTILS_JS) |
| 317 .as_string(); | 317 .as_string(); |
| 318 ResponseOnUIThread(); | 318 ResponseOnUIThread(); |
| 319 return; | 319 return; |
| 320 } | 320 } |
| 321 // Load local Chrome OS credits from the disk. | 321 // Load local Chrome OS credits from the disk. |
| 322 base::PostTaskWithTraitsAndReply( | 322 base::PostTaskWithTraitsAndReply( |
| 323 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( | 323 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
| 324 base::TaskPriority::BACKGROUND), | |
| 325 base::Bind(&ChromeOSCreditsHandler::LoadCreditsFileAsync, this), | 324 base::Bind(&ChromeOSCreditsHandler::LoadCreditsFileAsync, this), |
| 326 base::Bind(&ChromeOSCreditsHandler::ResponseOnUIThread, this)); | 325 base::Bind(&ChromeOSCreditsHandler::ResponseOnUIThread, this)); |
| 327 } | 326 } |
| 328 | 327 |
| 329 void LoadCreditsFileAsync() { | 328 void LoadCreditsFileAsync() { |
| 330 base::FilePath credits_file_path(chrome::kChromeOSCreditsPath); | 329 base::FilePath credits_file_path(chrome::kChromeOSCreditsPath); |
| 331 if (!base::ReadFileToString(credits_file_path, &contents_)) { | 330 if (!base::ReadFileToString(credits_file_path, &contents_)) { |
| 332 // File with credits not found, ResponseOnUIThread will load credits | 331 // File with credits not found, ResponseOnUIThread will load credits |
| 333 // from resources if contents_ is empty. | 332 // from resources if contents_ is empty. |
| 334 contents_.clear(); | 333 contents_.clear(); |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 Profile* profile = Profile::FromWebUI(web_ui); | 788 Profile* profile = Profile::FromWebUI(web_ui); |
| 790 | 789 |
| 791 #if !defined(OS_ANDROID) | 790 #if !defined(OS_ANDROID) |
| 792 // Set up the chrome://theme/ source. | 791 // Set up the chrome://theme/ source. |
| 793 ThemeSource* theme = new ThemeSource(profile); | 792 ThemeSource* theme = new ThemeSource(profile); |
| 794 content::URLDataSource::Add(profile, theme); | 793 content::URLDataSource::Add(profile, theme); |
| 795 #endif | 794 #endif |
| 796 | 795 |
| 797 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 796 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
| 798 } | 797 } |
| OLD | NEW |