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

Side by Side Diff: chrome/common/chrome_paths.cc

Issue 1261333004: Add support for Flash Player Component updates on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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/common/chrome_paths.h" 5 #include "chrome/common/chrome_paths.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 #if defined(OS_LINUX) 54 #if defined(OS_LINUX)
55 // The path to the external extension <id>.json files. 55 // The path to the external extension <id>.json files.
56 // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/ 56 // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/
57 const base::FilePath::CharType kFilepathSinglePrefExtensions[] = 57 const base::FilePath::CharType kFilepathSinglePrefExtensions[] =
58 #if defined(GOOGLE_CHROME_BUILD) 58 #if defined(GOOGLE_CHROME_BUILD)
59 FILE_PATH_LITERAL("/usr/share/google-chrome/extensions"); 59 FILE_PATH_LITERAL("/usr/share/google-chrome/extensions");
60 #else 60 #else
61 FILE_PATH_LITERAL("/usr/share/chromium/extensions"); 61 FILE_PATH_LITERAL("/usr/share/chromium/extensions");
62 #endif // defined(GOOGLE_CHROME_BUILD) 62 #endif // defined(GOOGLE_CHROME_BUILD)
63
64 // The path to the hint file that tells the pepper plugin loader
65 // where it can find the latest component updated flash.
66 const base::FilePath::CharType kComponentUpdatedFlashHint[] =
67 FILE_PATH_LITERAL("latest-component-updated-flash");
63 #endif // defined(OS_LINUX) 68 #endif // defined(OS_LINUX)
64 69
65 static base::LazyInstance<base::FilePath> 70 static base::LazyInstance<base::FilePath>
66 g_invalid_specified_user_data_dir = LAZY_INSTANCE_INITIALIZER; 71 g_invalid_specified_user_data_dir = LAZY_INSTANCE_INITIALIZER;
67 72
68 // Gets the path for internal plugins. 73 // Gets the path for internal plugins.
69 bool GetInternalPluginsDirectory(base::FilePath* result) { 74 bool GetInternalPluginsDirectory(base::FilePath* result) {
70 #if defined(OS_MACOSX) && !defined(OS_IOS) 75 #if defined(OS_MACOSX) && !defined(OS_IOS)
71 // If called from Chrome, get internal plugins from a subdirectory of the 76 // If called from Chrome, get internal plugins from a subdirectory of the
72 // framework. 77 // framework.
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 cur = cur.Append(kGCMStoreDirname); 563 cur = cur.Append(kGCMStoreDirname);
559 break; 564 break;
560 #endif // !defined(OS_ANDROID) 565 #endif // !defined(OS_ANDROID)
561 #if defined(OS_ANDROID) 566 #if defined(OS_ANDROID)
562 case chrome::DIR_OFFLINE_PAGE_METADATA: 567 case chrome::DIR_OFFLINE_PAGE_METADATA:
563 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) 568 if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
564 return false; 569 return false;
565 cur = cur.Append(kOfflinePageMetadataDirname); 570 cur = cur.Append(kOfflinePageMetadataDirname);
566 break; 571 break;
567 #endif // defined(OS_ANDROID) 572 #endif // defined(OS_ANDROID)
573 #if defined(OS_LINUX)
574 case chrome::FILE_COMPONENT_FLASH_HINT:
575 if (!PathService::Get(chrome::DIR_COMPONENT_UPDATED_PEPPER_FLASH_PLUGIN,
576 &cur))
577 return false;
578 cur = cur.Append(kComponentUpdatedFlashHint);
579 break;
580 #endif // defined(OS_LINUX)
568 581
569 default: 582 default:
570 return false; 583 return false;
571 } 584 }
572 585
573 // TODO(bauerb): http://crbug.com/259796 586 // TODO(bauerb): http://crbug.com/259796
574 base::ThreadRestrictions::ScopedAllowIO allow_io; 587 base::ThreadRestrictions::ScopedAllowIO allow_io;
575 if (create_dir && !base::PathExists(cur) && 588 if (create_dir && !base::PathExists(cur) &&
576 !base::CreateDirectory(cur)) 589 !base::CreateDirectory(cur))
577 return false; 590 return false;
(...skipping 10 matching lines...) Expand all
588 601
589 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { 602 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) {
590 g_invalid_specified_user_data_dir.Get() = user_data_dir; 603 g_invalid_specified_user_data_dir.Get() = user_data_dir;
591 } 604 }
592 605
593 const base::FilePath& GetInvalidSpecifiedUserDataDir() { 606 const base::FilePath& GetInvalidSpecifiedUserDataDir() {
594 return g_invalid_specified_user_data_dir.Get(); 607 return g_invalid_specified_user_data_dir.Get();
595 } 608 }
596 609
597 } // namespace chrome 610 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698