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/file_select_helper.h" | 5 #include "chrome/browser/file_select_helper.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 CleanUpOnRenderViewHostChange(); | 558 CleanUpOnRenderViewHostChange(); |
559 } | 559 } |
560 | 560 |
561 // static | 561 // static |
562 bool FileSelectHelper::IsAcceptTypeValid(const std::string& accept_type) { | 562 bool FileSelectHelper::IsAcceptTypeValid(const std::string& accept_type) { |
563 // TODO(raymes): This only does some basic checks, extend to test more cases. | 563 // TODO(raymes): This only does some basic checks, extend to test more cases. |
564 // A 1 character accept type will always be invalid (either a "." in the case | 564 // A 1 character accept type will always be invalid (either a "." in the case |
565 // of an extension or a "/" in the case of a MIME type). | 565 // of an extension or a "/" in the case of a MIME type). |
566 std::string unused; | 566 std::string unused; |
567 if (accept_type.length() <= 1 || | 567 if (accept_type.length() <= 1 || |
568 base::StringToLowerASCII(accept_type) != accept_type || | 568 base::ToLowerASCII(accept_type) != accept_type || |
569 base::TrimWhitespaceASCII(accept_type, base::TRIM_ALL, &unused) != | 569 base::TrimWhitespaceASCII(accept_type, base::TRIM_ALL, &unused) != |
570 base::TRIM_NONE) { | 570 base::TRIM_NONE) { |
571 return false; | 571 return false; |
572 } | 572 } |
573 return true; | 573 return true; |
574 } | 574 } |
OLD | NEW |