OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/mime_util.h" | 5 #include "base/mime_util.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 #include <sys/time.h> | 8 #include <sys/time.h> |
9 #include <time.h> | 9 #include <time.h> |
10 | 10 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 return result; | 364 return result; |
365 } | 365 } |
366 | 366 |
367 bool IconTheme::SetDirectories(const std::string& dirs) { | 367 bool IconTheme::SetDirectories(const std::string& dirs) { |
368 int num = 0; | 368 int num = 0; |
369 std::string::size_type pos = 0, epos; | 369 std::string::size_type pos = 0, epos; |
370 std::string dir; | 370 std::string dir; |
371 while ((epos = dirs.find(',', pos)) != std::string::npos) { | 371 while ((epos = dirs.find(',', pos)) != std::string::npos) { |
372 TrimWhitespaceASCII(dirs.substr(pos, epos - pos), TRIM_ALL, &dir); | 372 TrimWhitespaceASCII(dirs.substr(pos, epos - pos), TRIM_ALL, &dir); |
373 if (dir.length() == 0) { | 373 if (dir.length() == 0) { |
374 LOG(WARNING) << "Invalid index.theme: blank subdir"; | 374 DLOG(WARNING) << "Invalid index.theme: blank subdir"; |
375 return false; | 375 return false; |
376 } | 376 } |
377 subdirs_[dir] = num++; | 377 subdirs_[dir] = num++; |
378 pos = epos + 1; | 378 pos = epos + 1; |
379 } | 379 } |
380 TrimWhitespaceASCII(dirs.substr(pos), TRIM_ALL, &dir); | 380 TrimWhitespaceASCII(dirs.substr(pos), TRIM_ALL, &dir); |
381 if (dir.length() == 0) { | 381 if (dir.length() == 0) { |
382 LOG(WARNING) << "Invalid index.theme: blank subdir"; | 382 DLOG(WARNING) << "Invalid index.theme: blank subdir"; |
383 return false; | 383 return false; |
384 } | 384 } |
385 subdirs_[dir] = num++; | 385 subdirs_[dir] = num++; |
386 info_array_ = new SubDirInfo[num]; | 386 info_array_ = new SubDirInfo[num]; |
387 return true; | 387 return true; |
388 } | 388 } |
389 | 389 |
390 // Make sure |dir| exists and add it to the list of icon directories. | 390 // Make sure |dir| exists and add it to the list of icon directories. |
391 void TryAddIconDir(const FilePath& dir) { | 391 void TryAddIconDir(const FilePath& dir) { |
392 if (!file_util::DirectoryExists(dir)) | 392 if (!file_util::DirectoryExists(dir)) |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 } else { | 628 } else { |
629 icon_file = LookupIconInDefaultTheme(icon_names[i], size); | 629 icon_file = LookupIconInDefaultTheme(icon_names[i], size); |
630 if (!icon_file.empty()) | 630 if (!icon_file.empty()) |
631 return icon_file; | 631 return icon_file; |
632 } | 632 } |
633 } | 633 } |
634 return FilePath(); | 634 return FilePath(); |
635 } | 635 } |
636 | 636 |
637 } // namespace mime_util | 637 } // namespace mime_util |
OLD | NEW |