| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 namespace { | 61 namespace { |
| 62 | 62 |
| 63 const char kScreenshotBaseUrl[] = "chrome://screenshots/"; | 63 const char kScreenshotBaseUrl[] = "chrome://screenshots/"; |
| 64 const char kCurrentScreenshotUrl[] = "chrome://screenshots/current"; | 64 const char kCurrentScreenshotUrl[] = "chrome://screenshots/current"; |
| 65 | 65 |
| 66 const char kCategoryTagParameter[] = "categoryTag="; | 66 const char kCategoryTagParameter[] = "categoryTag="; |
| 67 const char kDescriptionParameter[] = "description="; | 67 const char kDescriptionParameter[] = "description="; |
| 68 | 68 |
| 69 #if defined(OS_CHROMEOS) | 69 #if defined(OS_CHROMEOS) |
| 70 const char kSavedScreenshotsUrl[] = "chrome://screenshots/saved/"; | 70 const char kSavedScreenshotsUrl[] = "chrome://screenshots/saved/"; |
| 71 const char kScreenshotPattern[] = "Screenshot_*.png"; | 71 const char kScreenshotPattern[] = "Screenshot *.png"; |
| 72 | 72 |
| 73 const char kTimestampParameter[] = "timestamp="; | 73 const char kTimestampParameter[] = "timestamp="; |
| 74 | 74 |
| 75 const size_t kMaxSavedScreenshots = 2; | 75 const size_t kMaxSavedScreenshots = 2; |
| 76 #endif | 76 #endif |
| 77 | 77 |
| 78 #if defined(OS_CHROMEOS) | 78 #if defined(OS_CHROMEOS) |
| 79 | 79 |
| 80 // Compare two screenshot filepaths, which include the screenshot timestamp | 80 // Compare two screenshot filepaths, which include the screenshot timestamp |
| 81 // in the format of screenshot-yyyymmdd-hhmmss.png. Return true if |filepath1| | 81 // in the format of screenshot-yyyymmdd-hhmmss.png. Return true if |filepath1| |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 size_t sort_size = std::min(max_saved, screenshot_filepaths.size()); | 619 size_t sort_size = std::min(max_saved, screenshot_filepaths.size()); |
| 620 std::partial_sort(screenshot_filepaths.begin(), | 620 std::partial_sort(screenshot_filepaths.begin(), |
| 621 screenshot_filepaths.begin() + sort_size, | 621 screenshot_filepaths.begin() + sort_size, |
| 622 screenshot_filepaths.end(), | 622 screenshot_filepaths.end(), |
| 623 ScreenshotTimestampComp); | 623 ScreenshotTimestampComp); |
| 624 for (size_t i = 0; i < sort_size; ++i) | 624 for (size_t i = 0; i < sort_size; ++i) |
| 625 saved_screenshots->push_back(std::string(kSavedScreenshotsUrl) + | 625 saved_screenshots->push_back(std::string(kSavedScreenshotsUrl) + |
| 626 screenshot_filepaths[i]); | 626 screenshot_filepaths[i]); |
| 627 } | 627 } |
| 628 #endif | 628 #endif |
| OLD | NEW |