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

Side by Side Diff: chrome/browser/ui/webui/options2/chromeos/change_picture_options_handler.cc

Issue 10832099: Merge file type filters in Chrome OS user picture picker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/options2/chromeos/change_picture_options_handl er.h" 5 #include "chrome/browser/ui/webui/options2/chromeos/change_picture_options_handl er.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 26 matching lines...) Expand all
37 #include "ui/views/widget/widget.h" 37 #include "ui/views/widget/widget.h"
38 38
39 namespace chromeos { 39 namespace chromeos {
40 namespace options2 { 40 namespace options2 {
41 41
42 namespace { 42 namespace {
43 43
44 // Returns info about extensions for files we support as user images. 44 // Returns info about extensions for files we support as user images.
45 ui::SelectFileDialog::FileTypeInfo GetUserImageFileTypeInfo() { 45 ui::SelectFileDialog::FileTypeInfo GetUserImageFileTypeInfo() {
46 ui::SelectFileDialog::FileTypeInfo file_type_info; 46 ui::SelectFileDialog::FileTypeInfo file_type_info;
47 file_type_info.extensions.resize(5); 47 file_type_info.extensions.resize(1);
48 48
49 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("bmp")); 49 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("bmp"));
50 50
51 file_type_info.extensions[1].push_back(FILE_PATH_LITERAL("gif")); 51 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("gif"));
52 52
53 file_type_info.extensions[2].push_back(FILE_PATH_LITERAL("jpg")); 53 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("jpg"));
54 file_type_info.extensions[2].push_back(FILE_PATH_LITERAL("jpeg")); 54 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("jpeg"));
55 55
56 file_type_info.extensions[3].push_back(FILE_PATH_LITERAL("png")); 56 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("png"));
57 57
58 file_type_info.extensions[4].push_back(FILE_PATH_LITERAL("tif")); 58 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("tif"));
59 file_type_info.extensions[4].push_back(FILE_PATH_LITERAL("tiff")); 59 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("tiff"));
60
61 file_type_info.extension_description_overrides.resize(1);
62 file_type_info.extension_description_overrides[0] =
63 l10n_util::GetStringUTF16(IDS_IMAGE_FILES);
60 64
61 return file_type_info; 65 return file_type_info;
62 } 66 }
63 67
64 // Time histogram suffix for profile image download. 68 // Time histogram suffix for profile image download.
65 const char kProfileDownloadReason[] = "Preferences"; 69 const char kProfileDownloadReason[] = "Preferences";
66 70
67 } // namespace 71 } // namespace
68 72
69 ChangePictureOptionsHandler::ChangePictureOptionsHandler() 73 ChangePictureOptionsHandler::ChangePictureOptionsHandler()
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 OnPhotoAccepted(user_photo_); 418 OnPhotoAccepted(user_photo_);
415 } 419 }
416 420
417 void ChangePictureOptionsHandler::OnDecodeImageFailed( 421 void ChangePictureOptionsHandler::OnDecodeImageFailed(
418 const ImageDecoder* decoder) { 422 const ImageDecoder* decoder) {
419 NOTREACHED() << "Failed to decode PNG image from WebUI"; 423 NOTREACHED() << "Failed to decode PNG image from WebUI";
420 } 424 }
421 425
422 } // namespace options2 426 } // namespace options2
423 } // namespace chromeos 427 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698