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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 const std::string& filepath2) { | 91 const std::string& filepath2) { |
92 return filepath1 > filepath2; | 92 return filepath1 > filepath2; |
93 } | 93 } |
94 | 94 |
95 void GetSavedScreenshots(std::vector<std::string>* saved_screenshots) { | 95 void GetSavedScreenshots(std::vector<std::string>* saved_screenshots) { |
96 saved_screenshots->clear(); | 96 saved_screenshots->clear(); |
97 | 97 |
98 DownloadPrefs* download_prefs = DownloadPrefs::FromBrowserContext( | 98 DownloadPrefs* download_prefs = DownloadPrefs::FromBrowserContext( |
99 ash::Shell::GetInstance()->delegate()->GetCurrentBrowserContext()); | 99 ash::Shell::GetInstance()->delegate()->GetCurrentBrowserContext()); |
100 FeedbackUI::GetMostRecentScreenshots( | 100 FeedbackUI::GetMostRecentScreenshots( |
101 download_prefs->download_path(), | 101 download_prefs->DownloadPath(), |
102 saved_screenshots, | 102 saved_screenshots, |
103 kMaxSavedScreenshots); | 103 kMaxSavedScreenshots); |
104 } | 104 } |
105 | 105 |
106 std::string GetUserEmail() { | 106 std::string GetUserEmail() { |
107 chromeos::UserManager* manager = chromeos::UserManager::Get(); | 107 chromeos::UserManager* manager = chromeos::UserManager::Get(); |
108 if (!manager) | 108 if (!manager) |
109 return std::string(); | 109 return std::string(); |
110 else | 110 else |
111 return manager->GetLoggedInUser().display_email(); | 111 return manager->GetLoggedInUser().display_email(); |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 size_t sort_size = std::min(max_saved, screenshot_filepaths.size()); | 647 size_t sort_size = std::min(max_saved, screenshot_filepaths.size()); |
648 std::partial_sort(screenshot_filepaths.begin(), | 648 std::partial_sort(screenshot_filepaths.begin(), |
649 screenshot_filepaths.begin() + sort_size, | 649 screenshot_filepaths.begin() + sort_size, |
650 screenshot_filepaths.end(), | 650 screenshot_filepaths.end(), |
651 ScreenshotTimestampComp); | 651 ScreenshotTimestampComp); |
652 for (size_t i = 0; i < sort_size; ++i) | 652 for (size_t i = 0; i < sort_size; ++i) |
653 saved_screenshots->push_back(std::string(kSavedScreenshotsUrl) + | 653 saved_screenshots->push_back(std::string(kSavedScreenshotsUrl) + |
654 screenshot_filepaths[i]); | 654 screenshot_filepaths[i]); |
655 } | 655 } |
656 #endif | 656 #endif |
OLD | NEW |