| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/register_page_ui.h" | 5 #include "chrome/browser/chromeos/dom_ui/register_page_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/string_piece.h" | 11 #include "base/string_piece.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "base/weak_ptr.h" | 14 #include "base/weak_ptr.h" |
| 15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/browser_thread.h" | 16 #include "chrome/browser/browser_thread.h" |
| 17 #include "chrome/browser/chromeos/cros/cros_library.h" | 17 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 18 #include "chrome/browser/chromeos/cros/network_library.h" | 18 #include "chrome/browser/chromeos/cros/network_library.h" |
| 19 #include "chrome/browser/chromeos/cros/system_library.h" | 19 #include "chrome/browser/chromeos/cros/system_library.h" |
| 20 #include "chrome/browser/chromeos/customization_document.h" | 20 #include "chrome/browser/chromeos/customization_document.h" |
| 21 #include "chrome/browser/chromeos/login/wizard_controller.h" | 21 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 22 #include "chrome/browser/chromeos/version_loader.h" | 22 #include "chrome/browser/chromeos/version_loader.h" |
| 23 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 23 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
| 24 #include "chrome/browser/profiles/profile.h" | |
| 25 #include "chrome/browser/tab_contents/tab_contents.h" | 24 #include "chrome/browser/tab_contents/tab_contents.h" |
| 26 #include "chrome/common/url_constants.h" | 25 #include "chrome/common/url_constants.h" |
| 27 #include "googleurl/src/gurl.h" | 26 #include "googleurl/src/gurl.h" |
| 28 #include "grit/browser_resources.h" | 27 #include "grit/browser_resources.h" |
| 29 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
| 30 | 29 |
| 31 namespace { | 30 namespace { |
| 32 | 31 |
| 33 // Host page JS API callback names. | 32 // Host page JS API callback names. |
| 34 const char kJsCallbackGetRegistrationUrl[] = "getRegistrationUrl"; | 33 const char kJsCallbackGetRegistrationUrl[] = "getRegistrationUrl"; |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 // | 316 // |
| 318 //////////////////////////////////////////////////////////////////////////////// | 317 //////////////////////////////////////////////////////////////////////////////// |
| 319 | 318 |
| 320 RegisterPageUI::RegisterPageUI(TabContents* contents) : DOMUI(contents){ | 319 RegisterPageUI::RegisterPageUI(TabContents* contents) : DOMUI(contents){ |
| 321 RegisterPageHandler* handler = new RegisterPageHandler(); | 320 RegisterPageHandler* handler = new RegisterPageHandler(); |
| 322 AddMessageHandler((handler)->Attach(this)); | 321 AddMessageHandler((handler)->Attach(this)); |
| 323 handler->Init(); | 322 handler->Init(); |
| 324 RegisterPageUIHTMLSource* html_source = new RegisterPageUIHTMLSource(); | 323 RegisterPageUIHTMLSource* html_source = new RegisterPageUIHTMLSource(); |
| 325 | 324 |
| 326 // Set up the chrome://register/ source. | 325 // Set up the chrome://register/ source. |
| 327 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); | 326 BrowserThread::PostTask( |
| 327 BrowserThread::IO, FROM_HERE, |
| 328 NewRunnableMethod( |
| 329 ChromeURLDataManager::GetInstance(), |
| 330 &ChromeURLDataManager::AddDataSource, |
| 331 make_scoped_refptr(html_source))); |
| 328 } | 332 } |
| OLD | NEW |