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/common/chrome_paths.h" | 5 #include "chrome/common/chrome_paths.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 #endif | 570 #endif |
571 #endif // !defined(OS_MACOSX) | 571 #endif // !defined(OS_MACOSX) |
572 break; | 572 break; |
573 | 573 |
574 case chrome::DIR_USER_NATIVE_MESSAGING: | 574 case chrome::DIR_USER_NATIVE_MESSAGING: |
575 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 575 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
576 return false; | 576 return false; |
577 cur = cur.Append(FILE_PATH_LITERAL("NativeMessagingHosts")); | 577 cur = cur.Append(FILE_PATH_LITERAL("NativeMessagingHosts")); |
578 break; | 578 break; |
579 #endif // defined(OS_LINUX) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 579 #endif // defined(OS_LINUX) || (defined(OS_MACOSX) && !defined(OS_IOS)) |
| 580 #if !defined(OS_ANDROID) |
| 581 case chrome::DIR_GLOBAL_GCM_STORE: |
| 582 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
| 583 return false; |
| 584 cur = cur.Append(kGCMStoreDirname); |
| 585 break; |
| 586 #endif // !defined(OS_ANDROID) |
580 | 587 |
581 default: | 588 default: |
582 return false; | 589 return false; |
583 } | 590 } |
584 | 591 |
585 // TODO(bauerb): http://crbug.com/259796 | 592 // TODO(bauerb): http://crbug.com/259796 |
586 base::ThreadRestrictions::ScopedAllowIO allow_io; | 593 base::ThreadRestrictions::ScopedAllowIO allow_io; |
587 if (create_dir && !base::PathExists(cur) && | 594 if (create_dir && !base::PathExists(cur) && |
588 !base::CreateDirectory(cur)) | 595 !base::CreateDirectory(cur)) |
589 return false; | 596 return false; |
(...skipping 10 matching lines...) Expand all Loading... |
600 | 607 |
601 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { | 608 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { |
602 g_invalid_specified_user_data_dir.Get() = user_data_dir; | 609 g_invalid_specified_user_data_dir.Get() = user_data_dir; |
603 } | 610 } |
604 | 611 |
605 const base::FilePath& GetInvalidSpecifiedUserDataDir() { | 612 const base::FilePath& GetInvalidSpecifiedUserDataDir() { |
606 return g_invalid_specified_user_data_dir.Get(); | 613 return g_invalid_specified_user_data_dir.Get(); |
607 } | 614 } |
608 | 615 |
609 } // namespace chrome | 616 } // namespace chrome |
OLD | NEW |