Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: chrome/browser/ui/webui/feedback_ui.cc

Issue 11881055: Simplify WebUI data sources. Currently WebUI data sources implement a URLDataSourceDelegate interfa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix clang Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698