| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/dom_ui/bug_report_ui.h" | 5 #include "chrome/browser/dom_ui/bug_report_ui.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 IDR_BUGREPORT_HTML_INVALID)); | 441 IDR_BUGREPORT_HTML_INVALID)); |
| 442 } | 442 } |
| 443 | 443 |
| 444 if (browser_) | 444 if (browser_) |
| 445 target_tab_ = browser_->GetTabContentsAt(index); | 445 target_tab_ = browser_->GetTabContentsAt(index); |
| 446 else | 446 else |
| 447 LOG(FATAL) << "Failed to get last active browser."; | 447 LOG(FATAL) << "Failed to get last active browser."; |
| 448 | 448 |
| 449 return base::StringPiece( | 449 return base::StringPiece( |
| 450 ResourceBundle::GetSharedInstance().GetRawDataResource( | 450 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 451 #if defined(OS_CHROMEOS) | |
| 452 IDR_BUGREPORT_HTML_CHROMEOS)); | |
| 453 #else | |
| 454 IDR_BUGREPORT_HTML)); | 451 IDR_BUGREPORT_HTML)); |
| 455 #endif | |
| 456 } | 452 } |
| 457 | 453 |
| 458 void BugReportHandler::RegisterMessages() { | 454 void BugReportHandler::RegisterMessages() { |
| 459 dom_ui_->RegisterMessageCallback("getDialogDefaults", | 455 dom_ui_->RegisterMessageCallback("getDialogDefaults", |
| 460 NewCallback(this, &BugReportHandler::HandleGetDialogDefaults)); | 456 NewCallback(this, &BugReportHandler::HandleGetDialogDefaults)); |
| 461 dom_ui_->RegisterMessageCallback("refreshScreenshots", | 457 dom_ui_->RegisterMessageCallback("refreshScreenshots", |
| 462 NewCallback(this, &BugReportHandler::HandleRefreshScreenshots)); | 458 NewCallback(this, &BugReportHandler::HandleRefreshScreenshots)); |
| 463 dom_ui_->RegisterMessageCallback("sendReport", | 459 dom_ui_->RegisterMessageCallback("sendReport", |
| 464 NewCallback(this, &BugReportHandler::HandleSendReport)); | 460 NewCallback(this, &BugReportHandler::HandleSendReport)); |
| 465 dom_ui_->RegisterMessageCallback("cancel", | 461 dom_ui_->RegisterMessageCallback("cancel", |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 BugReportUIHTMLSource* html_source = | 613 BugReportUIHTMLSource* html_source = |
| 618 new BugReportUIHTMLSource(handler->Init()); | 614 new BugReportUIHTMLSource(handler->Init()); |
| 619 // Set up the chrome://bugreport/ source. | 615 // Set up the chrome://bugreport/ source. |
| 620 ChromeThread::PostTask( | 616 ChromeThread::PostTask( |
| 621 ChromeThread::IO, FROM_HERE, | 617 ChromeThread::IO, FROM_HERE, |
| 622 NewRunnableMethod( | 618 NewRunnableMethod( |
| 623 Singleton<ChromeURLDataManager>::get(), | 619 Singleton<ChromeURLDataManager>::get(), |
| 624 &ChromeURLDataManager::AddDataSource, | 620 &ChromeURLDataManager::AddDataSource, |
| 625 make_scoped_refptr(html_source))); | 621 make_scoped_refptr(html_source))); |
| 626 } | 622 } |
| OLD | NEW |