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/dom_ui/bug_report_ui.h" | 5 #include "chrome/browser/dom_ui/bug_report_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 635 matching lines...) Loading... |
646 | 646 |
647 ListValue screenshots_list; | 647 ListValue screenshots_list; |
648 for (size_t i = 0; i < saved_screenshots.size(); ++i) | 648 for (size_t i = 0; i < saved_screenshots.size(); ++i) |
649 screenshots_list.Append(new StringValue(saved_screenshots[i])); | 649 screenshots_list.Append(new StringValue(saved_screenshots[i])); |
650 dom_ui_->CallJavascriptFunction(L"setupSavedScreenshots", screenshots_list); | 650 dom_ui_->CallJavascriptFunction(L"setupSavedScreenshots", screenshots_list); |
651 } | 651 } |
652 #endif | 652 #endif |
653 | 653 |
654 | 654 |
655 void BugReportHandler::HandleSendReport(const ListValue* list_value) { | 655 void BugReportHandler::HandleSendReport(const ListValue* list_value) { |
| 656 if (!bug_report_) { |
| 657 LOG(ERROR) << "Bug report hasn't been intialized yet."; |
| 658 return; |
| 659 } |
| 660 |
656 ListValue::const_iterator i = list_value->begin(); | 661 ListValue::const_iterator i = list_value->begin(); |
657 if (i == list_value->end()) { | 662 if (i == list_value->end()) { |
658 LOG(ERROR) << "Incorrect data passed to sendReport."; | 663 LOG(ERROR) << "Incorrect data passed to sendReport."; |
659 return; | 664 return; |
660 } | 665 } |
661 | 666 |
662 // #0 - Problem type. | 667 // #0 - Problem type. |
663 int problem_type; | 668 int problem_type; |
664 std::string problem_type_str; | 669 std::string problem_type_str; |
665 (*i)->GetAsString(&problem_type_str); | 670 (*i)->GetAsString(&problem_type_str); |
(...skipping 138 matching lines...) Loading... |
804 BugReportUIHTMLSource* html_source = | 809 BugReportUIHTMLSource* html_source = |
805 new BugReportUIHTMLSource(handler->Init()); | 810 new BugReportUIHTMLSource(handler->Init()); |
806 // Set up the chrome://bugreport/ source. | 811 // Set up the chrome://bugreport/ source. |
807 BrowserThread::PostTask( | 812 BrowserThread::PostTask( |
808 BrowserThread::IO, FROM_HERE, | 813 BrowserThread::IO, FROM_HERE, |
809 NewRunnableMethod( | 814 NewRunnableMethod( |
810 ChromeURLDataManager::GetInstance(), | 815 ChromeURLDataManager::GetInstance(), |
811 &ChromeURLDataManager::AddDataSource, | 816 &ChromeURLDataManager::AddDataSource, |
812 make_scoped_refptr(html_source))); | 817 make_scoped_refptr(html_source))); |
813 } | 818 } |
OLD | NEW |