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/feedback_ui.h" | 5 #include "chrome/browser/ui/webui/feedback_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 : WebDialogUI(web_ui) { | 723 : WebDialogUI(web_ui) { |
724 FeedbackHandler* handler = new FeedbackHandler(web_ui->GetWebContents()); | 724 FeedbackHandler* handler = new FeedbackHandler(web_ui->GetWebContents()); |
725 web_ui->AddMessageHandler(handler); | 725 web_ui->AddMessageHandler(handler); |
726 | 726 |
727 // The handler's init will determine whether we show the error html page. | 727 // The handler's init will determine whether we show the error html page. |
728 ChromeWebUIDataSource* html_source = | 728 ChromeWebUIDataSource* html_source = |
729 CreateFeedbackUIHTMLSource(handler->Init()); | 729 CreateFeedbackUIHTMLSource(handler->Init()); |
730 | 730 |
731 // Set up the chrome://feedback/ source. | 731 // Set up the chrome://feedback/ source. |
732 Profile* profile = Profile::FromWebUI(web_ui); | 732 Profile* profile = Profile::FromWebUI(web_ui); |
733 ChromeURLDataManager::AddDataSource(profile, html_source); | 733 ChromeURLDataManager::AddDataSourceImpl(profile, html_source); |
734 } | 734 } |
735 | 735 |
736 #if defined(OS_CHROMEOS) | 736 #if defined(OS_CHROMEOS) |
737 // static | 737 // static |
738 void FeedbackUI::GetMostRecentScreenshots( | 738 void FeedbackUI::GetMostRecentScreenshots( |
739 const FilePath& filepath, | 739 const FilePath& filepath, |
740 std::vector<std::string>* saved_screenshots, | 740 std::vector<std::string>* saved_screenshots, |
741 size_t max_saved) { | 741 size_t max_saved) { |
742 std::string pattern = | 742 std::string pattern = |
743 std::string(ScreenshotSource::kScreenshotPrefix) + "*" + | 743 std::string(ScreenshotSource::kScreenshotPrefix) + "*" + |
(...skipping 14 matching lines...) Expand all Loading... |
758 screenshot_filepaths.begin() + sort_size, | 758 screenshot_filepaths.begin() + sort_size, |
759 screenshot_filepaths.end(), | 759 screenshot_filepaths.end(), |
760 ScreenshotTimestampComp); | 760 ScreenshotTimestampComp); |
761 for (size_t i = 0; i < sort_size; ++i) | 761 for (size_t i = 0; i < sort_size; ++i) |
762 saved_screenshots->push_back( | 762 saved_screenshots->push_back( |
763 std::string(ScreenshotSource::kScreenshotUrlRoot) + | 763 std::string(ScreenshotSource::kScreenshotUrlRoot) + |
764 std::string(ScreenshotSource::kScreenshotSaved) + | 764 std::string(ScreenshotSource::kScreenshotSaved) + |
765 screenshot_filepaths[i]); | 765 screenshot_filepaths[i]); |
766 } | 766 } |
767 #endif | 767 #endif |
OLD | NEW |