diff options
-rw-r--r-- | app/test_suite.h | 13 | ||||
-rw-r--r-- | chrome/browser/autocomplete/history_url_provider_unittest.cc | 1 | ||||
-rw-r--r-- | chrome/browser/cocoa/cocoa_test_helper.h | 7 | ||||
-rw-r--r-- | chrome/browser/cocoa/nsimage_cache_unittest.mm | 7 | ||||
-rw-r--r-- | chrome/common/chrome_constants.cc | 22 | ||||
-rw-r--r-- | chrome/common/chrome_constants.h | 3 | ||||
-rw-r--r-- | chrome/common/chrome_paths_mac.mm | 4 | ||||
-rw-r--r-- | chrome/common/mac_app_names.h | 18 | ||||
-rw-r--r-- | chrome/test/unit/chrome_test_suite.h | 9 |
9 files changed, 31 insertions, 53 deletions
diff --git a/app/test_suite.h b/app/test_suite.h index 8a04be9..8cb6ee1 100644 --- a/app/test_suite.h +++ b/app/test_suite.h @@ -34,21 +34,18 @@ class AppTestSuite : public TestSuite { #if defined(OS_MACOSX) // Look in the framework bundle for resources. - // TODO(port): make a resource bundle for non-app exes. + // TODO(port): make a resource bundle for non-app exes. What's done here + // isn't really right because this code needs to depend on chrome_dll + // being built. This is inappropriate in app. FilePath path; PathService::Get(base::DIR_EXE, &path); #if defined(GOOGLE_CHROME_BUILD) -#define MAC_PRODUCT_NAME "Google Chrome" + path = path.AppendASCII("Google Chrome Framework.framework"); #elif defined(CHROMIUM_BUILD) -#define MAC_PRODUCT_NAME "Chromium" + path = path.AppendASCII("Chromium Framework.framework"); #else #error Unknown branding #endif - path = path.AppendASCII(MAC_PRODUCT_NAME ".app"); - path = path.AppendASCII("Contents"); - path = path.AppendASCII("Frameworks"); - path = path.AppendASCII(MAC_PRODUCT_NAME " Framework.framework"); -#undef MAC_PRODUCT_NAME mac_util::SetOverrideAppBundlePath(path); #endif // OS_MACOSX diff --git a/chrome/browser/autocomplete/history_url_provider_unittest.cc b/chrome/browser/autocomplete/history_url_provider_unittest.cc index 370fb1c..7730f5a 100644 --- a/chrome/browser/autocomplete/history_url_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_url_provider_unittest.cc @@ -13,7 +13,6 @@ #include "testing/gtest/include/gtest/gtest.h" #if defined(OS_MACOSX) #include "base/mac_util.h" -#include "chrome/common/mac_app_names.h" #endif using base::Time; diff --git a/chrome/browser/cocoa/cocoa_test_helper.h b/chrome/browser/cocoa/cocoa_test_helper.h index 8eb3438..1627391 100644 --- a/chrome/browser/cocoa/cocoa_test_helper.h +++ b/chrome/browser/cocoa/cocoa_test_helper.h @@ -12,7 +12,7 @@ #include "base/mac_util.h" #include "base/path_service.h" #import "base/scoped_nsobject.h" -#include "chrome/common/mac_app_names.h" +#include "chrome/common/chrome_constants.h" // Background windows normally will not display things such as focus // rings. This class allows -isKeyWindow to be manipulated to test @@ -58,10 +58,7 @@ class CocoaNoWindowTestHelper { // Look in the framework bundle for resources. FilePath path; PathService::Get(base::DIR_EXE, &path); - path = path.AppendASCII(MAC_BROWSER_APP_NAME); - path = path.AppendASCII("Contents"); - path = path.AppendASCII("Frameworks"); - path = path.AppendASCII(MAC_FRAMEWORK_NAME); + path = path.Append(chrome::kFrameworkName); mac_util::SetOverrideAppBundlePath(path); // Bootstrap Cocoa. It's very unhappy without this. diff --git a/chrome/browser/cocoa/nsimage_cache_unittest.mm b/chrome/browser/cocoa/nsimage_cache_unittest.mm index 6283ffe..03d1b5e 100644 --- a/chrome/browser/cocoa/nsimage_cache_unittest.mm +++ b/chrome/browser/cocoa/nsimage_cache_unittest.mm @@ -8,7 +8,7 @@ #include "base/mac_util.h" #include "base/nsimage_cache_mac.h" #include "base/path_service.h" -#include "chrome/common/mac_app_names.h" +#include "chrome/common/chrome_constants.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -23,10 +23,7 @@ class NSImageCacheTest : public PlatformTest { // Look in the framework bundle for resources. FilePath path; PathService::Get(base::DIR_EXE, &path); - path = path.AppendASCII(MAC_BROWSER_APP_NAME); - path = path.AppendASCII("Contents"); - path = path.AppendASCII("Frameworks"); - path = path.AppendASCII(MAC_FRAMEWORK_NAME); + path = path.Append(chrome::kFrameworkName); mac_util::SetOverrideAppBundlePath(path); } virtual ~NSImageCacheTest() { diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc index 9c3a298..55ea255 100644 --- a/chrome/common/chrome_constants.cc +++ b/chrome/common/chrome_constants.cc @@ -10,9 +10,13 @@ #if defined(OS_MACOSX) #if defined(GOOGLE_CHROME_BUILD) -#define PRODUCT_STRING L"Google Chrome" +#define PRODUCT_STRING "Google Chrome" +#define PRODUCT_STRING_W L"Google Chrome" +#elif defined(CHROMIUM_BUILD) +#define PRODUCT_STRING "Chromium" +#define PRODUCT_STRING_W L"Chromium" #else -#define PRODUCT_STRING L"Chromium" +#error Unknown branding #endif #endif // OS_MACOSX @@ -27,8 +31,8 @@ const wchar_t kHelperProcessExecutableName[] = L"chrome.exe"; const wchar_t kBrowserProcessExecutableName[] = L"chrome"; const wchar_t kHelperProcessExecutableName[] = L"chrome"; #elif defined(OS_MACOSX) -const wchar_t kBrowserProcessExecutableName[] = PRODUCT_STRING; -const wchar_t kHelperProcessExecutableName[] = PRODUCT_STRING L" Helper"; +const wchar_t kBrowserProcessExecutableName[] = PRODUCT_STRING_W; +const wchar_t kHelperProcessExecutableName[] = PRODUCT_STRING_W L" Helper"; #endif // OS_* #if defined(OS_WIN) const wchar_t kBrowserProcessExecutablePath[] = L"chrome.exe"; @@ -38,11 +42,15 @@ const wchar_t kBrowserProcessExecutablePath[] = L"chrome"; const wchar_t kHelperProcessExecutablePath[] = L"chrome"; #elif defined(OS_MACOSX) const wchar_t kBrowserProcessExecutablePath[] = - PRODUCT_STRING L".app/Contents/MacOS/" PRODUCT_STRING; + PRODUCT_STRING_W L".app/Contents/MacOS/" PRODUCT_STRING_W; const wchar_t kHelperProcessExecutablePath[] = - PRODUCT_STRING L".app/Contents/Resources/" - PRODUCT_STRING L" Helper.app/Contents/MacOS/" PRODUCT_STRING L" Helper"; + PRODUCT_STRING_W L".app/Contents/Resources/" + PRODUCT_STRING_W L" Helper.app/Contents/MacOS/" PRODUCT_STRING_W L" Helper"; #endif // OS_* +#if defined(OS_MACOSX) +const FilePath::CharType kFrameworkName[] = + PRODUCT_STRING " Framework.framework"; +#endif // OS_MACOSX #if defined(CHROME_FRAME_BUILD) const wchar_t kBrowserAppName[] = L"ChromeFrame"; const char kStatsFilename[] = "ChromeFrameStats2"; diff --git a/chrome/common/chrome_constants.h b/chrome/common/chrome_constants.h index 71581db..fab0a16 100644 --- a/chrome/common/chrome_constants.h +++ b/chrome/common/chrome_constants.h @@ -15,6 +15,9 @@ extern const wchar_t kBrowserProcessExecutableName[]; extern const wchar_t kHelperProcessExecutableName[]; extern const wchar_t kBrowserProcessExecutablePath[]; extern const wchar_t kHelperProcessExecutablePath[]; +#if defined(OS_MACOSX) +extern const FilePath::CharType kFrameworkName[]; +#endif extern const wchar_t kBrowserAppName[]; extern const wchar_t kMessageWindowClass[]; extern const wchar_t kCrashReportLog[]; diff --git a/chrome/common/chrome_paths_mac.mm b/chrome/common/chrome_paths_mac.mm index 59c8fa7..3ddd796 100644 --- a/chrome/common/chrome_paths_mac.mm +++ b/chrome/common/chrome_paths_mac.mm @@ -10,7 +10,7 @@ #include "base/logging.h" #include "base/mac_util.h" #include "base/path_service.h" -#include "chrome/common/mac_app_names.h" +#include "chrome/common/chrome_constants.h" namespace chrome { @@ -90,7 +90,7 @@ FilePath GetFrameworkBundlePath() { // The framework bundle is at a known path and name from the browser .app's // Contents directory. - return path.Append("Frameworks").Append(MAC_FRAMEWORK_NAME); + return path.Append("Frameworks").Append(kFrameworkName); } } // namespace chrome diff --git a/chrome/common/mac_app_names.h b/chrome/common/mac_app_names.h deleted file mode 100644 index 8ac01dd..0000000 --- a/chrome/common/mac_app_names.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_COMMON_MAC_APP_NAMES_H_ -#define CHROME_COMMON_MAC_APP_NAMES_H_ - -#if defined(GOOGLE_CHROME_BUILD) -#define MAC_BROWSER_APP_NAME "Google Chrome.app" -#define MAC_FRAMEWORK_NAME "Google Chrome Framework.framework" -#elif defined(CHROMIUM_BUILD) -#define MAC_BROWSER_APP_NAME "Chromium.app" -#define MAC_FRAMEWORK_NAME "Chromium Framework.framework" -#else -#error Not sure what the branding is! -#endif - -#endif // CHROME_COMMON_MAC_APP_NAMES_H_ diff --git a/chrome/test/unit/chrome_test_suite.h b/chrome/test/unit/chrome_test_suite.h index 145c330..15d262d 100644 --- a/chrome/test/unit/chrome_test_suite.h +++ b/chrome/test/unit/chrome_test_suite.h @@ -22,11 +22,9 @@ #include "base/test_suite.h" #include "chrome/app/scoped_ole_initializer.h" #include "chrome/browser/browser_process.h" +#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" -#if defined(OS_MACOSX) -#include "chrome/common/mac_app_names.h" -#endif #include "chrome/test/testing_browser_process.h" #include "net/base/mock_host_resolver.h" #include "net/base/net_util.h" @@ -101,10 +99,7 @@ class ChromeTestSuite : public TestSuite { // Look in the framework bundle for resources. FilePath path; PathService::Get(base::DIR_EXE, &path); - path = path.AppendASCII(MAC_BROWSER_APP_NAME); - path = path.AppendASCII("Contents"); - path = path.AppendASCII("Frameworks"); - path = path.AppendASCII(MAC_FRAMEWORK_NAME); + path = path.Append(chrome::kFrameworkName); mac_util::SetOverrideAppBundlePath(path); #endif |