Move foundation_util to base/apple, leave a forwarding header
Crashpad is not yet updated for the new location, so leave a
forwarding header to be removed later.
Skipping trybots. This is a Mac change, and it’s passing all
trybots except for android_optional_gpu_tests_rel that is
repeatedly failing on an unrelated issue.
NOTRY=true
Bug: 1444927
Cq-Include-Trybots: luci.chrome.try:mac-chrome
Change-Id: Iad0c903187b0e1e5584c68f2eb00b5b026085596
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4790744
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1185029}
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 6e6e1b1a..4ae7eed 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1953,6 +1953,8 @@
"apple/call_with_eh_frame_asm.S",
"apple/dispatch_source_mach.cc",
"apple/dispatch_source_mach.h",
+ "apple/foundation_util.h",
+ "apple/foundation_util.mm",
"apple/mach_logging.cc",
"apple/mach_logging.h",
"apple/osstatus_logging.h",
@@ -1975,8 +1977,6 @@
"file_version_info_apple.h",
"file_version_info_apple.mm",
"files/file_util_apple.mm",
- "mac/foundation_util.h",
- "mac/foundation_util.mm",
"memory/platform_shared_memory_mapper_apple.cc",
"memory/platform_shared_memory_region_apple.cc",
"message_loop/message_pump_apple.h",
diff --git a/base/apple/DEPS b/base/apple/DEPS
new file mode 100644
index 0000000..816f056b
--- /dev/null
+++ b/base/apple/DEPS
@@ -0,0 +1,6 @@
+include_rules = [
+ # base/apple is a base on which base/mac and base/ios build, so don't allow
+ # dependencies on them.
+ "-mac",
+ "-ios",
+]
diff --git a/base/apple/backup_util.mm b/base/apple/backup_util.mm
index aeb34b7..ebd0ff8 100644
--- a/base/apple/backup_util.mm
+++ b/base/apple/backup_util.mm
@@ -6,9 +6,9 @@
#import <Foundation/Foundation.h>
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/threading/scoped_blocking_call.h"
@@ -18,7 +18,7 @@
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK);
- NSURL* file_url = mac::FilePathToNSURL(file_path);
+ NSURL* file_url = apple::FilePathToNSURL(file_path);
DCHECK([file_url checkPromisedItemIsReachableAndReturnError:nil]);
NSError* error = nil;
@@ -40,7 +40,7 @@
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK);
- NSURL* file_url = mac::FilePathToNSURL(file_path);
+ NSURL* file_url = apple::FilePathToNSURL(file_path);
DCHECK([file_url checkPromisedItemIsReachableAndReturnError:nil]);
NSError* error = nil;
diff --git a/base/apple/backup_util_unittest.mm b/base/apple/backup_util_unittest.mm
index c349202..13874dc 100644
--- a/base/apple/backup_util_unittest.mm
+++ b/base/apple/backup_util_unittest.mm
@@ -7,11 +7,11 @@
#include <stddef.h>
#include <stdint.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/mac/foundation_util.h"
#include "base/numerics/safe_conversions.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -45,7 +45,7 @@
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
FilePath excluded_file_path = temp_dir_.GetPath().Append("excluded");
base::ScopedCFTypeRef<CFURLRef> excluded_url =
- mac::FilePathToCFURL(excluded_file_path);
+ apple::FilePathToCFURL(excluded_file_path);
constexpr char placeholder_data[] = "All your base are belong to us!";
ASSERT_EQ(checked_cast<int>(std::size(placeholder_data)),
diff --git a/base/apple/bundle_locations.mm b/base/apple/bundle_locations.mm
index f3b8090..a875fdc 100644
--- a/base/apple/bundle_locations.mm
+++ b/base/apple/bundle_locations.mm
@@ -4,8 +4,8 @@
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/check.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
namespace base::apple {
@@ -26,7 +26,7 @@
}
FilePath MainBundlePath() {
- return mac::NSStringToFilePath(MainBundle().bundlePath);
+ return apple::NSStringToFilePath(MainBundle().bundlePath);
}
NSBundle* OuterBundle() {
@@ -41,7 +41,7 @@
}
FilePath OuterBundlePath() {
- return mac::NSStringToFilePath(OuterBundle().bundlePath);
+ return apple::NSStringToFilePath(OuterBundle().bundlePath);
}
NSBundle* FrameworkBundle() {
@@ -52,7 +52,7 @@
}
FilePath FrameworkBundlePath() {
- return mac::NSStringToFilePath(FrameworkBundle().bundlePath);
+ return apple::NSStringToFilePath(FrameworkBundle().bundlePath);
}
namespace {
@@ -62,7 +62,7 @@
return nil;
}
- NSBundle* bundle = [NSBundle bundleWithURL:mac::FilePathToNSURL(file_path)];
+ NSBundle* bundle = [NSBundle bundleWithURL:apple::FilePathToNSURL(file_path)];
CHECK(bundle) << "Failed to load the bundle at " << file_path.value();
return bundle;
diff --git a/base/apple/foundation_util.h b/base/apple/foundation_util.h
new file mode 100644
index 0000000..d1d8e05
--- /dev/null
+++ b/base/apple/foundation_util.h
@@ -0,0 +1,321 @@
+// Copyright 2012 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_APPLE_FOUNDATION_UTIL_H_
+#define BASE_APPLE_FOUNDATION_UTIL_H_
+
+#include <AvailabilityMacros.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include <CoreText/CoreText.h>
+#include <Security/Security.h>
+
+#include <string>
+
+#include "base/apple/scoped_cftyperef.h"
+#include "base/base_export.h"
+#include "base/logging.h"
+#include "build/build_config.h"
+
+#if defined(__OBJC__)
+#import <Foundation/Foundation.h>
+@class NSFont;
+@class UIFont;
+#endif // __OBJC__
+
+namespace base {
+class FilePath;
+}
+
+namespace base::apple {
+
+// Returns true if the application is running from a bundle
+BASE_EXPORT bool AmIBundled();
+BASE_EXPORT void SetOverrideAmIBundled(bool value);
+
+#if defined(UNIT_TEST)
+// This is required because instantiating some tests requires checking the
+// directory structure, which sets the AmIBundled cache state. Individual tests
+// may or may not be bundled, and this would trip them up if the cache weren't
+// cleared. This should not be called from individual tests, just from test
+// instantiation code that gets a path from PathService.
+BASE_EXPORT void ClearAmIBundledCache();
+#endif
+
+// Returns true if this process is marked as a "Background only process".
+BASE_EXPORT bool IsBackgroundOnlyProcess();
+
+// Returns the path to a resource within the framework bundle.
+BASE_EXPORT FilePath PathForFrameworkBundleResource(const char* resource_name);
+
+// Returns the creator code associated with the CFBundleRef at bundle.
+OSType CreatorCodeForCFBundleRef(CFBundleRef bundle);
+
+// Returns the creator code associated with this application, by calling
+// CreatorCodeForCFBundleRef for the application's main bundle. If this
+// information cannot be determined, returns kUnknownType ('????'). This
+// does not respect the override app bundle because it's based on CFBundle
+// instead of NSBundle, and because callers probably don't want the override
+// app bundle's creator code anyway.
+BASE_EXPORT OSType CreatorCodeForApplication();
+
+#if defined(__OBJC__)
+
+// Searches for directories for the given key in only the given |domain_mask|.
+// If found, fills result (which must always be non-NULL) with the
+// first found directory and returns true. Otherwise, returns false.
+BASE_EXPORT bool GetSearchPathDirectory(NSSearchPathDirectory directory,
+ NSSearchPathDomainMask domain_mask,
+ FilePath* result);
+
+// Searches for directories for the given key in only the local domain.
+// If found, fills result (which must always be non-NULL) with the
+// first found directory and returns true. Otherwise, returns false.
+BASE_EXPORT bool GetLocalDirectory(NSSearchPathDirectory directory,
+ FilePath* result);
+
+// Searches for directories for the given key in only the user domain.
+// If found, fills result (which must always be non-NULL) with the
+// first found directory and returns true. Otherwise, returns false.
+BASE_EXPORT bool GetUserDirectory(NSSearchPathDirectory directory,
+ FilePath* result);
+
+#endif // __OBJC__
+
+// Returns the ~/Library directory.
+BASE_EXPORT FilePath GetUserLibraryPath();
+
+// Returns the ~/Documents directory.
+BASE_EXPORT FilePath GetUserDocumentPath();
+
+// Takes a path to an (executable) binary and tries to provide the path to an
+// application bundle containing it. It takes the outermost bundle that it can
+// find (so for "/Foo/Bar.app/.../Baz.app/..." it produces "/Foo/Bar.app").
+// |exec_name| - path to the binary
+// returns - path to the application bundle, or empty on error
+BASE_EXPORT FilePath GetAppBundlePath(const FilePath& exec_name);
+
+// Takes a path to an (executable) binary and tries to provide the path to an
+// application bundle containing it. It takes the innermost bundle that it can
+// find (so for "/Foo/Bar.app/.../Baz.app/..." it produces
+// "/Foo/Bar.app/.../Baz.app").
+// |exec_name| - path to the binary
+// returns - path to the application bundle, or empty on error
+BASE_EXPORT FilePath GetInnermostAppBundlePath(const FilePath& exec_name);
+
+#define TYPE_NAME_FOR_CF_TYPE_DECL(TypeCF) \
+ BASE_EXPORT std::string TypeNameForCFType(TypeCF##Ref)
+
+TYPE_NAME_FOR_CF_TYPE_DECL(CFArray);
+TYPE_NAME_FOR_CF_TYPE_DECL(CFBag);
+TYPE_NAME_FOR_CF_TYPE_DECL(CFBoolean);
+TYPE_NAME_FOR_CF_TYPE_DECL(CFData);
+TYPE_NAME_FOR_CF_TYPE_DECL(CFDate);
+TYPE_NAME_FOR_CF_TYPE_DECL(CFDictionary);
+TYPE_NAME_FOR_CF_TYPE_DECL(CFNull);
+TYPE_NAME_FOR_CF_TYPE_DECL(CFNumber);
+TYPE_NAME_FOR_CF_TYPE_DECL(CFSet);
+TYPE_NAME_FOR_CF_TYPE_DECL(CFString);
+TYPE_NAME_FOR_CF_TYPE_DECL(CFURL);
+TYPE_NAME_FOR_CF_TYPE_DECL(CFUUID);
+
+TYPE_NAME_FOR_CF_TYPE_DECL(CGColor);
+
+TYPE_NAME_FOR_CF_TYPE_DECL(CTFont);
+TYPE_NAME_FOR_CF_TYPE_DECL(CTRun);
+
+TYPE_NAME_FOR_CF_TYPE_DECL(SecAccessControl);
+TYPE_NAME_FOR_CF_TYPE_DECL(SecCertificate);
+TYPE_NAME_FOR_CF_TYPE_DECL(SecKey);
+TYPE_NAME_FOR_CF_TYPE_DECL(SecPolicy);
+
+#undef TYPE_NAME_FOR_CF_TYPE_DECL
+
+// Returns the base bundle ID, which can be set by SetBaseBundleID but
+// defaults to a reasonable string. This never returns NULL. BaseBundleID
+// returns a pointer to static storage that must not be freed.
+BASE_EXPORT const char* BaseBundleID();
+
+// Sets the base bundle ID to override the default. The implementation will
+// make its own copy of new_base_bundle_id.
+BASE_EXPORT void SetBaseBundleID(const char* new_base_bundle_id);
+
+// CFCast<>() and CFCastStrict<>() cast a basic CFTypeRef to a more
+// specific CoreFoundation type. The compatibility of the passed
+// object is found by comparing its opaque type against the
+// requested type identifier. If the supplied object is not
+// compatible with the requested return type, CFCast<>() returns
+// NULL and CFCastStrict<>() will DCHECK. Providing a NULL pointer
+// to either variant results in NULL being returned without
+// triggering any DCHECK.
+//
+// Example usage:
+// CFNumberRef some_number = base::apple::CFCast<CFNumberRef>(
+// CFArrayGetValueAtIndex(array, index));
+//
+// CFTypeRef hello = CFSTR("hello world");
+// CFStringRef some_string = base::apple::CFCastStrict<CFStringRef>(hello);
+
+template <typename T>
+T CFCast(const CFTypeRef& cf_val);
+
+template <typename T>
+T CFCastStrict(const CFTypeRef& cf_val);
+
+#define CF_CAST_DECL(TypeCF) \
+ template <> \
+ BASE_EXPORT TypeCF##Ref CFCast<TypeCF##Ref>(const CFTypeRef& cf_val); \
+ \
+ template <> \
+ BASE_EXPORT TypeCF##Ref CFCastStrict<TypeCF##Ref>(const CFTypeRef& cf_val)
+
+CF_CAST_DECL(CFArray);
+CF_CAST_DECL(CFBag);
+CF_CAST_DECL(CFBoolean);
+CF_CAST_DECL(CFData);
+CF_CAST_DECL(CFDate);
+CF_CAST_DECL(CFDictionary);
+CF_CAST_DECL(CFNull);
+CF_CAST_DECL(CFNumber);
+CF_CAST_DECL(CFSet);
+CF_CAST_DECL(CFString);
+CF_CAST_DECL(CFURL);
+CF_CAST_DECL(CFUUID);
+
+CF_CAST_DECL(CGColor);
+
+CF_CAST_DECL(CTFont);
+CF_CAST_DECL(CTFontDescriptor);
+CF_CAST_DECL(CTRun);
+
+CF_CAST_DECL(SecAccessControl);
+CF_CAST_DECL(SecCertificate);
+CF_CAST_DECL(SecKey);
+CF_CAST_DECL(SecPolicy);
+
+#undef CF_CAST_DECL
+
+#if defined(__OBJC__)
+
+// ObjCCast<>() and ObjCCastStrict<>() cast a basic id to a more
+// specific (NSObject-derived) type. The compatibility of the passed
+// object is found by checking if it's a kind of the requested type
+// identifier. If the supplied object is not compatible with the
+// requested return type, ObjCCast<>() returns nil and
+// ObjCCastStrict<>() will DCHECK. Providing a nil pointer to either
+// variant results in nil being returned without triggering any DCHECK.
+//
+// The strict variant is useful when retrieving a value from a
+// collection which only has values of a specific type, e.g. an
+// NSArray of NSStrings. The non-strict variant is useful when
+// retrieving values from data that you can't fully control. For
+// example, a plist read from disk may be beyond your exclusive
+// control, so you'd only want to check that the values you retrieve
+// from it are of the expected types, but not crash if they're not.
+//
+// Example usage:
+// NSString* version = base::apple::ObjCCast<NSString>(
+// [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]);
+//
+// NSString* str = base::apple::ObjCCastStrict<NSString>(
+// [ns_arr_of_ns_strs objectAtIndex:0]);
+template <typename T>
+T* ObjCCast(id objc_val) {
+ if ([objc_val isKindOfClass:[T class]]) {
+ return reinterpret_cast<T*>(objc_val);
+ }
+ return nil;
+}
+
+template <typename T>
+T* ObjCCastStrict(id objc_val) {
+ T* rv = ObjCCast<T>(objc_val);
+ DCHECK(objc_val == nil || rv);
+ return rv;
+}
+
+#endif // defined(__OBJC__)
+
+// Helper function for GetValueFromDictionary to create the error message
+// that appears when a type mismatch is encountered.
+BASE_EXPORT std::string GetValueFromDictionaryErrorMessage(
+ CFStringRef key,
+ const std::string& expected_type,
+ CFTypeRef value);
+
+// Utility function to pull out a value from a dictionary, check its type, and
+// return it. Returns NULL if the key is not present or of the wrong type.
+template <typename T>
+T GetValueFromDictionary(CFDictionaryRef dict, CFStringRef key) {
+ CFTypeRef value = CFDictionaryGetValue(dict, key);
+ T value_specific = CFCast<T>(value);
+
+ if (value && !value_specific) {
+ std::string expected_type = TypeNameForCFType(value_specific);
+ DLOG(WARNING) << GetValueFromDictionaryErrorMessage(key, expected_type,
+ value);
+ }
+
+ return value_specific;
+}
+
+#if defined(__OBJC__)
+
+// Converts |path| to an autoreleased NSURL. Returns nil if |path| is empty.
+BASE_EXPORT NSURL* FilePathToNSURL(const FilePath& path);
+
+// Converts |path| to an autoreleased NSString. Returns nil if |path| is empty.
+BASE_EXPORT NSString* FilePathToNSString(const FilePath& path);
+
+// Converts |str| to a FilePath. Returns an empty path if |str| is nil.
+BASE_EXPORT FilePath NSStringToFilePath(NSString* str);
+
+// Converts |url| to a FilePath. Returns an empty path if |url| is nil or if
+// |url| is not of scheme "file".
+BASE_EXPORT FilePath NSURLToFilePath(NSURL* url);
+
+#endif // __OBJC__
+
+// Converts a non-null |path| to a CFURLRef. |path| must not be empty.
+//
+// This function only uses manually-owned resources, so it does not depend on an
+// NSAutoreleasePool being set up on the current thread.
+BASE_EXPORT ScopedCFTypeRef<CFURLRef> FilePathToCFURL(const FilePath& path);
+
+#if defined(__OBJC__)
+// Converts |range| to an NSRange, returning the new range in |range_out|.
+// Returns true if conversion was successful, false if the values of |range|
+// could not be converted to NSUIntegers.
+[[nodiscard]] BASE_EXPORT bool CFRangeToNSRange(CFRange range,
+ NSRange* range_out);
+#endif // defined(__OBJC__)
+
+} // namespace base::apple
+
+// Stream operations for CFTypes. They can be used with Objective-C types as
+// well by using the casting methods in base/apple/bridging.h.
+//
+// For example: LOG(INFO) << base::apple::NSToCFPtrCast(@"foo");
+//
+// operator<<() can not be overloaded for Objective-C types as the compiler
+// cannot distinguish between overloads for id with overloads for void*.
+BASE_EXPORT extern std::ostream& operator<<(std::ostream& o,
+ const CFErrorRef err);
+BASE_EXPORT extern std::ostream& operator<<(std::ostream& o,
+ const CFStringRef str);
+BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, CFRange);
+
+#if defined(__OBJC__)
+BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, id);
+BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, NSRange);
+BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, SEL);
+
+#if BUILDFLAG(IS_MAC)
+BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, NSPoint);
+BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, NSRect);
+BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, NSSize);
+#endif // IS_MAC
+
+#endif // __OBJC__
+
+#endif // BASE_APPLE_FOUNDATION_UTIL_H_
diff --git a/base/mac/foundation_util.mm b/base/apple/foundation_util.mm
similarity index 86%
rename from base/mac/foundation_util.mm
rename to base/apple/foundation_util.mm
index 7c291f0..a4936c9 100644
--- a/base/mac/foundation_util.mm
+++ b/base/apple/foundation_util.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include <stddef.h>
#include <stdlib.h>
@@ -32,7 +32,7 @@
CFTypeID SecKeyGetTypeID();
} // extern "C"
-namespace base::mac {
+namespace base::apple {
namespace {
@@ -46,8 +46,9 @@
// All apps are bundled on iOS.
return true;
#else
- if (g_override_am_i_bundled)
+ if (g_override_am_i_bundled) {
return g_override_am_i_bundled_value;
+ }
// Yes, this is cheap.
return [apple::OuterBundle().bundlePath hasSuffix:@".app"];
@@ -74,8 +75,9 @@
void SetOverrideAmIBundled(bool value) {
#if BUILDFLAG(IS_IOS)
// It doesn't make sense not to be bundled on iOS.
- if (!value)
+ if (!value) {
NOTREACHED();
+ }
#endif
g_override_am_i_bundled = true;
g_override_am_i_bundled_value = value;
@@ -110,8 +112,9 @@
OSType CreatorCodeForApplication() {
CFBundleRef bundle = CFBundleGetMainBundle();
- if (!bundle)
+ if (!bundle) {
return kUnknownType;
+ }
return CreatorCodeForCFBundleRef(bundle);
}
@@ -166,8 +169,9 @@
std::vector<std::string> components = exec_name.GetComponents();
// It's an error if we don't get any components.
- if (components.empty())
+ if (components.empty()) {
return FilePath();
+ }
// Don't prepend '/' to the first component.
std::vector<std::string>::const_iterator it = components.begin();
@@ -175,13 +179,15 @@
DCHECK_GT(it->length(), 0U);
// If the first component ends in ".app", we're already done.
if (it->length() > kExtLength &&
- !it->compare(it->length() - kExtLength, kExtLength, kExt, kExtLength))
+ !it->compare(it->length() - kExtLength, kExtLength, kExt, kExtLength)) {
return FilePath(bundle_name);
+ }
// The first component may be "/" or "//", etc. Only append '/' if it doesn't
// already end in '/'.
- if (bundle_name.back() != '/')
+ if (bundle_name.back() != '/') {
bundle_name += '/';
+ }
// Go through the remaining components.
for (++it; it != components.end(); ++it) {
@@ -191,8 +197,9 @@
// If the current component ends in ".app", we're done.
if (it->length() > kExtLength &&
- !it->compare(it->length() - kExtLength, kExtLength, kExt, kExtLength))
+ !it->compare(it->length() - kExtLength, kExtLength, kExt, kExtLength)) {
return FilePath(bundle_name);
+ }
// Separate this component from the next one.
bundle_name += '/';
@@ -246,10 +253,10 @@
return FilePath(bundle_path);
}
-#define TYPE_NAME_FOR_CF_TYPE_DEFN(TypeCF) \
-std::string TypeNameForCFType(TypeCF##Ref) { \
- return #TypeCF; \
-}
+#define TYPE_NAME_FOR_CF_TYPE_DEFN(TypeCF) \
+ std::string TypeNameForCFType(TypeCF##Ref) { \
+ return #TypeCF; \
+ }
TYPE_NAME_FOR_CF_TYPE_DEFN(CFArray)
TYPE_NAME_FOR_CF_TYPE_DEFN(CFBag)
@@ -299,24 +306,24 @@
}
}
-#define CF_CAST_DEFN(TypeCF) \
-template<> TypeCF##Ref \
-CFCast<TypeCF##Ref>(const CFTypeRef& cf_val) { \
- if (cf_val == NULL) { \
- return NULL; \
- } \
- if (CFGetTypeID(cf_val) == TypeCF##GetTypeID()) { \
- return (TypeCF##Ref)(cf_val); \
- } \
- return NULL; \
-} \
-\
-template<> TypeCF##Ref \
-CFCastStrict<TypeCF##Ref>(const CFTypeRef& cf_val) { \
- TypeCF##Ref rv = CFCast<TypeCF##Ref>(cf_val); \
- DCHECK(cf_val == NULL || rv); \
- return rv; \
-}
+#define CF_CAST_DEFN(TypeCF) \
+ template <> \
+ TypeCF##Ref CFCast<TypeCF##Ref>(const CFTypeRef& cf_val) { \
+ if (cf_val == NULL) { \
+ return NULL; \
+ } \
+ if (CFGetTypeID(cf_val) == TypeCF##GetTypeID()) { \
+ return (TypeCF##Ref)(cf_val); \
+ } \
+ return NULL; \
+ } \
+ \
+ template <> \
+ TypeCF##Ref CFCastStrict<TypeCF##Ref>(const CFTypeRef& cf_val) { \
+ TypeCF##Ref rv = CFCast<TypeCF##Ref>(cf_val); \
+ DCHECK(cf_val == NULL || rv); \
+ return rv; \
+ }
CF_CAST_DEFN(CFArray)
CF_CAST_DEFN(CFBag)
@@ -347,8 +354,9 @@
#undef CF_CAST_DEFN
-std::string GetValueFromDictionaryErrorMessage(
- CFStringRef key, const std::string& expected_type, CFTypeRef value) {
+std::string GetValueFromDictionaryErrorMessage(CFStringRef key,
+ const std::string& expected_type,
+ CFTypeRef value) {
ScopedCFTypeRef<CFStringRef> actual_type_ref(
CFCopyTypeIDDescription(CFGetTypeID(value)));
return "Expected value for key " + SysCFStringRefToUTF8(key) + " to be " +
@@ -357,14 +365,16 @@
}
NSURL* FilePathToNSURL(const FilePath& path) {
- if (NSString* path_string = FilePathToNSString(path))
+ if (NSString* path_string = FilePathToNSString(path)) {
return [NSURL fileURLWithPath:path_string];
+ }
return nil;
}
NSString* FilePathToNSString(const FilePath& path) {
- if (path.empty())
+ if (path.empty()) {
return nil;
+ }
return @(path.value().c_str()); // @() does UTF8 conversion.
}
@@ -393,8 +403,9 @@
kCFAllocatorDefault, reinterpret_cast<const UInt8*>(path_string.data()),
checked_cast<CFIndex>(path_string.length()), kCFStringEncodingUTF8,
/*isExternalRepresentation=*/FALSE));
- if (!path_cfstring)
+ if (!path_cfstring) {
return ScopedCFTypeRef<CFURLRef>();
+ }
return ScopedCFTypeRef<CFURLRef>(CFURLCreateWithFileSystemPath(
kCFAllocatorDefault, path_cfstring, kCFURLPOSIXPathStyle,
@@ -414,7 +425,7 @@
return false;
}
-} // namespace base::mac
+} // namespace base::apple
std::ostream& operator<<(std::ostream& o, const CFStringRef string) {
return o << base::SysCFStringRefToUTF8(string);
@@ -428,10 +439,9 @@
errorDesc = reinterpret_cast<CFStringRef>(
CFDictionaryGetValue(user_info.get(), kCFErrorDescriptionKey));
}
- o << "Code: " << CFErrorGetCode(err)
- << " Domain: " << CFErrorGetDomain(err)
+ o << "Code: " << CFErrorGetCode(err) << " Domain: " << CFErrorGetDomain(err)
<< " Desc: " << desc.get();
- if(errorDesc) {
+ if (errorDesc) {
o << "(" << errorDesc << ")";
}
return o;
diff --git a/base/apple/foundation_util_unittest.mm b/base/apple/foundation_util_unittest.mm
index 97882cc..fb845dd 100644
--- a/base/apple/foundation_util_unittest.mm
+++ b/base/apple/foundation_util_unittest.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include <CoreFoundation/CoreFoundation.h>
#include <Foundation/Foundation.h>
@@ -17,7 +17,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
-namespace base::mac {
+namespace base::apple {
TEST(FoundationUtilTest, CFCast) {
// Build out the CF types to be tested as empty containers.
@@ -418,4 +418,4 @@
EXPECT_LOG_EQ("{0, 100}", NSMakeRange(0, 100));
}
-} // namespace base::mac
+} // namespace base::apple
diff --git a/base/base_paths_ios.mm b/base/base_paths_ios.mm
index 417360a..6ddcd38 100644
--- a/base/base_paths_ios.mm
+++ b/base/base_paths_ios.mm
@@ -8,11 +8,11 @@
#import <Foundation/Foundation.h>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/base_paths.h"
#include "base/base_paths_apple.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
-#include "base/mac/foundation_util.h"
#include "base/path_service.h"
namespace base {
@@ -25,7 +25,8 @@
case base::DIR_APP_DATA: {
base::FilePath path;
- if (!base::mac::GetUserDirectory(NSApplicationSupportDirectory, &path)) {
+ if (!base::apple::GetUserDirectory(NSApplicationSupportDirectory,
+ &path)) {
return false;
}
@@ -58,7 +59,7 @@
return true;
case base::DIR_CACHE:
- return base::mac::GetUserDirectory(NSCachesDirectory, result);
+ return base::apple::GetUserDirectory(NSCachesDirectory, result);
default:
return false;
diff --git a/base/base_paths_mac.mm b/base/base_paths_mac.mm
index 7b0372bd..8f5c8bd 100644
--- a/base/base_paths_mac.mm
+++ b/base/base_paths_mac.mm
@@ -8,11 +8,11 @@
#import <Foundation/Foundation.h>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/base_paths.h"
#include "base/base_paths_apple.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
-#include "base/mac/foundation_util.h"
#include "base/notreached.h"
#include "base/path_service.h"
@@ -28,7 +28,7 @@
result, reinterpret_cast<const void*>(&base::PathProviderMac));
case base::DIR_APP_DATA: {
bool success =
- base::mac::GetUserDirectory(NSApplicationSupportDirectory, result);
+ base::apple::GetUserDirectory(NSApplicationSupportDirectory, result);
return success;
}
case base::DIR_SRC_TEST_DATA_ROOT:
@@ -40,7 +40,7 @@
// Start with the executable's directory.
*result = result->DirName();
- if (base::mac::AmIBundled()) {
+ if (base::apple::AmIBundled()) {
// The bundled app executables (Chromium, TestShell, etc) live five
// levels down, eg:
// src/xcodebuild/{Debug|Release}/Chromium.app/Contents/MacOS/Chromium
@@ -52,16 +52,16 @@
}
return true;
case base::DIR_USER_DESKTOP:
- return base::mac::GetUserDirectory(NSDesktopDirectory, result);
+ return base::apple::GetUserDirectory(NSDesktopDirectory, result);
case base::DIR_ASSETS:
- if (!base::mac::AmIBundled()) {
+ if (!base::apple::AmIBundled()) {
return PathService::Get(base::DIR_MODULE, result);
}
*result = base::apple::FrameworkBundlePath().Append(
FILE_PATH_LITERAL("Resources"));
return true;
case base::DIR_CACHE:
- return base::mac::GetUserDirectory(NSCachesDirectory, result);
+ return base::apple::GetUserDirectory(NSCachesDirectory, result);
default:
return false;
}
diff --git a/base/enterprise_util_mac.mm b/base/enterprise_util_mac.mm
index fd14573..1977180 100644
--- a/base/enterprise_util_mac.mm
+++ b/base/enterprise_util_mac.mm
@@ -9,8 +9,8 @@
#include <string>
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/process/launch.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -181,12 +181,13 @@
}
for (id element in results) {
- ODRecord* record = mac::ObjCCastStrict<ODRecord>(element);
+ ODRecord* record = base::apple::ObjCCastStrict<ODRecord>(element);
NSArray* attributes =
[record valuesForAttribute:kODAttributeTypeMetaRecordName
error:nil];
for (id attribute in attributes) {
- NSString* attribute_value = mac::ObjCCastStrict<NSString>(attribute);
+ NSString* attribute_value =
+ base::apple::ObjCCastStrict<NSString>(attribute);
// Example: "uid=johnsmith,ou=People,dc=chromium,dc=org
NSRange domain_controller =
[attribute_value rangeOfString:@"(^|,)\\s*dc="
@@ -201,7 +202,8 @@
[record valuesForAttribute:kODAttributeTypeAltSecurityIdentities
error:nil];
for (id attribute in attributes) {
- NSString* attribute_value = mac::ObjCCastStrict<NSString>(attribute);
+ NSString* attribute_value =
+ base::apple::ObjCCastStrict<NSString>(attribute);
NSRange icloud =
[attribute_value rangeOfString:@"CN=com.apple.idms.appleid.prd"
options:NSCaseInsensitiveSearch];
diff --git a/base/file_version_info_apple.mm b/base/file_version_info_apple.mm
index d8530ea..ef5a2994 100644
--- a/base/file_version_info_apple.mm
+++ b/base/file_version_info_apple.mm
@@ -8,8 +8,8 @@
#include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "build/build_config.h"
diff --git a/base/files/file_util_apple.mm b/base/files/file_util_apple.mm
index 111674ac..39f8d2c 100644
--- a/base/files/file_util_apple.mm
+++ b/base/files/file_util_apple.mm
@@ -9,9 +9,9 @@
#include <stdlib.h>
#include <string.h>
+#include "base/apple/foundation_util.h"
#include "base/check_op.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/string_util.h"
#include "base/threading/scoped_blocking_call.h"
@@ -45,14 +45,14 @@
if (tmp == nil) {
return false;
}
- *path = base::mac::NSStringToFilePath(tmp);
+ *path = base::apple::NSStringToFilePath(tmp);
return true;
}
FilePath GetHomeDir() {
NSString* tmp = NSHomeDirectory();
if (tmp != nil) {
- FilePath mac_home_dir = base::mac::NSStringToFilePath(tmp);
+ FilePath mac_home_dir = base::apple::NSStringToFilePath(tmp);
if (!mac_home_dir.empty()) {
return mac_home_dir;
}
diff --git a/base/files/file_util_posix.cc b/base/files/file_util_posix.cc
index ec286042..9ccf749 100644
--- a/base/files/file_util_posix.cc
+++ b/base/files/file_util_posix.cc
@@ -51,7 +51,7 @@
#if BUILDFLAG(IS_APPLE)
#include <AvailabilityMacros.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
@@ -690,7 +690,7 @@
FilePath FormatTemporaryFileName(FilePath::StringPieceType identifier) {
#if BUILDFLAG(IS_APPLE)
- StringPiece prefix = base::mac::BaseBundleID();
+ StringPiece prefix = base::apple::BaseBundleID();
#elif BUILDFLAG(GOOGLE_CHROME_BRANDING)
StringPiece prefix = "com.google.Chrome";
#else
diff --git a/base/i18n/icu_util.cc b/base/i18n/icu_util.cc
index 045fbb8..b62e461 100644
--- a/base/i18n/icu_util.cc
+++ b/base/i18n/icu_util.cc
@@ -40,7 +40,7 @@
#endif
#if BUILDFLAG(IS_APPLE)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
#if BUILDFLAG(IS_FUCHSIA)
@@ -167,7 +167,7 @@
#else // !BUILDFLAG(IS_APPLE)
// Assume it is in the framework bundle's Resources directory.
- FilePath data_path = mac::PathForFrameworkBundleResource(kIcuDataFileName);
+ FilePath data_path = apple::PathForFrameworkBundleResource(kIcuDataFileName);
#if BUILDFLAG(IS_IOS)
FilePath override_data_path = ios::FilePathOfEmbeddedICU();
if (!override_data_path.empty()) {
diff --git a/base/ios/ios_util.mm b/base/ios/ios_util.mm
index fdb715c..6ada7304 100644
--- a/base/ios/ios_util.mm
+++ b/base/ios/ios_util.mm
@@ -8,8 +8,8 @@
#import <UIKit/UIKit.h>
#include <stddef.h>
+#include "base/apple/foundation_util.h"
#import "base/ios/device_util.h"
-#include "base/mac/foundation_util.h"
#include "base/system/sys_info.h"
namespace {
diff --git a/base/mac/authorization_util.mm b/base/mac/authorization_util.mm
index bd3dd00..e276960 100644
--- a/base/mac/authorization_util.mm
+++ b/base/mac/authorization_util.mm
@@ -11,9 +11,9 @@
#include <string>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/scoped_authorizationref.h"
#include "base/posix/eintr_wrapper.h"
#include "base/strings/string_number_conversions.h"
diff --git a/base/mac/foundation_util.h b/base/mac/foundation_util.h
index e515070..7bcf8fe 100644
--- a/base/mac/foundation_util.h
+++ b/base/mac/foundation_util.h
@@ -1,320 +1,43 @@
-// Copyright 2012 The Chromium Authors
+// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_MAC_FOUNDATION_UTIL_H_
#define BASE_MAC_FOUNDATION_UTIL_H_
-#include <AvailabilityMacros.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include <CoreText/CoreText.h>
-#include <Security/Security.h>
-
-#include <string>
-
-#include "base/apple/scoped_cftyperef.h"
-#include "base/base_export.h"
-#include "base/logging.h"
-#include "build/build_config.h"
+#include "base/apple/foundation_util.h"
#if defined(__OBJC__)
#import <Foundation/Foundation.h>
-@class NSFont;
-@class UIFont;
#endif // __OBJC__
-namespace base {
-class FilePath;
-}
+// This is a forwarding header so that Crashpad can continue to build correctly
+// until mini_chromium and then it are updated and rolled.
+
+// TODO(https://crbug.com/1444927): Update mini_chromium, update Crashpad, roll
+// Crashpad, and then delete this forwarding header.
namespace base::mac {
-// Returns true if the application is running from a bundle
-BASE_EXPORT bool AmIBundled();
-BASE_EXPORT void SetOverrideAmIBundled(bool value);
+template <typename T>
+T CFCast(const CFTypeRef& cf_val) {
+ return base::apple::CFCast<T>(cf_val);
+}
-#if defined(UNIT_TEST)
-// This is required because instantiating some tests requires checking the
-// directory structure, which sets the AmIBundled cache state. Individual tests
-// may or may not be bundled, and this would trip them up if the cache weren't
-// cleared. This should not be called from individual tests, just from test
-// instantiation code that gets a path from PathService.
-BASE_EXPORT void ClearAmIBundledCache();
-#endif
-
-// Returns true if this process is marked as a "Background only process".
-BASE_EXPORT bool IsBackgroundOnlyProcess();
-
-// Returns the path to a resource within the framework bundle.
-BASE_EXPORT FilePath PathForFrameworkBundleResource(const char* resource_name);
-
-// Returns the creator code associated with the CFBundleRef at bundle.
-OSType CreatorCodeForCFBundleRef(CFBundleRef bundle);
-
-// Returns the creator code associated with this application, by calling
-// CreatorCodeForCFBundleRef for the application's main bundle. If this
-// information cannot be determined, returns kUnknownType ('????'). This
-// does not respect the override app bundle because it's based on CFBundle
-// instead of NSBundle, and because callers probably don't want the override
-// app bundle's creator code anyway.
-BASE_EXPORT OSType CreatorCodeForApplication();
+template <typename T>
+T CFCastStrict(const CFTypeRef& cf_val) {
+ return base::apple::CFCastStrict<T>(cf_val);
+}
#if defined(__OBJC__)
-// Searches for directories for the given key in only the given |domain_mask|.
-// If found, fills result (which must always be non-NULL) with the
-// first found directory and returns true. Otherwise, returns false.
-BASE_EXPORT bool GetSearchPathDirectory(NSSearchPathDirectory directory,
- NSSearchPathDomainMask domain_mask,
- FilePath* result);
-
-// Searches for directories for the given key in only the local domain.
-// If found, fills result (which must always be non-NULL) with the
-// first found directory and returns true. Otherwise, returns false.
-BASE_EXPORT bool GetLocalDirectory(NSSearchPathDirectory directory,
- FilePath* result);
-
-// Searches for directories for the given key in only the user domain.
-// If found, fills result (which must always be non-NULL) with the
-// first found directory and returns true. Otherwise, returns false.
-BASE_EXPORT bool GetUserDirectory(NSSearchPathDirectory directory,
- FilePath* result);
-
-#endif // __OBJC__
-
-// Returns the ~/Library directory.
-BASE_EXPORT FilePath GetUserLibraryPath();
-
-// Returns the ~/Documents directory.
-BASE_EXPORT FilePath GetUserDocumentPath();
-
-// Takes a path to an (executable) binary and tries to provide the path to an
-// application bundle containing it. It takes the outermost bundle that it can
-// find (so for "/Foo/Bar.app/.../Baz.app/..." it produces "/Foo/Bar.app").
-// |exec_name| - path to the binary
-// returns - path to the application bundle, or empty on error
-BASE_EXPORT FilePath GetAppBundlePath(const FilePath& exec_name);
-
-// Takes a path to an (executable) binary and tries to provide the path to an
-// application bundle containing it. It takes the innermost bundle that it can
-// find (so for "/Foo/Bar.app/.../Baz.app/..." it produces
-// "/Foo/Bar.app/.../Baz.app").
-// |exec_name| - path to the binary
-// returns - path to the application bundle, or empty on error
-BASE_EXPORT FilePath GetInnermostAppBundlePath(const FilePath& exec_name);
-
-#define TYPE_NAME_FOR_CF_TYPE_DECL(TypeCF) \
- BASE_EXPORT std::string TypeNameForCFType(TypeCF##Ref)
-
-TYPE_NAME_FOR_CF_TYPE_DECL(CFArray);
-TYPE_NAME_FOR_CF_TYPE_DECL(CFBag);
-TYPE_NAME_FOR_CF_TYPE_DECL(CFBoolean);
-TYPE_NAME_FOR_CF_TYPE_DECL(CFData);
-TYPE_NAME_FOR_CF_TYPE_DECL(CFDate);
-TYPE_NAME_FOR_CF_TYPE_DECL(CFDictionary);
-TYPE_NAME_FOR_CF_TYPE_DECL(CFNull);
-TYPE_NAME_FOR_CF_TYPE_DECL(CFNumber);
-TYPE_NAME_FOR_CF_TYPE_DECL(CFSet);
-TYPE_NAME_FOR_CF_TYPE_DECL(CFString);
-TYPE_NAME_FOR_CF_TYPE_DECL(CFURL);
-TYPE_NAME_FOR_CF_TYPE_DECL(CFUUID);
-
-TYPE_NAME_FOR_CF_TYPE_DECL(CGColor);
-
-TYPE_NAME_FOR_CF_TYPE_DECL(CTFont);
-TYPE_NAME_FOR_CF_TYPE_DECL(CTRun);
-
-TYPE_NAME_FOR_CF_TYPE_DECL(SecAccessControl);
-TYPE_NAME_FOR_CF_TYPE_DECL(SecCertificate);
-TYPE_NAME_FOR_CF_TYPE_DECL(SecKey);
-TYPE_NAME_FOR_CF_TYPE_DECL(SecPolicy);
-
-#undef TYPE_NAME_FOR_CF_TYPE_DECL
-
-// Returns the base bundle ID, which can be set by SetBaseBundleID but
-// defaults to a reasonable string. This never returns NULL. BaseBundleID
-// returns a pointer to static storage that must not be freed.
-BASE_EXPORT const char* BaseBundleID();
-
-// Sets the base bundle ID to override the default. The implementation will
-// make its own copy of new_base_bundle_id.
-BASE_EXPORT void SetBaseBundleID(const char* new_base_bundle_id);
-
-// CFCast<>() and CFCastStrict<>() cast a basic CFTypeRef to a more
-// specific CoreFoundation type. The compatibility of the passed
-// object is found by comparing its opaque type against the
-// requested type identifier. If the supplied object is not
-// compatible with the requested return type, CFCast<>() returns
-// NULL and CFCastStrict<>() will DCHECK. Providing a NULL pointer
-// to either variant results in NULL being returned without
-// triggering any DCHECK.
-//
-// Example usage:
-// CFNumberRef some_number = base::mac::CFCast<CFNumberRef>(
-// CFArrayGetValueAtIndex(array, index));
-//
-// CFTypeRef hello = CFSTR("hello world");
-// CFStringRef some_string = base::mac::CFCastStrict<CFStringRef>(hello);
-
-template<typename T>
-T CFCast(const CFTypeRef& cf_val);
-
-template<typename T>
-T CFCastStrict(const CFTypeRef& cf_val);
-
-#define CF_CAST_DECL(TypeCF) \
- template <> \
- BASE_EXPORT TypeCF##Ref CFCast<TypeCF##Ref>(const CFTypeRef& cf_val); \
- \
- template <> \
- BASE_EXPORT TypeCF##Ref CFCastStrict<TypeCF##Ref>(const CFTypeRef& cf_val)
-
-CF_CAST_DECL(CFArray);
-CF_CAST_DECL(CFBag);
-CF_CAST_DECL(CFBoolean);
-CF_CAST_DECL(CFData);
-CF_CAST_DECL(CFDate);
-CF_CAST_DECL(CFDictionary);
-CF_CAST_DECL(CFNull);
-CF_CAST_DECL(CFNumber);
-CF_CAST_DECL(CFSet);
-CF_CAST_DECL(CFString);
-CF_CAST_DECL(CFURL);
-CF_CAST_DECL(CFUUID);
-
-CF_CAST_DECL(CGColor);
-
-CF_CAST_DECL(CTFont);
-CF_CAST_DECL(CTFontDescriptor);
-CF_CAST_DECL(CTRun);
-
-CF_CAST_DECL(SecAccessControl);
-CF_CAST_DECL(SecCertificate);
-CF_CAST_DECL(SecKey);
-CF_CAST_DECL(SecPolicy);
-
-#undef CF_CAST_DECL
-
-#if defined(__OBJC__)
-
-// ObjCCast<>() and ObjCCastStrict<>() cast a basic id to a more
-// specific (NSObject-derived) type. The compatibility of the passed
-// object is found by checking if it's a kind of the requested type
-// identifier. If the supplied object is not compatible with the
-// requested return type, ObjCCast<>() returns nil and
-// ObjCCastStrict<>() will DCHECK. Providing a nil pointer to either
-// variant results in nil being returned without triggering any DCHECK.
-//
-// The strict variant is useful when retrieving a value from a
-// collection which only has values of a specific type, e.g. an
-// NSArray of NSStrings. The non-strict variant is useful when
-// retrieving values from data that you can't fully control. For
-// example, a plist read from disk may be beyond your exclusive
-// control, so you'd only want to check that the values you retrieve
-// from it are of the expected types, but not crash if they're not.
-//
-// Example usage:
-// NSString* version = base::mac::ObjCCast<NSString>(
-// [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]);
-//
-// NSString* str = base::mac::ObjCCastStrict<NSString>(
-// [ns_arr_of_ns_strs objectAtIndex:0]);
-template<typename T>
+template <typename T>
T* ObjCCast(id objc_val) {
- if ([objc_val isKindOfClass:[T class]]) {
- return reinterpret_cast<T*>(objc_val);
- }
- return nil;
+ return base::apple::ObjCCast<T>(objc_val);
}
-template<typename T>
-T* ObjCCastStrict(id objc_val) {
- T* rv = ObjCCast<T>(objc_val);
- DCHECK(objc_val == nil || rv);
- return rv;
-}
-
-#endif // defined(__OBJC__)
-
-// Helper function for GetValueFromDictionary to create the error message
-// that appears when a type mismatch is encountered.
-BASE_EXPORT std::string GetValueFromDictionaryErrorMessage(
- CFStringRef key, const std::string& expected_type, CFTypeRef value);
-
-// Utility function to pull out a value from a dictionary, check its type, and
-// return it. Returns NULL if the key is not present or of the wrong type.
-template<typename T>
-T GetValueFromDictionary(CFDictionaryRef dict, CFStringRef key) {
- CFTypeRef value = CFDictionaryGetValue(dict, key);
- T value_specific = CFCast<T>(value);
-
- if (value && !value_specific) {
- std::string expected_type = TypeNameForCFType(value_specific);
- DLOG(WARNING) << GetValueFromDictionaryErrorMessage(key,
- expected_type,
- value);
- }
-
- return value_specific;
-}
-
-#if defined(__OBJC__)
-
-// Converts |path| to an autoreleased NSURL. Returns nil if |path| is empty.
-BASE_EXPORT NSURL* FilePathToNSURL(const FilePath& path);
-
-// Converts |path| to an autoreleased NSString. Returns nil if |path| is empty.
-BASE_EXPORT NSString* FilePathToNSString(const FilePath& path);
-
-// Converts |str| to a FilePath. Returns an empty path if |str| is nil.
-BASE_EXPORT FilePath NSStringToFilePath(NSString* str);
-
-// Converts |url| to a FilePath. Returns an empty path if |url| is nil or if
-// |url| is not of scheme "file".
-BASE_EXPORT FilePath NSURLToFilePath(NSURL* url);
-
#endif // __OBJC__
-// Converts a non-null |path| to a CFURLRef. |path| must not be empty.
-//
-// This function only uses manually-owned resources, so it does not depend on an
-// NSAutoreleasePool being set up on the current thread.
-BASE_EXPORT ScopedCFTypeRef<CFURLRef> FilePathToCFURL(const FilePath& path);
-
-#if defined(__OBJC__)
-// Converts |range| to an NSRange, returning the new range in |range_out|.
-// Returns true if conversion was successful, false if the values of |range|
-// could not be converted to NSUIntegers.
-[[nodiscard]] BASE_EXPORT bool CFRangeToNSRange(CFRange range,
- NSRange* range_out);
-#endif // defined(__OBJC__)
-
} // namespace base::mac
-// Stream operations for CFTypes. They can be used with Objective-C types as
-// well by using the casting methods in base/apple/bridging.h.
-//
-// For example: LOG(INFO) << base::apple::NSToCFPtrCast(@"foo");
-//
-// operator<<() can not be overloaded for Objective-C types as the compiler
-// cannot distinguish between overloads for id with overloads for void*.
-BASE_EXPORT extern std::ostream& operator<<(std::ostream& o,
- const CFErrorRef err);
-BASE_EXPORT extern std::ostream& operator<<(std::ostream& o,
- const CFStringRef str);
-BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, CFRange);
-
-#if defined(__OBJC__)
-BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, id);
-BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, NSRange);
-BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, SEL);
-
-#if BUILDFLAG(IS_MAC)
-BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, NSPoint);
-BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, NSRect);
-BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, NSSize);
-#endif // IS_MAC
-
-#endif // __OBJC__
-
#endif // BASE_MAC_FOUNDATION_UTIL_H_
diff --git a/base/mac/launch_application.mm b/base/mac/launch_application.mm
index bff093001..4b67e4a 100644
--- a/base/mac/launch_application.mm
+++ b/base/mac/launch_application.mm
@@ -5,10 +5,10 @@
#import "base/mac/launch_application.h"
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/functional/callback.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/launch_services_spi.h"
#include "base/mac/mac_util.h"
#include "base/metrics/histogram_functions.h"
@@ -128,7 +128,7 @@
NSArray<NSRunningApplication*>* all_apps =
NSWorkspace.sharedWorkspace.runningApplications;
for (NSRunningApplication* running_app in all_apps) {
- if (NSURLToFilePath(running_app.bundleURL) == app_bundle_path) {
+ if (apple::NSURLToFilePath(running_app.bundleURL) == app_bundle_path) {
LOG(ERROR) << "Launch succeeded despite error: "
<< base::SysNSStringToUTF8(error.localizedDescription);
app = running_app;
@@ -163,7 +163,7 @@
base::BindOnce(&LogResultAndInvokeCallback, app_bundle_path,
options.create_new_instance, std::move(callback));
- NSURL* bundle_url = FilePathToNSURL(app_bundle_path);
+ NSURL* bundle_url = apple::FilePathToNSURL(app_bundle_path);
if (!bundle_url) {
dispatch_async(dispatch_get_main_queue(), ^{
std::move(callback_block_access)
@@ -199,7 +199,7 @@
_LSOpenURLsWithCompletionHandler(
base::apple::NSToCFPtrCast(ns_urls ? ns_urls : @[]),
- mac::FilePathToCFURL(app_bundle_path),
+ apple::FilePathToCFURL(app_bundle_path),
base::apple::NSToCFPtrCast(GetOpenOptions(options, command_line_args)),
action_block);
return;
diff --git a/base/mac/launch_application_unittest.mm b/base/mac/launch_application_unittest.mm
index b11f02ed..5e4d39c8a 100644
--- a/base/mac/launch_application_unittest.mm
+++ b/base/mac/launch_application_unittest.mm
@@ -7,13 +7,13 @@
#include <sys/select.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/base_paths.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/path_service.h"
#include "base/process/launch.h"
@@ -53,7 +53,7 @@
while ((end_of_plist = data.find("</plist>")) != std::string::npos) {
std::string plist = data.substr(0, end_of_plist + 8);
data = data.substr(plist.length());
- NSDictionary* event = ObjCCastStrict<NSDictionary>(
+ NSDictionary* event = apple::ObjCCastStrict<NSDictionary>(
SysUTF8ToNSString(TrimWhitespaceASCII(plist, TRIM_ALL))
.propertyList);
callback.Run(event);
@@ -107,7 +107,7 @@
// base::CreateDirectory() routine forces mode 0700.
NSError* error = nil;
ASSERT_TRUE([NSFileManager.defaultManager
- createDirectoryAtURL:base::mac::FilePathToNSURL(
+ createDirectoryAtURL:base::apple::FilePathToNSURL(
destination_executable_path)
withIntermediateDirectories:YES
attributes:@{
@@ -138,16 +138,16 @@
// Generate the Plist file
NSDictionary* plist = @{
@"CFBundleExecutable" :
- FilePathToNSString(helper_app_executable.BaseName()),
+ apple::FilePathToNSString(helper_app_executable.BaseName()),
@"CFBundleIdentifier" : helper_bundle_id_,
};
ASSERT_TRUE([plist
- writeToURL:FilePathToNSURL(
+ writeToURL:apple::FilePathToNSURL(
destination_contents_path.AppendASCII("Info.plist"))
error:nil]);
// Register the app with LaunchServices.
- LSRegisterURL(base::mac::FilePathToCFURL(helper_app_bundle_path_), true);
+ LSRegisterURL(base::apple::FilePathToCFURL(helper_app_bundle_path_), true);
// Ensure app was registered with LaunchServices. Sometimes it takes a
// little bit of time for this to happen, and some tests might fail if the
@@ -193,7 +193,8 @@
NSArray<NSRunningApplication*>* apps =
NSWorkspace.sharedWorkspace.runningApplications;
for (NSRunningApplication* app in apps) {
- if (temp_dir_.GetPath().IsParent(NSURLToFilePath(app.bundleURL)) ||
+ if (temp_dir_.GetPath().IsParent(
+ apple::NSURLToFilePath(app.bundleURL)) ||
[app.bundleIdentifier isEqualToString:helper_bundle_id_]) {
[app forceTerminate];
}
@@ -256,13 +257,13 @@
if (i >= launch_events_.count) {
return nil;
}
- return ObjCCastStrict<NSString>(launch_events_[i][@"name"]);
+ return apple::ObjCCastStrict<NSString>(launch_events_[i][@"name"]);
}
NSDictionary* LaunchEventData(unsigned i) {
if (i >= launch_events_.count) {
return nil;
}
- return ObjCCastStrict<NSDictionary>(launch_events_[i][@"data"]);
+ return apple::ObjCCastStrict<NSDictionary>(launch_events_[i][@"data"]);
}
protected:
@@ -295,7 +296,7 @@
helper_app_bundle_path_, command_line_args, {}, {});
ASSERT_TRUE(app);
EXPECT_NSEQ(app.bundleIdentifier, helper_bundle_id_);
- EXPECT_EQ(NSURLToFilePath(app.bundleURL), helper_app_bundle_path_);
+ EXPECT_EQ(apple::NSURLToFilePath(app.bundleURL), helper_app_bundle_path_);
WaitForLaunchEvents(1);
EXPECT_NSEQ(LaunchEventName(0), @"applicationDidFinishLaunching");
@@ -303,7 +304,7 @@
@(NSApplicationActivationPolicyRegular));
EXPECT_EQ(app.activationPolicy, NSApplicationActivationPolicyRegular);
EXPECT_NSEQ(LaunchEventData(0)[@"commandLine"],
- (@[ FilePathToNSString(helper_app_executable_path_) ]));
+ (@[ apple::FilePathToNSString(helper_app_executable_path_) ]));
EXPECT_NSEQ(LaunchEventData(0)[@"processIdentifier"],
@(app.processIdentifier));
}
@@ -340,10 +341,10 @@
WaitForLaunchEvents(1);
EXPECT_NSEQ(LaunchEventName(0), @"applicationDidFinishLaunching");
- EXPECT_NSEQ(
- LaunchEventData(0)[@"commandLine"], (@[
- FilePathToNSString(helper_app_executable_path_), @"--foo", @"bar", @"-v"
- ]));
+ EXPECT_NSEQ(LaunchEventData(0)[@"commandLine"], (@[
+ apple::FilePathToNSString(helper_app_executable_path_),
+ @"--foo", @"bar", @"-v"
+ ]));
}
TEST_F(LaunchApplicationTest, CommandLineArgs_BaseCommandLine) {
@@ -359,8 +360,8 @@
WaitForLaunchEvents(1);
EXPECT_NSEQ(LaunchEventName(0), @"applicationDidFinishLaunching");
EXPECT_NSEQ(LaunchEventData(0)[@"commandLine"], (@[
- FilePathToNSString(helper_app_executable_path_), @"--foo=bar",
- @"--v", @"--path=/tmp"
+ apple::FilePathToNSString(helper_app_executable_path_),
+ @"--foo=bar", @"--v", @"--path=/tmp"
]));
}
@@ -381,12 +382,12 @@
// macOS 11 (and only macOS 11) appears to sometimes trigger the openURLs
// calls in reverse order.
std::vector<std::string> received_urls;
- for (NSString* url in ObjCCastStrict<NSArray>(
+ for (NSString* url in apple::ObjCCastStrict<NSArray>(
LaunchEventData(0)[@"urls"])) {
received_urls.push_back(SysNSStringToUTF8(url));
}
EXPECT_EQ(received_urls.size(), 1u);
- for (NSString* url in ObjCCastStrict<NSArray>(
+ for (NSString* url in apple::ObjCCastStrict<NSArray>(
LaunchEventData(2)[@"urls"])) {
received_urls.push_back(SysNSStringToUTF8(url));
}
@@ -436,17 +437,17 @@
{.hidden_in_background = true});
ASSERT_TRUE(app);
EXPECT_NSEQ(app.bundleIdentifier, helper_bundle_id_);
- EXPECT_EQ(helper_app_bundle_path_, NSURLToFilePath(app.bundleURL));
+ EXPECT_EQ(helper_app_bundle_path_, apple::NSURLToFilePath(app.bundleURL));
WaitForLaunchEvents(1);
EXPECT_NSEQ(LaunchEventName(0), @"applicationDidFinishLaunching");
EXPECT_NSEQ(LaunchEventData(0)[@"activationPolicy"],
@(NSApplicationActivationPolicyProhibited));
EXPECT_EQ(app.activationPolicy, NSApplicationActivationPolicyProhibited);
- EXPECT_NSEQ(
- LaunchEventData(0)[@"commandLine"], (@[
- FilePathToNSString(helper_app_executable_path_), @"--test", @"--foo"
- ]));
+ EXPECT_NSEQ(LaunchEventData(0)[@"commandLine"], (@[
+ apple::FilePathToNSString(helper_app_executable_path_),
+ @"--test", @"--foo"
+ ]));
EXPECT_NSEQ(LaunchEventData(0)[@"processIdentifier"],
@(app.processIdentifier));
@@ -484,17 +485,17 @@
{.hidden_in_background = true});
ASSERT_TRUE(app);
EXPECT_NSEQ(app.bundleIdentifier, helper_bundle_id_);
- EXPECT_EQ(helper_app_bundle_path_, NSURLToFilePath(app.bundleURL));
+ EXPECT_EQ(helper_app_bundle_path_, apple::NSURLToFilePath(app.bundleURL));
WaitForLaunchEvents(1);
EXPECT_NSEQ(LaunchEventName(0), @"applicationDidFinishLaunching");
EXPECT_NSEQ(LaunchEventData(0)[@"activationPolicy"],
@(NSApplicationActivationPolicyProhibited));
EXPECT_EQ(app.activationPolicy, NSApplicationActivationPolicyProhibited);
- EXPECT_NSEQ(
- LaunchEventData(0)[@"commandLine"], (@[
- FilePathToNSString(helper_app_executable_path_), @"--test", @"--foo"
- ]));
+ EXPECT_NSEQ(LaunchEventData(0)[@"commandLine"], (@[
+ apple::FilePathToNSString(helper_app_executable_path_),
+ @"--test", @"--foo"
+ ]));
EXPECT_NSEQ(LaunchEventData(0)[@"processIdentifier"],
@(app.processIdentifier));
diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm
index 344d5fb..b7dcee4 100644
--- a/base/mac/mac_util.mm
+++ b/base/mac/mac_util.mm
@@ -17,11 +17,11 @@
#include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_path.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/scoped_aedesc.h"
#include "base/mac/scoped_ioobject.h"
#include "base/strings/string_number_conversions.h"
@@ -163,7 +163,7 @@
return;
}
- NSURL* app_bundle_url = base::mac::FilePathToNSURL(app_bundle_file_path);
+ NSURL* app_bundle_url = base::apple::FilePathToNSURL(app_bundle_file_path);
base::ScopedCFTypeRef<LSSharedFileListItemRef> item =
login_items.GetLoginItemForApp(app_bundle_url);
@@ -204,7 +204,7 @@
return;
}
- NSURL* app_bundle_url = base::mac::FilePathToNSURL(app_bundle_file_path);
+ NSURL* app_bundle_url = base::apple::FilePathToNSURL(app_bundle_file_path);
base::ScopedCFTypeRef<LSSharedFileListItemRef> item =
login_items.GetLoginItemForApp(app_bundle_url);
if (!item.get()) {
@@ -261,7 +261,7 @@
return true;
}
- if (CFBooleanRef restore_state = base::mac::CFCast<CFBooleanRef>(plist)) {
+ if (CFBooleanRef restore_state = base::apple::CFCast<CFBooleanRef>(plist)) {
return CFBooleanGetValue(restore_state);
}
@@ -467,7 +467,7 @@
CFSTR(kIOPlatformSerialNumberKey),
kCFAllocatorDefault, 0));
CFStringRef serial_number_cfstring =
- base::mac::CFCast<CFStringRef>(serial_number);
+ base::apple::CFCast<CFStringRef>(serial_number);
if (!serial_number_cfstring) {
DLOG(ERROR) << "Error retrieving the machine serial number.";
return std::string();
diff --git a/base/mac/mac_util_unittest.mm b/base/mac/mac_util_unittest.mm
index bc88710..bdff8a60 100644
--- a/base/mac/mac_util_unittest.mm
+++ b/base/mac/mac_util_unittest.mm
@@ -10,11 +10,11 @@
#include <stdint.h>
#include <sys/xattr.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/mac/foundation_util.h"
#include "base/system/sys_info.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -28,21 +28,21 @@
TEST_F(MacUtilTest, GetUserDirectoryTest) {
// Try a few keys, make sure they come back with non-empty paths.
FilePath caches_dir;
- EXPECT_TRUE(GetUserDirectory(NSCachesDirectory, &caches_dir));
+ EXPECT_TRUE(apple::GetUserDirectory(NSCachesDirectory, &caches_dir));
EXPECT_FALSE(caches_dir.empty());
FilePath application_support_dir;
- EXPECT_TRUE(GetUserDirectory(NSApplicationSupportDirectory,
- &application_support_dir));
+ EXPECT_TRUE(apple::GetUserDirectory(NSApplicationSupportDirectory,
+ &application_support_dir));
EXPECT_FALSE(application_support_dir.empty());
FilePath library_dir;
- EXPECT_TRUE(GetUserDirectory(NSLibraryDirectory, &library_dir));
+ EXPECT_TRUE(apple::GetUserDirectory(NSLibraryDirectory, &library_dir));
EXPECT_FALSE(library_dir.empty());
}
TEST_F(MacUtilTest, TestLibraryPath) {
- FilePath library_dir = GetUserLibraryPath();
+ FilePath library_dir = apple::GetUserLibraryPath();
// Make sure the string isn't empty.
EXPECT_FALSE(library_dir.value().empty());
}
@@ -51,7 +51,7 @@
FilePath out;
// Make sure it doesn't crash.
- out = GetAppBundlePath(FilePath());
+ out = apple::GetAppBundlePath(FilePath());
EXPECT_TRUE(out.empty());
// Some more invalid inputs.
@@ -60,7 +60,7 @@
"foo/bar./bazquux", "foo/.app", "//foo",
};
for (size_t i = 0; i < std::size(invalid_inputs); i++) {
- out = GetAppBundlePath(FilePath(invalid_inputs[i]));
+ out = apple::GetAppBundlePath(FilePath(invalid_inputs[i]));
EXPECT_TRUE(out.empty()) << "loop: " << i;
}
@@ -84,7 +84,7 @@
"/Applications/Google Foo.app" },
};
for (size_t i = 0; i < std::size(valid_inputs); i++) {
- out = GetAppBundlePath(FilePath(valid_inputs[i].in));
+ out = apple::GetAppBundlePath(FilePath(valid_inputs[i].in));
EXPECT_FALSE(out.empty()) << "loop: " << i;
EXPECT_STREQ(valid_inputs[i].expected_out,
out.value().c_str()) << "loop: " << i;
@@ -95,7 +95,7 @@
FilePath out;
// Make sure it doesn't crash.
- out = GetInnermostAppBundlePath(FilePath());
+ out = apple::GetInnermostAppBundlePath(FilePath());
EXPECT_TRUE(out.empty());
// Some more invalid inputs.
@@ -113,7 +113,7 @@
for (size_t i = 0; i < std::size(invalid_inputs); i++) {
SCOPED_TRACE(testing::Message()
<< "case #" << i << ", input: " << invalid_inputs[i]);
- out = GetInnermostAppBundlePath(FilePath(invalid_inputs[i]));
+ out = apple::GetInnermostAppBundlePath(FilePath(invalid_inputs[i]));
EXPECT_TRUE(out.empty());
}
@@ -139,7 +139,7 @@
for (size_t i = 0; i < std::size(valid_inputs); i++) {
SCOPED_TRACE(testing::Message()
<< "case #" << i << ", input " << valid_inputs[i].in);
- out = GetInnermostAppBundlePath(FilePath(valid_inputs[i].in));
+ out = apple::GetInnermostAppBundlePath(FilePath(valid_inputs[i].in));
EXPECT_FALSE(out.empty());
EXPECT_STREQ(valid_inputs[i].expected_out, out.value().c_str());
}
diff --git a/base/mac/mach_port_rendezvous.cc b/base/mac/mach_port_rendezvous.cc
index 71806bde..370734f 100644
--- a/base/mac/mach_port_rendezvous.cc
+++ b/base/mac/mach_port_rendezvous.cc
@@ -9,10 +9,10 @@
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/apple/mach_logging.h"
#include "base/containers/buffer_iterator.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/scoped_mach_msg_destroy.h"
#include "base/notreached.h"
#include "base/strings/stringprintf.h"
@@ -140,7 +140,7 @@
MachPortRendezvousServer::MachPortRendezvousServer() {
std::string bootstrap_name =
- StringPrintf(kBootstrapNameFormat, mac::BaseBundleID(), getpid());
+ StringPrintf(kBootstrapNameFormat, apple::BaseBundleID(), getpid());
kern_return_t kr = bootstrap_check_in(
bootstrap_port, bootstrap_name.c_str(),
apple::ScopedMachReceiveRight::Receiver(server_port_).get());
@@ -301,7 +301,7 @@
// static
std::string MachPortRendezvousClient::GetBootstrapName() {
- return StringPrintf(kBootstrapNameFormat, mac::BaseBundleID(), getppid());
+ return StringPrintf(kBootstrapNameFormat, apple::BaseBundleID(), getppid());
}
bool MachPortRendezvousClient::AcquirePorts() {
diff --git a/base/mac/mach_port_rendezvous_unittest.cc b/base/mac/mach_port_rendezvous_unittest.cc
index 7f23e4c3..ddfb06f4 100644
--- a/base/mac/mach_port_rendezvous_unittest.cc
+++ b/base/mac/mach_port_rendezvous_unittest.cc
@@ -8,9 +8,9 @@
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/apple/mach_logging.h"
#include "base/at_exit.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/stringprintf.h"
#include "base/test/multiprocess_test.h"
#include "base/test/test_timeouts.h"
@@ -224,7 +224,7 @@
MULTIPROCESS_TEST_MAIN(FailToRendezvous) {
// The rendezvous system uses the BaseBundleID to construct the bootstrap
// server name, so changing it will result in a failure to look it up.
- base::mac::SetBaseBundleID("org.chromium.totallyfake");
+ base::apple::SetBaseBundleID("org.chromium.totallyfake");
CHECK_EQ(nullptr, base::MachPortRendezvousClient::GetInstance());
return 0;
}
diff --git a/base/power_monitor/battery_level_provider_mac.mm b/base/power_monitor/battery_level_provider_mac.mm
index 768e774..76e7bb5 100644
--- a/base/power_monitor/battery_level_provider_mac.mm
+++ b/base/power_monitor/battery_level_provider_mac.mm
@@ -8,8 +8,8 @@
#include <IOKit/IOKitLib.h>
#include <IOKit/ps/IOPSKeys.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/scoped_ioobject.h"
namespace base {
@@ -21,7 +21,7 @@
absl::optional<SInt64> GetValueAsSInt64(CFDictionaryRef description,
CFStringRef key) {
CFNumberRef number_ref =
- base::mac::GetValueFromDictionary<CFNumberRef>(description, key);
+ base::apple::GetValueFromDictionary<CFNumberRef>(description, key);
SInt64 value;
if (number_ref && CFNumberGetValue(number_ref, kCFNumberSInt64Type, &value))
@@ -33,7 +33,7 @@
absl::optional<bool> GetValueAsBoolean(CFDictionaryRef description,
CFStringRef key) {
CFBooleanRef boolean =
- base::mac::GetValueFromDictionary<CFBooleanRef>(description, key);
+ base::apple::GetValueFromDictionary<CFBooleanRef>(description, key);
if (!boolean)
return absl::nullopt;
return CFBooleanGetValue(boolean);
diff --git a/base/power_monitor/power_monitor_device_source_mac.mm b/base/power_monitor/power_monitor_device_source_mac.mm
index ac15bd4..f385178 100644
--- a/base/power_monitor/power_monitor_device_source_mac.mm
+++ b/base/power_monitor/power_monitor_device_source_mac.mm
@@ -7,8 +7,8 @@
#include "base/power_monitor/power_monitor_device_source.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/power_monitor/power_monitor.h"
#include "base/power_monitor/power_monitor_source.h"
diff --git a/base/strings/sys_string_conversions_apple.mm b/base/strings/sys_string_conversions_apple.mm
index 3e4714a4..0ec86e4 100644
--- a/base/strings/sys_string_conversions_apple.mm
+++ b/base/strings/sys_string_conversions_apple.mm
@@ -10,8 +10,8 @@
#include <vector>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_piece.h"
diff --git a/base/test/launcher/unit_test_launcher_ios.cc b/base/test/launcher/unit_test_launcher_ios.cc
index aa3ceb7..de7fbb6d 100644
--- a/base/test/launcher/unit_test_launcher_ios.cc
+++ b/base/test/launcher/unit_test_launcher_ios.cc
@@ -4,11 +4,11 @@
#include "base/test/launcher/unit_test_launcher.h"
+#include "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/test/allow_check_is_test_for_testing.h"
#include "base/test/gtest_util.h"
#include "base/test/test_support_ios.h"
@@ -57,14 +57,14 @@
only_write_tests
? (command_line->GetSwitchValuePath(
switches::kTestLauncherListTests))
- : mac::GetUserDocumentPath().Append("compiled_tests.json");
+ : apple::GetUserDocumentPath().Append("compiled_tests.json");
int write_result = WriteCompiledInTestsToFileAndLog(list_path);
if (only_write_tests) {
return write_result;
}
} else if (command_line->HasSwitch(
switches::kTestLauncherPrintWritablePath)) {
- fprintf(stdout, "%s", mac::GetUserLibraryPath().value().c_str());
+ fprintf(stdout, "%s", apple::GetUserLibraryPath().value().c_str());
fflush(stdout);
return 0;
}
diff --git a/base/threading/platform_thread_apple.mm b/base/threading/platform_thread_apple.mm
index 83c6e37..420b47f 100644
--- a/base/threading/platform_thread_apple.mm
+++ b/base/threading/platform_thread_apple.mm
@@ -15,11 +15,11 @@
#include <algorithm>
#include <atomic>
+#include "base/apple/foundation_util.h"
#include "base/apple/mach_logging.h"
#include "base/feature_list.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/threading/thread_id_name_manager.h"
@@ -171,7 +171,7 @@
namespace {
TimeDelta GetCurrentThreadRealtimePeriod() {
- NSNumber* period = mac::ObjCCast<NSNumber>(
+ NSNumber* period = apple::ObjCCast<NSNumber>(
NSThread.currentThread.threadDictionary[kRealtimePeriodNsKey]);
return period ? Nanoseconds(period.longLongValue) : TimeDelta();
@@ -354,7 +354,7 @@
// static
ThreadPriorityForTest PlatformThreadBase::GetCurrentThreadPriorityForTest() {
- NSNumber* priority = base::mac::ObjCCast<NSNumber>(
+ NSNumber* priority = base::apple::ObjCCast<NSNumber>(
NSThread.currentThread.threadDictionary[kThreadPriorityForTestKey]);
if (!priority) {
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc
index 624e42d..c4acb61c 100644
--- a/chrome/app/chrome_main_delegate.cc
+++ b/chrome/app/chrome_main_delegate.cc
@@ -117,7 +117,7 @@
#endif
#if BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/message_loop/message_pump_apple.h"
#include "base/message_loop/message_pump_default.h"
#include "base/message_loop/message_pump_kqueue.h"
@@ -1263,15 +1263,15 @@
// the helper should always have a --type switch.
//
// This check is done this late so there is already a call to
- // base::mac::IsBackgroundOnlyProcess(), so there is no change in
+ // base::apple::IsBackgroundOnlyProcess(), so there is no change in
// startup/initialization order.
// The helper's Info.plist marks it as a background only app.
- if (base::mac::IsBackgroundOnlyProcess()) {
+ if (base::apple::IsBackgroundOnlyProcess()) {
CHECK(command_line.HasSwitch(switches::kProcessType) &&
!process_type.empty())
<< "Helper application requires --type.";
- } else if (base::mac::AmIBundled()) {
+ } else if (base::apple::AmIBundled()) {
CHECK(!command_line.HasSwitch(switches::kProcessType) &&
process_type.empty())
<< "Main application forbids --type, saw " << process_type;
diff --git a/chrome/app/chrome_main_mac.h b/chrome/app/chrome_main_mac.h
index 1cd3290..adfff4a 100644
--- a/chrome/app/chrome_main_mac.h
+++ b/chrome/app/chrome_main_mac.h
@@ -14,10 +14,10 @@
void CheckUserDataDirPolicy(base::FilePath* user_data_dir);
// Sets the app bundle (base::apple::FrameworkBundle()) to the framework's
-// bundle, and sets the base bundle ID (base::mac::BaseBundleID()) to the proper
-// value based on the running application. The base bundle ID is the outer
-// browser application's bundle ID even when running in a non-browser (helper)
-// process.
+// bundle, and sets the base bundle ID (base::apple::BaseBundleID()) to the
+// proper value based on the running application. The base bundle ID is the
+// outer browser application's bundle ID even when running in a non-browser
+// (helper) process.
void SetUpBundleOverrides();
// Checks if the system launched the alerts helper app via a notification
diff --git a/chrome/app/chrome_main_mac.mm b/chrome/app/chrome_main_mac.mm
index 03f432a..f12c7308 100644
--- a/chrome/app/chrome_main_mac.mm
+++ b/chrome/app/chrome_main_mac.mm
@@ -9,9 +9,9 @@
#include <string>
#import "base/apple/bundle_locations.h"
+#import "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
-#import "base/mac/foundation_util.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
@@ -26,7 +26,7 @@
chrome::GetFrameworkBundlePath());
NSBundle* base_bundle = chrome::OuterAppBundle();
- base::mac::SetBaseBundleID(base_bundle.bundleIdentifier.UTF8String);
+ base::apple::SetBaseBundleID(base_bundle.bundleIdentifier.UTF8String);
base::FilePath child_exe_path =
chrome::GetFrameworkBundlePath().Append("Helpers").Append(
@@ -44,8 +44,9 @@
// We allow the main Chrome app to be launched via a notification action. We
// detect and log that to UMA by checking the passed in NSNotification in
// -applicationDidFinishLaunching: (//chrome/browser/app_controller_mac.mm).
- if (!base::mac::IsBackgroundOnlyProcess())
+ if (!base::apple::IsBackgroundOnlyProcess()) {
return false;
+ }
// If we have a process type then we were not launched by the system.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType))
diff --git a/chrome/app_shim/app_mode_loader_mac.mm b/chrome/app_shim/app_mode_loader_mac.mm
index cf475d0..2b5c1fd 100644
--- a/chrome/app_shim/app_mode_loader_mac.mm
+++ b/chrome/app_shim/app_mode_loader_mac.mm
@@ -13,11 +13,11 @@
#import <Cocoa/Cocoa.h>
#include "base/allocator/early_zone_registration_apple.h"
+#include "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/process/launch.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/sys_string_conversions.h"
@@ -43,10 +43,10 @@
return kErrorReturnValue;
}
const base::FilePath app_mode_bundle_path =
- base::mac::NSStringToFilePath([app_bundle bundlePath]);
+ base::apple::NSStringToFilePath([app_bundle bundlePath]);
// Get the bundle ID of the browser that created this app bundle.
- NSString* cr_bundle_id = base::mac::ObjCCast<NSString>(
+ NSString* cr_bundle_id = base::apple::ObjCCast<NSString>(
[app_bundle objectForInfoDictionaryKey:app_mode::kBrowserBundleIDKey]);
if (!cr_bundle_id) {
NSLog(@"Couldn't get browser bundle ID");
@@ -79,7 +79,7 @@
{
// The user_data_dir for shims actually contains the app_data_path.
// I.e. <user_data_dir>/<profile_dir>/Web Applications/_crx_extensionid/
- base::FilePath app_data_dir = base::mac::NSStringToFilePath([app_bundle
+ base::FilePath app_data_dir = base::apple::NSStringToFilePath([app_bundle
objectForInfoDictionaryKey:app_mode::kCrAppModeUserDataDirKey]);
user_data_dir = app_data_dir.DirName().DirName().DirName();
NSLog(@"Using user data dir %s", user_data_dir.value().c_str());
@@ -170,10 +170,10 @@
const std::string app_mode_url =
base::SysNSStringToUTF8(info_plist[app_mode::kCrAppModeShortcutURLKey]);
- base::FilePath plist_user_data_dir = base::mac::NSStringToFilePath(
+ base::FilePath plist_user_data_dir = base::apple::NSStringToFilePath(
info_plist[app_mode::kCrAppModeUserDataDirKey]);
- base::FilePath profile_dir = base::mac::NSStringToFilePath(
+ base::FilePath profile_dir = base::apple::NSStringToFilePath(
info_plist[app_mode::kCrAppModeProfileDirKey]);
// ** 5: Open the framework.
diff --git a/chrome/app_shim/app_shim_controller.mm b/chrome/app_shim/app_shim_controller.mm
index fc044518..39e0daab 100644
--- a/chrome/app_shim/app_shim_controller.mm
+++ b/chrome/app_shim/app_shim_controller.mm
@@ -10,13 +10,13 @@
#include <utility>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/mach_logging.h"
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/hash/md5.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/launch_application.h"
#include "base/mac/mac_util.h"
#include "base/memory/raw_ptr.h"
@@ -314,7 +314,7 @@
{
mojo::PlatformChannelEndpoint endpoint;
NSString* browser_bundle_id =
- base::mac::ObjCCast<NSString>([NSBundle.mainBundle
+ base::apple::ObjCCast<NSString>([NSBundle.mainBundle
objectForInfoDictionaryKey:app_mode::kBrowserBundleIDKey]);
CHECK(browser_bundle_id);
const std::string server_name = base::StringPrintf(
diff --git a/chrome/app_shim/app_shim_delegate.mm b/chrome/app_shim/app_shim_delegate.mm
index f48f5e0..d966844 100644
--- a/chrome/app_shim/app_shim_delegate.mm
+++ b/chrome/app_shim/app_shim_delegate.mm
@@ -4,7 +4,7 @@
#include "chrome/app_shim/app_shim_delegate.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/app_shim/app_shim_controller.h"
@@ -26,7 +26,7 @@
- (BOOL)application:(NSApplication*)app openFile:(NSString*)filename {
std::vector<base::FilePath> filePaths = {
- base::mac::NSStringToFilePath(filename)};
+ base::apple::NSStringToFilePath(filename)};
_appShimController->OpenFiles(filePaths);
return YES;
}
@@ -34,7 +34,7 @@
- (void)application:(NSApplication*)app openFiles:(NSArray*)filenames {
std::vector<base::FilePath> filePaths;
for (NSString* filename in filenames)
- filePaths.push_back(base::mac::NSStringToFilePath(filename));
+ filePaths.push_back(base::apple::NSStringToFilePath(filename));
_appShimController->OpenFiles(filePaths);
[app replyToOpenOrPrint:NSApplicationDelegateReplySuccess];
}
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index d6e940f8..84e414c 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -11,13 +11,13 @@
#include <vector>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/auto_reset.h"
#include "base/check_op.h"
#include "base/command_line.h"
#include "base/debug/dump_without_crashing.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_macros.h"
@@ -276,7 +276,7 @@
CFPreferencesSetAppValue(
base::apple::NSToCFPtrCast(app_mode::kLastRunAppBundlePathPrefsKey),
app_bundle_path_cfstring,
- base::SysUTF8ToCFStringRef(base::mac::BaseBundleID()));
+ base::SysUTF8ToCFStringRef(base::apple::BaseBundleID()));
}
bool IsProfileSignedOut(const base::FilePath& profile_path) {
@@ -1018,7 +1018,7 @@
// Record the path to the (browser) app bundle; this is used by the app mode
// shim.
- if (base::mac::AmIBundled()) {
+ if (base::apple::AmIBundled()) {
base::ThreadPool::PostTask(
FROM_HERE,
{base::MayBlock(), base::TaskPriority::BEST_EFFORT,
@@ -1284,7 +1284,7 @@
// This is handled outside of the switch statement because we want to hide
// this regardless if the command is supported or not.
if (tag == IDC_SHOW_AS_TAB) {
- NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item);
+ NSMenuItem* menuItem = base::apple::ObjCCast<NSMenuItem>(item);
[menuItem setHidden:YES];
}
} else if (action == @selector(terminate:)) {
@@ -1915,10 +1915,10 @@
NSWindow* targetWindow = nil;
if ([target isKindOfClass:[NSPopover class]]) {
targetWindow =
- [[[base::mac::ObjCCast<NSPopover>(target) contentViewController] view]
+ [[[base::apple::ObjCCast<NSPopover>(target) contentViewController] view]
window];
} else {
- targetWindow = base::mac::ObjCCast<NSWindow>(target);
+ targetWindow = base::apple::ObjCCast<NSWindow>(target);
}
if (targetWindow != nil) {
@@ -1970,7 +1970,7 @@
return NO;
}
- NSString* originString = base::mac::ObjCCast<NSString>(
+ NSString* originString = base::apple::ObjCCast<NSString>(
(userActivity.userInfo)[handoff::kOriginKey]);
handoff::Origin origin = handoff::OriginFromString(originString);
UMA_HISTOGRAM_ENUMERATION(
diff --git a/chrome/browser/app_controller_mac_browsertest.mm b/chrome/browser/app_controller_mac_browsertest.mm
index a329b80..d715ab2 100644
--- a/chrome/browser/app_controller_mac_browsertest.mm
+++ b/chrome/browser/app_controller_mac_browsertest.mm
@@ -9,11 +9,11 @@
#include <string>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_objc_class_swizzler.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/path_service.h"
#include "base/run_loop.h"
@@ -791,7 +791,7 @@
IN_PROC_BROWSER_TEST_F(AppControllerBrowserTest, OpenInRegularBrowser) {
ASSERT_TRUE(embedded_test_server()->Start());
AppController* ac =
- base::mac::ObjCCastStrict<AppController>([NSApp delegate]);
+ base::apple::ObjCCastStrict<AppController>([NSApp delegate]);
ASSERT_TRUE(ac);
// Create an incognito browser and make it the last active browser.
Browser* incognito_browser = CreateIncognitoBrowser(browser()->profile());
@@ -830,7 +830,7 @@
OpenInRegularBrowserWhenOnlyIncognitoBrowserIsOpened) {
ASSERT_TRUE(embedded_test_server()->Start());
AppController* ac =
- base::mac::ObjCCastStrict<AppController>([NSApp delegate]);
+ base::apple::ObjCCastStrict<AppController>([NSApp delegate]);
ASSERT_TRUE(ac);
EXPECT_EQ(BrowserList::GetInstance()->size(), 1u);
// Close the current browser.
@@ -874,7 +874,7 @@
IN_PROC_BROWSER_TEST_F(AppControllerBrowserTest, OpenUrlInGuestBrowser) {
ASSERT_TRUE(embedded_test_server()->Start());
AppController* ac =
- base::mac::ObjCCastStrict<AppController>([NSApp delegate]);
+ base::apple::ObjCCastStrict<AppController>([NSApp delegate]);
ASSERT_TRUE(ac);
// Create a guest browser and make it the last active browser.
Browser* guest_browser = CreateGuestBrowser();
diff --git a/chrome/browser/apps/app_shim/app_shim_listener_browsertest_mac.mm b/chrome/browser/apps/app_shim/app_shim_listener_browsertest_mac.mm
index cbd01735..1f39935 100644
--- a/chrome/browser/apps/app_shim/app_shim_listener_browsertest_mac.mm
+++ b/chrome/browser/apps/app_shim/app_shim_listener_browsertest_mac.mm
@@ -8,12 +8,12 @@
#include <memory>
+#include "base/apple/foundation_util.h"
#include "base/check.h"
#include "base/check_op.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/strings/strcat.h"
@@ -140,9 +140,10 @@
base::FilePath user_data_dir;
CHECK(base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir));
- std::string name_fragment = base::StrCat(
- {base::mac::BaseBundleID(), ".", app_mode::kAppShimBootstrapNameFragment,
- ".", base::MD5String(user_data_dir.value())});
+ std::string name_fragment =
+ base::StrCat({base::apple::BaseBundleID(), ".",
+ app_mode::kAppShimBootstrapNameFragment, ".",
+ base::MD5String(user_data_dir.value())});
mojo::PlatformChannelEndpoint endpoint = ConnectToBrowser(name_fragment);
mojo::ScopedMessagePipeHandle message_pipe;
diff --git a/chrome/browser/apps/app_shim/app_shim_manager_mac.cc b/chrome/browser/apps/app_shim/app_shim_manager_mac.cc
index 1b38ba8..085e274 100644
--- a/chrome/browser/apps/app_shim/app_shim_manager_mac.cc
+++ b/chrome/browser/apps/app_shim/app_shim_manager_mac.cc
@@ -12,6 +12,7 @@
#include "apps/app_lifetime_monitor_factory.h"
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/barrier_closure.h"
#include "base/debug/dump_without_crashing.h"
@@ -22,7 +23,6 @@
#include "base/functional/callback_helpers.h"
#include "base/hash/sha1.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/no_destructor.h"
#include "base/strings/stringprintf.h"
@@ -115,7 +115,7 @@
// validating. We are only interested in discovering if the framework bundle
// is code-signed, and if so what the designated requirement is.
base::ScopedCFTypeRef<CFURLRef> framework_url =
- base::mac::FilePathToCFURL(base::apple::FrameworkBundlePath());
+ base::apple::FilePathToCFURL(base::apple::FrameworkBundlePath());
base::ScopedCFTypeRef<SecStaticCodeRef> framework_code;
OSStatus status = SecStaticCodeCreateWithPath(
framework_url, kSecCSDefaultFlags, framework_code.InitializeInto());
@@ -150,8 +150,8 @@
// unsigned. This decision is consistent with the StaticCode source:
// https://github.com/apple-oss-distributions/Security/blob/Security-60157.40.30.0.1/OSX/libsecurity_codesigning/lib/StaticCode.cpp#L2270
CFNumberRef framework_signing_info_flags =
- base::mac::GetValueFromDictionary<CFNumberRef>(framework_signing_info,
- kSecCodeInfoFlags);
+ base::apple::GetValueFromDictionary<CFNumberRef>(framework_signing_info,
+ kSecCodeInfoFlags);
if (!framework_signing_info_flags) {
return absl::nullopt; // has_value() == false
}
diff --git a/chrome/browser/apps/app_shim/mach_bootstrap_acceptor.cc b/chrome/browser/apps/app_shim/mach_bootstrap_acceptor.cc
index f375e17..d3e997e 100644
--- a/chrome/browser/apps/app_shim/mach_bootstrap_acceptor.cc
+++ b/chrome/browser/apps/app_shim/mach_bootstrap_acceptor.cc
@@ -10,8 +10,8 @@
#include <memory>
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/apple/mach_logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/scoped_mach_msg_destroy.h"
#include "base/strings/stringprintf.h"
#include "chrome/common/mac/app_mode_common.h"
@@ -21,7 +21,7 @@
MachBootstrapAcceptor::MachBootstrapAcceptor(const std::string& name_fragment,
Delegate* delegate)
: server_name_(base::StringPrintf("%s.%s",
- base::mac::BaseBundleID(),
+ base::apple::BaseBundleID(),
name_fragment.c_str())
.c_str()),
delegate_(delegate) {
diff --git a/chrome/browser/apps/platform_apps/api/media_galleries/media_galleries_apitest.cc b/chrome/browser/apps/platform_apps/api/media_galleries/media_galleries_apitest.cc
index dcb91d7..fa444fb4 100644
--- a/chrome/browser/apps/platform_apps/api/media_galleries/media_galleries_apitest.cc
+++ b/chrome/browser/apps/platform_apps/api/media_galleries/media_galleries_apitest.cc
@@ -49,7 +49,7 @@
#include "media/media_buildflags.h"
#if BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#endif // BUILDFLAG(IS_MAC)
diff --git a/chrome/browser/autofill/form_structure_browsertest.cc b/chrome/browser/autofill/form_structure_browsertest.cc
index 9830d51..32614898 100644
--- a/chrome/browser/autofill/form_structure_browsertest.cc
+++ b/chrome/browser/autofill/form_structure_browsertest.cc
@@ -45,7 +45,7 @@
#include "url/gurl.h"
#if BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
namespace autofill {
@@ -95,7 +95,7 @@
std::sort(files.begin(), files.end());
#if BUILDFLAG(IS_MAC)
- base::mac::ClearAmIBundledCache();
+ base::apple::ClearAmIBundledCache();
#endif // BUILDFLAG(IS_MAC)
return files;
diff --git a/chrome/browser/browser_process_platform_part_mac.mm b/chrome/browser/browser_process_platform_part_mac.mm
index 384e6bcad..1e5a4a3 100644
--- a/chrome/browser/browser_process_platform_part_mac.mm
+++ b/chrome/browser/browser_process_platform_part_mac.mm
@@ -4,7 +4,7 @@
#include "chrome/browser/browser_process_platform_part_mac.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
#import "chrome/browser/app_controller_mac.h"
diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm
index c09da3b..83ca38c 100644
--- a/chrome/browser/chrome_browser_main_mac.mm
+++ b/chrome/browser/chrome_browser_main_mac.mm
@@ -7,11 +7,11 @@
#import <Cocoa/Cocoa.h>
#include "base/apple/bundle_locations.h"
+#import "base/apple/foundation_util.h"
#include "base/check_op.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/path_service.h"
diff --git a/chrome/browser/component_updater/recovery_improved_component_installer_mac.cc b/chrome/browser/component_updater/recovery_improved_component_installer_mac.cc
index 93f2068..afc4fcd 100644
--- a/chrome/browser/component_updater/recovery_improved_component_installer_mac.cc
+++ b/chrome/browser/component_updater/recovery_improved_component_installer_mac.cc
@@ -4,10 +4,10 @@
#include "chrome/browser/component_updater/recovery_improved_component_installer.h"
+#include "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/ref_counted.h"
#include "components/update_client/update_client.h"
@@ -44,7 +44,7 @@
command_line.AppendSwitchASCII("browser-version",
version_info::GetVersion().GetString());
command_line.AppendSwitchASCII("sessionid", session_id());
- command_line.AppendSwitchASCII("appguid", base::mac::BaseBundleID());
+ command_line.AppendSwitchASCII("appguid", base::apple::BaseBundleID());
command_line.AppendSwitch("enable-logging");
command_line.AppendSwitchASCII(
"vmodule", "*/components/update_client/*=2,*/chrome/updater/*=2");
diff --git a/chrome/browser/component_updater/updater_state_mac.mm b/chrome/browser/component_updater/updater_state_mac.mm
index 5af575c0..4b73439 100644
--- a/chrome/browser/component_updater/updater_state_mac.mm
+++ b/chrome/browser/component_updater/updater_state_mac.mm
@@ -7,10 +7,10 @@
#import <Foundation/Foundation.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/enterprise_util.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/version.h"
@@ -29,7 +29,7 @@
CFPreferencesCopyAppValue(base::apple::NSToCFPtrCast(value_name),
CFSTR("com.google.Keystone.Agent")));
- return base::mac::ObjCCastStrict<T>(plist_type);
+ return base::apple::ObjCCastStrict<T>(plist_type);
}
base::Time GetUpdaterSettingsTime(NSString* value_name) {
@@ -43,12 +43,12 @@
base::Version GetVersionFromPlist(const base::FilePath& info_plist) {
@autoreleasepool {
NSData* data = [NSData
- dataWithContentsOfFile:base::mac::FilePathToNSString(info_plist)];
+ dataWithContentsOfFile:base::apple::FilePathToNSString(info_plist)];
if ([data length] == 0) {
return base::Version();
}
NSDictionary* all_keys =
- base::mac::ObjCCastStrict<NSDictionary>([NSPropertyListSerialization
+ base::apple::ObjCCastStrict<NSDictionary>([NSPropertyListSerialization
propertyListWithData:data
options:NSPropertyListImmutable
format:nil
@@ -56,7 +56,7 @@
if (all_keys == nil) {
return base::Version();
}
- CFStringRef version = base::mac::GetValueFromDictionary<CFStringRef>(
+ CFStringRef version = base::apple::GetValueFromDictionary<CFStringRef>(
base::apple::NSToCFPtrCast(all_keys), kCFBundleVersionKey);
if (version == nullptr) {
return base::Version();
@@ -76,7 +76,7 @@
// System Keystone trumps user one, so check this one first
base::FilePath local_library;
bool success =
- base::mac::GetLocalDirectory(NSLibraryDirectory, &local_library);
+ base::apple::GetLocalDirectory(NSLibraryDirectory, &local_library);
DCHECK(success);
base::FilePath system_bundle_plist = local_library.Append(kKeystonePlist);
base::Version system_keystone = GetVersionFromPlist(system_bundle_plist);
@@ -85,7 +85,7 @@
}
base::FilePath user_bundle_plist =
- base::mac::GetUserLibraryPath().Append(kKeystonePlist);
+ base::apple::GetUserLibraryPath().Append(kKeystonePlist);
return GetVersionFromPlist(user_bundle_plist);
}
diff --git a/chrome/browser/download/download_status_updater_mac.mm b/chrome/browser/download/download_status_updater_mac.mm
index 0c9fdde72..83c536b 100644
--- a/chrome/browser/download/download_status_updater_mac.mm
+++ b/chrome/browser/download/download_status_updater_mac.mm
@@ -6,7 +6,7 @@
#import <Foundation/Foundation.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/memory/scoped_policy.h"
#include "base/supports_user_data.h"
#include "base/time/time.h"
@@ -52,7 +52,7 @@
return progress_data;
base::FilePath destination_path = download->GetFullPath();
- NSURL* destination_url = base::mac::FilePathToNSURL(destination_path);
+ NSURL* destination_url = base::apple::FilePathToNSURL(destination_path);
NSProgress* progress = [NSProgress progressWithTotalUnitCount:-1];
progress.kind = NSProgressKindFile;
@@ -101,7 +101,7 @@
base::FilePath download_path = download->GetFullPath();
if (progress_data->target() != download_path) {
progress_data->setTarget(download_path);
- NSURL* download_url = base::mac::FilePathToNSURL(download_path);
+ NSURL* download_url = base::apple::FilePathToNSURL(download_path);
progress.fileURL = download_url;
}
}
@@ -145,7 +145,7 @@
if (download->GetState() != download::DownloadItem::IN_PROGRESS &&
!download->GetTargetFilePath().empty()) {
NSString* download_path =
- base::mac::FilePathToNSString(download->GetTargetFilePath());
+ base::apple::FilePathToNSString(download->GetTargetFilePath());
if (download->GetState() == download::DownloadItem::COMPLETE) {
// Bounce the dock icon.
[NSDistributedNotificationCenter.defaultCenter
diff --git a/chrome/browser/download/drag_download_item_mac.mm b/chrome/browser/download/drag_download_item_mac.mm
index 9992ed6..b76af93 100644
--- a/chrome/browser/download/drag_download_item_mac.mm
+++ b/chrome/browser/download/drag_download_item_mac.mm
@@ -6,7 +6,7 @@
#import <Cocoa/Cocoa.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "components/download/public/common/download_item.h"
#include "ui/gfx/image/image.h"
#include "ui/views/widget/widget.h"
@@ -53,7 +53,7 @@
if (widget)
widget->ReleaseCapture();
- NSURL* file_url = base::mac::FilePathToNSURL(download->GetTargetFilePath());
+ NSURL* file_url = base::apple::FilePathToNSURL(download->GetTargetFilePath());
NSDraggingItem* file_item =
[[NSDraggingItem alloc] initWithPasteboardWriter:file_url];
if (icon) {
diff --git a/chrome/browser/enterprise/connectors/device_trust/key_management/core/mac/secure_enclave_client_unittest.mm b/chrome/browser/enterprise/connectors/device_trust/key_management/core/mac/secure_enclave_client_unittest.mm
index e9a508f..e114aae 100644
--- a/chrome/browser/enterprise/connectors/device_trust/key_management/core/mac/secure_enclave_client_unittest.mm
+++ b/chrome/browser/enterprise/connectors/device_trust/key_management/core/mac/secure_enclave_client_unittest.mm
@@ -10,9 +10,9 @@
#include <memory>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/containers/span.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"
@@ -88,10 +88,10 @@
}
void VerifyQuery(CFDictionaryRef query, CFStringRef label) {
- EXPECT_TRUE(CFEqual(label, base::mac::GetValueFromDictionary<CFStringRef>(
+ EXPECT_TRUE(CFEqual(label, base::apple::GetValueFromDictionary<CFStringRef>(
query, kSecAttrLabel)));
EXPECT_TRUE(CFEqual(kSecAttrKeyTypeECSECPrimeRandom,
- base::mac::GetValueFromDictionary<CFStringRef>(
+ base::apple::GetValueFromDictionary<CFStringRef>(
query, kSecAttrKeyType)));
}
@@ -119,22 +119,22 @@
.WillOnce([this](CFDictionaryRef attributes, OSStatus* status) {
EXPECT_TRUE(CFEqual(
base::SysUTF8ToCFStringRef(constants::kDeviceTrustSigningKeyLabel),
- base::mac::GetValueFromDictionary<CFStringRef>(attributes,
- kSecAttrLabel)));
+ base::apple::GetValueFromDictionary<CFStringRef>(attributes,
+ kSecAttrLabel)));
EXPECT_TRUE(CFEqual(kSecAttrKeyTypeECSECPrimeRandom,
- base::mac::GetValueFromDictionary<CFStringRef>(
+ base::apple::GetValueFromDictionary<CFStringRef>(
attributes, kSecAttrKeyType)));
EXPECT_TRUE(CFEqual(kSecAttrTokenIDSecureEnclave,
- base::mac::GetValueFromDictionary<CFStringRef>(
+ base::apple::GetValueFromDictionary<CFStringRef>(
attributes, kSecAttrTokenID)));
EXPECT_TRUE(CFEqual(base::apple::NSToCFPtrCast(@256),
- base::mac::GetValueFromDictionary<CFNumberRef>(
+ base::apple::GetValueFromDictionary<CFNumberRef>(
attributes, kSecAttrKeySizeInBits)));
auto* private_key_attributes =
- base::mac::GetValueFromDictionary<CFDictionaryRef>(
+ base::apple::GetValueFromDictionary<CFDictionaryRef>(
attributes, kSecPrivateKeyAttrs);
EXPECT_TRUE(CFEqual(kCFBooleanTrue,
- base::mac::GetValueFromDictionary<CFBooleanRef>(
+ base::apple::GetValueFromDictionary<CFBooleanRef>(
private_key_attributes, kSecAttrIsPermanent)));
*status = errSecSuccess;
@@ -257,7 +257,7 @@
EXPECT_TRUE(
CFEqual(base::SysUTF8ToCFStringRef(
constants::kTemporaryDeviceTrustSigningKeyLabel),
- base::mac::GetValueFromDictionary<CFStringRef>(
+ base::apple::GetValueFromDictionary<CFStringRef>(
attribute_to_update, kSecAttrLabel)));
VerifyQuery(query, base::SysUTF8ToCFStringRef(
constants::kDeviceTrustSigningKeyLabel));
@@ -324,8 +324,8 @@
CFDictionaryRef attribute_to_update) {
EXPECT_TRUE(CFEqual(
base::SysUTF8ToCFStringRef(constants::kDeviceTrustSigningKeyLabel),
- base::mac::GetValueFromDictionary<CFStringRef>(attribute_to_update,
- kSecAttrLabel)));
+ base::apple::GetValueFromDictionary<CFStringRef>(
+ attribute_to_update, kSecAttrLabel)));
VerifyQuery(query,
base::SysUTF8ToCFStringRef(
constants::kTemporaryDeviceTrustSigningKeyLabel));
diff --git a/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc b/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc
index bf62e292..b15829b 100644
--- a/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc
+++ b/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc
@@ -30,7 +30,7 @@
#endif
#if BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "chrome/browser/extensions/api/enterprise_reporting_private/keychain_data_helper_mac.h"
#include "crypto/apple_keychain.h"
#endif
diff --git a/chrome/browser/extensions/api/enterprise_reporting_private/keychain_data_helper_mac.cc b/chrome/browser/extensions/api/enterprise_reporting_private/keychain_data_helper_mac.cc
index 148b19db..12f6e1b 100644
--- a/chrome/browser/extensions/api/enterprise_reporting_private/keychain_data_helper_mac.cc
+++ b/chrome/browser/extensions/api/enterprise_reporting_private/keychain_data_helper_mac.cc
@@ -7,8 +7,8 @@
#include <CoreFoundation/CoreFoundation.h>
#include <Security/Security.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
namespace extensions {
diff --git a/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.cc b/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.cc
index eb76373..115b911 100644
--- a/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.cc
+++ b/chrome/browser/extensions/api/file_system/chrome_file_system_delegate.cc
@@ -32,7 +32,7 @@
#if BUILDFLAG(IS_MAC)
#include <CoreFoundation/CoreFoundation.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
#if BUILDFLAG(IS_CHROMEOS)
diff --git a/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc b/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc
index f0dff01..e69e9e7d 100644
--- a/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc
+++ b/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc
@@ -11,8 +11,8 @@
#include <IOKit/storage/IOStorageProtocolCharacteristics.h>
#include <stdint.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/scoped_ioobject.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/sys_string_conversions.h"
@@ -75,11 +75,11 @@
continue;
}
- CFStringRef cf_vendor = base::mac::GetValueFromDictionary<CFStringRef>(
+ CFStringRef cf_vendor = base::apple::GetValueFromDictionary<CFStringRef>(
characteristics, CFSTR(kIOPropertyVendorNameKey));
std::string vendor = base::SysCFStringRefToUTF8(cf_vendor);
- CFStringRef cf_model = base::mac::GetValueFromDictionary<CFStringRef>(
+ CFStringRef cf_model = base::apple::GetValueFromDictionary<CFStringRef>(
characteristics, CFSTR(kIOPropertyProductNameKey));
std::string model = base::SysCFStringRefToUTF8(cf_model);
diff --git a/chrome/browser/extensions/global_shortcut_listener_mac.mm b/chrome/browser/extensions/global_shortcut_listener_mac.mm
index 2a5c4a4..a2b2646 100644
--- a/chrome/browser/extensions/global_shortcut_listener_mac.mm
+++ b/chrome/browser/extensions/global_shortcut_listener_mac.mm
@@ -8,7 +8,7 @@
#import <Cocoa/Cocoa.h>
#include <IOKit/hidsystem/ev_keymap.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/media_keys_listener_manager.h"
#include "extensions/common/command.h"
@@ -173,7 +173,7 @@
EventHotKeyID event_hot_key_id;
// Signature uniquely identifies the application that owns this hot_key.
- event_hot_key_id.signature = base::mac::CreatorCodeForApplication();
+ event_hot_key_id.signature = base::apple::CreatorCodeForApplication();
event_hot_key_id.id = hot_key_id;
// Translate ui::Accelerator modifiers to cmdKey, altKey, etc.
diff --git a/chrome/browser/file_select_helper_mac.mm b/chrome/browser/file_select_helper_mac.mm
index 6192599..7ae764c6 100644
--- a/chrome/browser/file_select_helper_mac.mm
+++ b/chrome/browser/file_select_helper_mac.mm
@@ -7,11 +7,11 @@
#include <Cocoa/Cocoa.h>
#include <sys/stat.h>
+#include "base/apple/foundation_util.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "third_party/zlib/google/zip.h"
@@ -106,7 +106,7 @@
std::vector<base::FilePath> temporary_files;
for (auto& file_info : files_out) {
- NSString* filename = base::mac::FilePathToNSString(file_info.local_path);
+ NSString* filename = base::apple::FilePathToNSString(file_info.local_path);
BOOL isPackage =
[[NSWorkspace sharedWorkspace] isFilePackageAtPath:filename];
if (isPackage && base::DirectoryExists(file_info.local_path)) {
diff --git a/chrome/browser/global_keyboard_shortcuts_mac.mm b/chrome/browser/global_keyboard_shortcuts_mac.mm
index 6c62ab97..bc904939 100644
--- a/chrome/browser/global_keyboard_shortcuts_mac.mm
+++ b/chrome/browser/global_keyboard_shortcuts_mac.mm
@@ -7,9 +7,9 @@
#import <AppKit/AppKit.h>
#include <Carbon/Carbon.h>
+#include "base/apple/foundation_util.h"
#include "base/check.h"
#include "base/feature_list.h"
-#include "base/mac/foundation_util.h"
#include "base/no_destructor.h"
#include "build/buildflag.h"
#include "chrome/app/chrome_command_ids.h"
diff --git a/chrome/browser/icon_loader_mac.mm b/chrome/browser/icon_loader_mac.mm
index 572c64b..1f9067b 100644
--- a/chrome/browser/icon_loader_mac.mm
+++ b/chrome/browser/icon_loader_mac.mm
@@ -8,10 +8,10 @@
#import <CoreServices/CoreServices.h> // pre-macOS 11
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h> // macOS 11
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/thread_pool.h"
#include "base/threading/thread.h"
@@ -28,7 +28,7 @@
if (@available(macOS 11, *)) {
UTType* type;
- NSURL* file_url = base::mac::FilePathToNSURL(file_path);
+ NSURL* file_url = base::apple::FilePathToNSURL(file_path);
if (file_url && [file_url getResourceValue:&type
forKey:NSURLContentTypeKey
error:nil]) {
@@ -50,7 +50,7 @@
return base::SysNSStringToUTF8(UTTypeContent.identifier);
} else {
NSString* type;
- NSURL* file_url = base::mac::FilePathToNSURL(file_path);
+ NSURL* file_url = base::apple::FilePathToNSURL(file_path);
if (file_url && [file_url getResourceValue:&type
forKey:NSURLTypeIdentifierKey
error:nil]) {
diff --git a/chrome/browser/importer/importer_list.cc b/chrome/browser/importer/importer_list.cc
index d31c78f6..0919ea2 100644
--- a/chrome/browser/importer/importer_list.cc
+++ b/chrome/browser/importer/importer_list.cc
@@ -19,7 +19,7 @@
#include "ui/base/l10n/l10n_util.h"
#if BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "chrome/common/importer/safari_importer_utils.h"
#endif
@@ -73,8 +73,9 @@
base::BlockingType::MAY_BLOCK);
uint16_t items = importer::NONE;
- if (!SafariImporterCanImport(base::mac::GetUserLibraryPath(), &items))
+ if (!SafariImporterCanImport(base::apple::GetUserLibraryPath(), &items)) {
return;
+ }
importer::SourceProfile safari;
safari.importer_name = l10n_util::GetStringUTF16(IDS_IMPORT_FROM_SAFARI);
diff --git a/chrome/browser/local_discovery/service_discovery_client_mac.mm b/chrome/browser/local_discovery/service_discovery_client_mac.mm
index eea2807..5e7dbd1e 100644
--- a/chrome/browser/local_discovery/service_discovery_client_mac.mm
+++ b/chrome/browser/local_discovery/service_discovery_client_mac.mm
@@ -12,8 +12,8 @@
#include <memory>
+#include "base/apple/foundation_util.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/message_loop/message_pump_type.h"
#include "base/strings/sys_string_conversions.h"
#import "base/task/single_thread_task_runner.h"
diff --git a/chrome/browser/mac/auth_session_request_browsertest.mm b/chrome/browser/mac/auth_session_request_browsertest.mm
index 8f4d9288..8bfb5f2 100644
--- a/chrome/browser/mac/auth_session_request_browsertest.mm
+++ b/chrome/browser/mac/auth_session_request_browsertest.mm
@@ -4,7 +4,7 @@
#import "chrome/browser/app_controller_mac.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_test_util.h"
diff --git a/chrome/browser/mac/bluetooth_utility.mm b/chrome/browser/mac/bluetooth_utility.mm
index 97e4c7b..b053c51a 100644
--- a/chrome/browser/mac/bluetooth_utility.mm
+++ b/chrome/browser/mac/bluetooth_utility.mm
@@ -9,7 +9,7 @@
#include <IOKit/IOKitLib.h>
#include "base/apple/bridging.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_ioobject.h"
@@ -42,7 +42,7 @@
NSDictionary* objc_dict = base::apple::CFToNSPtrCast(dict.get());
NSNumber* lmp_version =
- base::mac::ObjCCast<NSNumber>(objc_dict[@"LMPVersion"]);
+ base::apple::ObjCCast<NSNumber>(objc_dict[@"LMPVersion"]);
if (!lmp_version)
continue;
@@ -51,7 +51,7 @@
continue;
NSData* data =
- base::mac::ObjCCast<NSData>(objc_dict[@"HCISupportedFeatures"]);
+ base::apple::ObjCCast<NSData>(objc_dict[@"HCISupportedFeatures"]);
NSUInteger supported_features_index = 4;
NSUInteger length = [data length];
diff --git a/chrome/browser/mac/dock.mm b/chrome/browser/mac/dock.mm
index e6049bfc..cbf20386 100644
--- a/chrome/browser/mac/dock.mm
+++ b/chrome/browser/mac/dock.mm
@@ -13,9 +13,9 @@
#include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/launchd.h"
#include "build/branding_buildflags.h"
@@ -53,7 +53,7 @@
base::ScopedCFTypeRef<CFPropertyListRef> property_list(
_CFURLCopyPropertyListRepresentation(base::apple::NSToCFPtrCast(url)));
CFDictionaryRef dictionary =
- base::mac::CFCast<CFDictionaryRef>(property_list);
+ base::apple::CFCast<CFDictionaryRef>(property_list);
if (!dictionary)
return nil;
@@ -128,7 +128,7 @@
if (!app_bundle)
return NO;
- NSArray* activities = base::mac::ObjCCast<NSArray>(
+ NSArray* activities = base::apple::ObjCCast<NSArray>(
[app_bundle objectForInfoDictionaryKey:@"NSUserActivityTypes"]);
if (!activities)
return NO;
diff --git a/chrome/browser/mac/initial_prefs.mm b/chrome/browser/mac/initial_prefs.mm
index e032fa2..1e948ab 100644
--- a/chrome/browser/mac/initial_prefs.mm
+++ b/chrome/browser/mac/initial_prefs.mm
@@ -4,8 +4,8 @@
#include "chrome/browser/mac/initial_prefs.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file_util.h"
-#include "base/mac/foundation_util.h"
#include "build/branding_buildflags.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_paths_internal.h"
@@ -67,8 +67,9 @@
// On chromium builds, try
// /Library/Application Support/Chromium/Chromium Master Preferences
base::FilePath search_path;
- if (!base::mac::GetLocalDirectory(kSearchPath, &search_path))
+ if (!base::apple::GetLocalDirectory(kSearchPath, &search_path)) {
return base::FilePath();
+ }
base::FilePath new_path = search_path.Append(kInitialPreferencesDirectory)
.Append(kInitialPreferencesFileName);
diff --git a/chrome/browser/mac/install_from_dmg.mm b/chrome/browser/mac/install_from_dmg.mm
index 17bdaed..2f2d138f 100644
--- a/chrome/browser/mac/install_from_dmg.mm
+++ b/chrome/browser/mac/install_from_dmg.mm
@@ -21,6 +21,7 @@
#include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/mach_logging.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
@@ -29,7 +30,6 @@
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/mac/authorization_util.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_authorizationref.h"
#include "base/mac/scoped_ioobject.h"
@@ -136,7 +136,7 @@
}
CFStringRef disk_image_url_string =
- base::mac::CFCast<CFStringRef>(disk_image_url_cftyperef.get());
+ base::apple::CFCast<CFStringRef>(disk_image_url_cftyperef.get());
if (!disk_image_url_string) {
base::ScopedCFTypeRef<CFStringRef> observed_type_cf(
CFCopyTypeIDDescription(CFGetTypeID(disk_image_url_cftyperef)));
@@ -183,7 +183,7 @@
}
CFDataRef image_path_data =
- base::mac::CFCast<CFDataRef>(image_path_cftyperef.get());
+ base::apple::CFCast<CFDataRef>(image_path_cftyperef.get());
if (!image_path_data) {
base::ScopedCFTypeRef<CFStringRef> observed_type_cf(
CFCopyTypeIDDescription(CFGetTypeID(image_path_cftyperef)));
@@ -388,7 +388,7 @@
// call EjectAndTrashDiskImage on dmg_bsd_device_name.
bool LaunchInstalledApp(NSString* installed_path,
const std::string& dmg_bsd_device_name) {
- base::FilePath browser_path = base::mac::NSStringToFilePath(installed_path);
+ base::FilePath browser_path = base::apple::NSStringToFilePath(installed_path);
base::FilePath helper_path = browser_path.Append("Contents/Frameworks");
helper_path = helper_path.Append(chrome::kFrameworkName);
diff --git a/chrome/browser/mac/keystone_glue.mm b/chrome/browser/mac/keystone_glue.mm
index 1195ff4..535cb61e 100644
--- a/chrome/browser/mac/keystone_glue.mm
+++ b/chrome/browser/mac/keystone_glue.mm
@@ -13,13 +13,13 @@
#include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/file_version_info.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/mac/authorization_util.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/ref_counted.h"
#include "base/no_destructor.h"
#include "base/strings/string_number_conversions.h"
@@ -302,15 +302,16 @@
NSDictionary* infoDictionary = self.infoDictionary;
NSString* productID =
- base::mac::ObjCCast<NSString>(infoDictionary[@"KSProductID"]);
+ base::apple::ObjCCast<NSString>(infoDictionary[@"KSProductID"]);
if (productID == nil) {
productID = appBundle.bundleIdentifier;
}
NSString* appPath = appBundle.bundlePath;
- NSString* url = base::mac::ObjCCast<NSString>(infoDictionary[@"KSUpdateURL"]);
+ NSString* url =
+ base::apple::ObjCCast<NSString>(infoDictionary[@"KSUpdateURL"]);
NSString* version =
- base::mac::ObjCCast<NSString>(infoDictionary[kVersionKey]);
+ base::apple::ObjCCast<NSString>(infoDictionary[kVersionKey]);
if (!productID || !appPath || !url || !version) {
// If parameters required for Keystone are missing, don't use it.
@@ -386,14 +387,14 @@
NSDictionary* infoDictionary = [self infoDictionary];
NSString* appBundleBrandID =
- base::mac::ObjCCast<NSString>(infoDictionary[kBrandKey]);
+ base::apple::ObjCCast<NSString>(infoDictionary[kBrandKey]);
NSString* storedBrandID = nil;
if ([fm fileExistsAtPath:userBrandFile]) {
NSDictionary* storedBrandDict =
[NSDictionary dictionaryWithContentsOfFile:userBrandFile];
storedBrandID =
- base::mac::ObjCCast<NSString>(storedBrandDict[kBrandKey]);
+ base::apple::ObjCCast<NSString>(storedBrandDict[kBrandKey]);
}
if ((appBundleBrandID != nil) &&
@@ -543,8 +544,8 @@
- (void)registrationComplete:(NSNotification*)notification {
NSDictionary* userInfo = notification.userInfo;
NSNumber* status =
- base::mac::ObjCCast<NSNumber>(userInfo[ksr::KSRegistrationStatusKey]);
- NSString* errorMessages = base::mac::ObjCCast<NSString>(
+ base::apple::ObjCCast<NSNumber>(userInfo[ksr::KSRegistrationStatusKey]);
+ NSString* errorMessages = base::apple::ObjCCast<NSString>(
userInfo[ksr::KSRegistrationUpdateCheckRawErrorMessagesKey]);
if (status.boolValue) {
@@ -596,11 +597,11 @@
- (void)checkForUpdateComplete:(NSNotification*)notification {
NSDictionary* userInfo = notification.userInfo;
- NSNumber* error = base::mac::ObjCCast<NSNumber>(
+ NSNumber* error = base::apple::ObjCCast<NSNumber>(
userInfo[ksr::KSRegistrationUpdateCheckErrorKey]);
NSNumber* status =
- base::mac::ObjCCast<NSNumber>(userInfo[ksr::KSRegistrationStatusKey]);
- NSString* errorMessages = base::mac::ObjCCast<NSString>(
+ base::apple::ObjCCast<NSNumber>(userInfo[ksr::KSRegistrationStatusKey]);
+ NSString* errorMessages = base::apple::ObjCCast<NSString>(
userInfo[ksr::KSRegistrationUpdateCheckRawErrorMessagesKey]);
if (error.boolValue) {
@@ -610,8 +611,8 @@
} else if (status.boolValue) {
// If an update is known to be available, go straight to
// -updateStatus:version:. It doesn't matter what's currently on disk.
- NSString* version =
- base::mac::ObjCCast<NSString>(userInfo[ksr::KSRegistrationVersionKey]);
+ NSString* version = base::apple::ObjCCast<NSString>(
+ userInfo[ksr::KSRegistrationVersionKey]);
[self updateStatus:kAutoupdateAvailable
version:version
error:errorMessages];
@@ -641,9 +642,9 @@
- (void)installUpdateComplete:(NSNotification*)notification {
NSDictionary* userInfo = notification.userInfo;
- NSNumber* successfulInstall = base::mac::ObjCCast<NSNumber>(
+ NSNumber* successfulInstall = base::apple::ObjCCast<NSNumber>(
userInfo[ksr::KSUpdateCheckSuccessfullyInstalledKey]);
- NSString* errorMessages = base::mac::ObjCCast<NSString>(
+ NSString* errorMessages = base::apple::ObjCCast<NSString>(
userInfo[ksr::KSRegistrationUpdateCheckRawErrorMessagesKey]);
// http://crbug.com/160308 and b/7517358: when using system Keystone and on
@@ -667,7 +668,7 @@
NSString* appInfoPlistPath = [self appInfoPlistPath];
NSDictionary* infoPlist =
[NSDictionary dictionaryWithContentsOfFile:appInfoPlistPath];
- return base::mac::ObjCCast<NSString>(
+ return base::apple::ObjCCast<NSString>(
infoPlist[@"CFBundleShortVersionString"]);
}
@@ -752,8 +753,8 @@
- (AutoupdateStatus)recentStatus {
NSDictionary* dictionary = _recentNotification.userInfo;
- NSNumber* status =
- base::mac::ObjCCastStrict<NSNumber>(dictionary[kAutoupdateStatusStatus]);
+ NSNumber* status = base::apple::ObjCCastStrict<NSNumber>(
+ dictionary[kAutoupdateStatusStatus]);
return static_cast<AutoupdateStatus>(status.intValue);
}
@@ -818,7 +819,7 @@
// If the bundled version is missing or broken, this question is irrelevant.
NSString* bundledKeystoneVersionString =
- base::mac::ObjCCast<NSString>(bundledKeystonePlistContents[versionKey]);
+ base::apple::ObjCCast<NSString>(bundledKeystonePlistContents[versionKey]);
if (!bundledKeystoneVersionString.length)
return YES;
base::Version bundled_version(
@@ -827,7 +828,7 @@
return YES;
NSString* systemKeystoneVersionString =
- base::mac::ObjCCast<NSString>(systemKeystonePlistContents[versionKey]);
+ base::apple::ObjCCast<NSString>(systemKeystonePlistContents[versionKey]);
if (!systemKeystoneVersionString.length)
return NO;
@@ -1040,7 +1041,7 @@
- (void)promotionComplete:(NSNotification*)notification {
NSDictionary* userInfo = notification.userInfo;
NSNumber* status =
- base::mac::ObjCCast<NSNumber>(userInfo[ksr::KSRegistrationStatusKey]);
+ base::apple::ObjCCast<NSNumber>(userInfo[ksr::KSRegistrationStatusKey]);
if (status.boolValue) {
if (_synchronousPromotion) {
@@ -1173,7 +1174,7 @@
NSDictionary* dict =
[NSDictionary dictionaryWithContentsOfFile:brand_path];
- NSString* brand_code = base::mac::ObjCCast<NSString>(dict[kBrandKey]);
+ NSString* brand_code = base::apple::ObjCCast<NSString>(dict[kBrandKey]);
if (brand_code)
return base::SysNSStringToUTF8(brand_code);
diff --git a/chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm b/chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm
index d9bcb17..045024d 100644
--- a/chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm
+++ b/chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm
@@ -6,13 +6,13 @@
#import <AVFoundation/AVFoundation.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/check.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
-#include "base/mac/foundation_util.h"
#include "base/no_destructor.h"
#import "base/task/sequenced_task_runner.h"
#include "base/task/sequenced_task_runner.h"
diff --git a/chrome/browser/media/webrtc/window_icon_util_mac.mm b/chrome/browser/media/webrtc/window_icon_util_mac.mm
index 8f718ad..7838237 100644
--- a/chrome/browser/media/webrtc/window_icon_util_mac.mm
+++ b/chrome/browser/media/webrtc/window_icon_util_mac.mm
@@ -6,8 +6,8 @@
#import <Cocoa/Cocoa.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "third_party/libyuv/include/libyuv/convert_argb.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -24,10 +24,10 @@
return gfx::ImageSkia();
}
- CFDictionaryRef window = base::mac::CFCastStrict<CFDictionaryRef>(
+ CFDictionaryRef window = base::apple::CFCastStrict<CFDictionaryRef>(
CFArrayGetValueAtIndex(window_array, 0));
- CFNumberRef pid_ref =
- base::mac::GetValueFromDictionary<CFNumberRef>(window, kCGWindowOwnerPID);
+ CFNumberRef pid_ref = base::apple::GetValueFromDictionary<CFNumberRef>(
+ window, kCGWindowOwnerPID);
int pid;
CFNumberGetValue(pid_ref, kCFNumberIntType, &pid);
diff --git a/chrome/browser/media/wv_test_license_server_config.cc b/chrome/browser/media/wv_test_license_server_config.cc
index 92735e3a..543aca9 100644
--- a/chrome/browser/media/wv_test_license_server_config.cc
+++ b/chrome/browser/media/wv_test_license_server_config.cc
@@ -18,7 +18,7 @@
#include "net/test/python_utils.h"
#if BUILDFLAG(IS_APPLE)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
namespace {
@@ -46,8 +46,9 @@
}
#if BUILDFLAG(IS_APPLE)
- if (base::mac::AmIBundled())
+ if (base::apple::AmIBundled()) {
generated_code_dir = generated_code_dir.DirName().DirName().DirName();
+ }
#endif
const base::FilePath kPyProto(FILE_PATH_LITERAL("pyproto"));
diff --git a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm
index a3ccc19..255e6fdc 100644
--- a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm
+++ b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm
@@ -7,11 +7,11 @@
#include "base/files/file_path.h"
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/sys_string_conversions.h"
#include "base/synchronization/waitable_event.h"
@@ -87,7 +87,7 @@
didDownloadSelector:(SEL)selector
contextInfo:(void*)contextInfo {
base::FilePath saveDir =
- base::mac::NSURLToFilePath(options[ICDownloadsDirectoryURL]);
+ base::apple::NSURLToFilePath(options[ICDownloadsDirectoryURL]);
std::string saveAsFilename =
base::SysNSStringToUTF8(options[ICSaveAsFilename]);
// It appears that the ImageCapture library adds an extension to the requested
diff --git a/chrome/browser/media_galleries/media_galleries_test_util.cc b/chrome/browser/media_galleries/media_galleries_test_util.cc
index a1183db..2e0bd3d 100644
--- a/chrome/browser/media_galleries/media_galleries_test_util.cc
+++ b/chrome/browser/media_galleries/media_galleries_test_util.cc
@@ -29,7 +29,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#endif // BUILDFLAG(IS_MAC)
diff --git a/chrome/browser/memory_details_mac.cc b/chrome/browser/memory_details_mac.cc
index 19f868c..eb15b81d 100644
--- a/chrome/browser/memory_details_mac.cc
+++ b/chrome/browser/memory_details_mac.cc
@@ -10,10 +10,10 @@
#include <set>
#include <string>
+#include "base/apple/foundation_util.h"
#include "base/file_version_info.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/process/process_iterator.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/chrome/browser/password_manager/password_manager_util_mac.mm b/chrome/browser/password_manager/password_manager_util_mac.mm
index cbf1b19..d27cbf7 100644
--- a/chrome/browser/password_manager/password_manager_util_mac.mm
+++ b/chrome/browser/password_manager/password_manager_util_mac.mm
@@ -9,9 +9,9 @@
#include <Security/Authorization.h>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/mac/authorization_util.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/scoped_authorizationref.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/grit/chromium_strings.h"
diff --git a/chrome/browser/platform_util_mac.mm b/chrome/browser/platform_util_mac.mm
index 0cb2dec..185ea4c 100644
--- a/chrome/browser/platform_util_mac.mm
+++ b/chrome/browser/platform_util_mac.mm
@@ -6,13 +6,13 @@
#import <Cocoa/Cocoa.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/browser/platform_util_internal.h"
#include "content/public/browser/browser_task_traits.h"
@@ -38,7 +38,7 @@
void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) {
DCHECK([NSThread isMainThread]);
- NSURL* url = base::mac::FilePathToNSURL(full_path);
+ NSURL* url = base::apple::FilePathToNSURL(full_path);
// The Finder creates a new window on each `full_path` reveal. Skip
// revealing the path during testing to avoid an avalanche of new
@@ -52,7 +52,7 @@
void OpenFileOnMainThread(const base::FilePath& full_path) {
DCHECK([NSThread isMainThread]);
- NSURL* url = base::mac::FilePathToNSURL(full_path);
+ NSURL* url = base::apple::FilePathToNSURL(full_path);
if (!url)
return;
@@ -71,7 +71,7 @@
FROM_HERE, base::BindOnce(&OpenFileOnMainThread, path));
return;
case OPEN_FOLDER:
- NSURL* url = base::mac::FilePathToNSURL(path);
+ NSURL* url = base::apple::FilePathToNSURL(path);
if (!url)
return;
diff --git a/chrome/browser/policy/browser_dm_token_storage_mac.mm b/chrome/browser/policy/browser_dm_token_storage_mac.mm
index 55c655ff..7598e551 100644
--- a/chrome/browser/policy/browser_dm_token_storage_mac.mm
+++ b/chrome/browser/policy/browser_dm_token_storage_mac.mm
@@ -6,6 +6,7 @@
#include <string>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/base64url.h"
#include "base/files/file_util.h"
@@ -14,7 +15,6 @@
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/hash/sha1.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_ioobject.h"
#include "base/metrics/histogram_functions.h"
@@ -116,7 +116,7 @@
!CFPreferencesAppValueIsForced(kEnrollmentTokenPolicyName, kBundleId)) {
return false;
}
- CFStringRef value_string = base::mac::CFCast<CFStringRef>(value);
+ CFStringRef value_string = base::apple::CFCast<CFStringRef>(value);
if (!value_string)
return false;
@@ -146,7 +146,7 @@
return absl::optional<bool>();
}
- CFBooleanRef value_bool = base::mac::CFCast<CFBooleanRef>(value);
+ CFBooleanRef value_bool = base::apple::CFCast<CFBooleanRef>(value);
if (!value_bool)
return absl::optional<bool>();
return value_bool == kCFBooleanTrue;
diff --git a/chrome/browser/policy/browser_dm_token_storage_mac_unittest.cc b/chrome/browser/policy/browser_dm_token_storage_mac_unittest.cc
index 574c335b..bc8042c 100644
--- a/chrome/browser/policy/browser_dm_token_storage_mac_unittest.cc
+++ b/chrome/browser/policy/browser_dm_token_storage_mac_unittest.cc
@@ -7,12 +7,12 @@
#include <iostream>
#include <memory>
+#include "base/apple/foundation_util.h"
#include "base/base64url.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/hash/sha1.h"
-#include "base/mac/foundation_util.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/chrome/browser/policy/chrome_browser_policy_connector.cc b/chrome/browser/policy/chrome_browser_policy_connector.cc
index 7f0d793..941b9a4f 100644
--- a/chrome/browser/policy/chrome_browser_policy_connector.cc
+++ b/chrome/browser/policy/chrome_browser_policy_connector.cc
@@ -49,7 +49,7 @@
#include "components/policy/core/common/policy_loader_win.h"
#elif BUILDFLAG(IS_MAC)
#include <CoreFoundation/CoreFoundation.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "components/policy/core/common/policy_loader_mac.h"
#include "components/policy/core/common/preferences_mac.h"
@@ -324,7 +324,7 @@
CFStringRef bundle_id = CFSTR("com.google.Chrome");
#else
base::ScopedCFTypeRef<CFStringRef> bundle_id(
- base::SysUTF8ToCFStringRef(base::mac::BaseBundleID()));
+ base::SysUTF8ToCFStringRef(base::apple::BaseBundleID()));
#endif
auto loader = std::make_unique<PolicyLoaderMac>(
base::ThreadPool::CreateSequencedTaskRunner(
diff --git a/chrome/browser/policy/policy_path_parser_mac.mm b/chrome/browser/policy/policy_path_parser_mac.mm
index bbdee2b..d374ab3a 100644
--- a/chrome/browser/policy/policy_path_parser_mac.mm
+++ b/chrome/browser/policy/policy_path_parser_mac.mm
@@ -10,10 +10,10 @@
#include <string>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_path.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "build/branding_buildflags.h"
#include "components/policy/policy_constants.h"
@@ -104,7 +104,7 @@
CFStringRef bundle_id = CFSTR("com.google.Chrome");
#else
base::ScopedCFTypeRef<CFStringRef> bundle_id(
- base::SysUTF8ToCFStringRef(base::mac::BaseBundleID()));
+ base::SysUTF8ToCFStringRef(base::apple::BaseBundleID()));
#endif
base::ScopedCFTypeRef<CFStringRef> key(
@@ -114,7 +114,7 @@
if (!value || !CFPreferencesAppValueIsForced(key, bundle_id))
return;
- CFStringRef value_string = base::mac::CFCast<CFStringRef>(value);
+ CFStringRef value_string = base::apple::CFCast<CFStringRef>(value);
if (!value_string)
return;
diff --git a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac_unittest.cc
index 3d5c4b9..e24103f4 100644
--- a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac_unittest.cc
@@ -10,11 +10,11 @@
#include <memory>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/mac/foundation_util.h"
#include "base/path_service.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/browser/safe_browsing/incident_reporting/incident.h"
diff --git a/chrome/browser/safe_browsing/signature_evaluator_mac.mm b/chrome/browser/safe_browsing/signature_evaluator_mac.mm
index 8dc6c086..7cd25b8 100644
--- a/chrome/browser/safe_browsing/signature_evaluator_mac.mm
+++ b/chrome/browser/safe_browsing/signature_evaluator_mac.mm
@@ -12,8 +12,8 @@
#include <sys/xattr.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
@@ -49,15 +49,15 @@
// cheat by bridging to Foundation types.
id ns_obj = (__bridge id)obj;
- if (NSString* str = base::mac::ObjCCast<NSString>(ns_obj)) {
+ if (NSString* str = base::apple::ObjCCast<NSString>(ns_obj)) {
output->assign(str.fileSystemRepresentation);
return true;
}
- if (NSURL* url = base::mac::ObjCCast<NSURL>(ns_obj)) {
+ if (NSURL* url = base::apple::ObjCCast<NSURL>(ns_obj)) {
output->assign(url.path.fileSystemRepresentation);
return true;
}
- if (NSBundle* bundle = base::mac::ObjCCast<NSBundle>(ns_obj)) {
+ if (NSBundle* bundle = base::apple::ObjCCast<NSBundle>(ns_obj)) {
output->assign(bundle.bundlePath.fileSystemRepresentation);
return true;
}
@@ -101,7 +101,7 @@
CFTypeRef detail,
const base::FilePath& bundle_path,
ClientIncidentReport_IncidentData_BinaryIntegrityIncident* incident) {
- if (CFArrayRef array = base::mac::CFCast<CFArrayRef>(detail)) {
+ if (CFArrayRef array = base::apple::CFCast<CFArrayRef>(detail)) {
for (CFIndex i = 0; i < CFArrayGetCount(array); ++i) {
ReportAlteredFiles(CFArrayGetValueAtIndex(array, i), bundle_path,
incident);
@@ -176,7 +176,8 @@
}
bool MacSignatureEvaluator::Initialize() {
- base::ScopedCFTypeRef<CFURLRef> code_url = base::mac::FilePathToCFURL(path_);
+ base::ScopedCFTypeRef<CFURLRef> code_url =
+ base::apple::FilePathToCFURL(path_);
if (!code_url)
return false;
@@ -214,13 +215,13 @@
if (SecCodeCopySigningInformation(code_, kSecCSDefaultFlags,
info_dict.InitializeInto()) ==
errSecSuccess) {
- CFURLRef exec_url = base::mac::CFCastStrict<CFURLRef>(
+ CFURLRef exec_url = base::apple::CFCastStrict<CFURLRef>(
CFDictionaryGetValue(info_dict, kSecCodeInfoMainExecutable));
if (!exec_url)
return false;
exec_path =
- base::mac::NSURLToFilePath(base::apple::CFToNSPtrCast(exec_url));
+ base::apple::NSURLToFilePath(base::apple::CFToNSPtrCast(exec_url));
if (exec_path != path_) {
ReportAlteredFiles(exec_url, path_, incident);
} else {
diff --git a/chrome/browser/shell_integration_mac.mm b/chrome/browser/shell_integration_mac.mm
index d2cd553..97547d9 100644
--- a/chrome/browser/shell_integration_mac.mm
+++ b/chrome/browser/shell_integration_mac.mm
@@ -9,8 +9,8 @@
#include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/strings/sys_string_conversions.h"
#include "build/branding_buildflags.h"
@@ -187,14 +187,14 @@
std::vector<base::FilePath> app_paths;
app_paths.reserve(app_urls.count);
for (NSURL* app_url in app_urls) {
- app_paths.push_back(base::mac::NSURLToFilePath(app_url));
+ app_paths.push_back(base::apple::NSURLToFilePath(app_url));
}
return app_paths;
}
bool CanApplicationHandleURL(const base::FilePath& app_path, const GURL& url) {
NSURL* ns_item_url = net::NSURLWithGURL(url);
- NSURL* ns_app_url = base::mac::FilePathToNSURL(app_path);
+ NSURL* ns_app_url = base::apple::FilePathToNSURL(app_path);
Boolean result = FALSE;
LSCanURLAcceptURL(base::apple::NSToCFPtrCast(ns_item_url),
base::apple::NSToCFPtrCast(ns_app_url), kLSRolesAll,
diff --git a/chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.mm b/chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.mm
index a4b73c4..1a0ffce8 100644
--- a/chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.mm
+++ b/chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.mm
@@ -4,7 +4,7 @@
#import "chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#import "chrome/browser/app_controller_mac.h"
#import "chrome/browser/ui/cocoa/applescript/apple_event_util.h"
diff --git a/chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.mm b/chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.mm
index 215779e8..4835780 100644
--- a/chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.mm
+++ b/chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.mm
@@ -4,9 +4,9 @@
#import "chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.h"
+#import "base/apple/foundation_util.h"
#include "base/check.h"
#include "base/check_op.h"
-#import "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/uuid.h"
#import "chrome/browser/app_controller_mac.h"
diff --git a/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.mm b/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.mm
index 94ed9ef..58ca6e7 100644
--- a/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.mm
+++ b/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.mm
@@ -8,7 +8,7 @@
#include <map>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#include "base/notreached.h"
#import "chrome/browser/app_controller_mac.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
diff --git a/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript_browsertest.mm b/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript_browsertest.mm
index 06612a8..bbcd75f 100644
--- a/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript_browsertest.mm
+++ b/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript_browsertest.mm
@@ -4,7 +4,7 @@
#import <Foundation/Foundation.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_tabstrip.h"
@@ -109,9 +109,9 @@
}
BookmarkFolderAppleScript* other_bookmarks =
- base::mac::ObjCCast<BookmarkFolderAppleScript>([NSApp otherBookmarks]);
+ base::apple::ObjCCast<BookmarkFolderAppleScript>([NSApp otherBookmarks]);
EXPECT_NSEQ(@"Other Bookmarks", other_bookmarks.title);
BookmarkFolderAppleScript* bookmarks_bar =
- base::mac::ObjCCast<BookmarkFolderAppleScript>([NSApp bookmarksBar]);
+ base::apple::ObjCCast<BookmarkFolderAppleScript>([NSApp bookmarksBar]);
EXPECT_NSEQ(@"Bookmarks Bar", bookmarks_bar.title);
}
diff --git a/chrome/browser/ui/cocoa/applescript/element_applescript.mm b/chrome/browser/ui/cocoa/applescript/element_applescript.mm
index e7e3268..df6d2abc 100644
--- a/chrome/browser/ui/cocoa/applescript/element_applescript.mm
+++ b/chrome/browser/ui/cocoa/applescript/element_applescript.mm
@@ -6,7 +6,7 @@
#include <Foundation/Foundation.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
@implementation ElementAppleScript
@@ -19,7 +19,7 @@
// you can call this method.
- (NSScriptObjectSpecifier*)objectSpecifier {
return [[NSUniqueIDSpecifier alloc]
- initWithContainerClassDescription:base::mac::ObjCCast<
+ initWithContainerClassDescription:base::apple::ObjCCast<
NSScriptClassDescription>(
self.container.classDescription)
containerSpecifier:self.container.objectSpecifier
diff --git a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm
index 6137ab7..415652e5 100644
--- a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm
+++ b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm
@@ -4,10 +4,10 @@
#import "chrome/browser/ui/cocoa/applescript/tab_applescript.h"
+#include "base/apple/foundation_util.h"
#include "base/check.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
@@ -310,7 +310,7 @@
return;
}
- base::FilePath mainFile = base::mac::NSURLToFilePath(fileURL);
+ base::FilePath mainFile = base::apple::NSURLToFilePath(fileURL);
// We create a directory path at the folder within which the file exists.
// Eg. if main_file = '/Users/Foo/Documents/Google.html'
// then directory_path = '/Users/Foo/Documents/Google_files/'.
diff --git a/chrome/browser/ui/cocoa/applescript/window_applescript.mm b/chrome/browser/ui/cocoa/applescript/window_applescript.mm
index a9cfa468..6fbebd0 100644
--- a/chrome/browser/ui/cocoa/applescript/window_applescript.mm
+++ b/chrome/browser/ui/cocoa/applescript/window_applescript.mm
@@ -6,7 +6,7 @@
#include <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
diff --git a/chrome/browser/ui/cocoa/applescript/window_applescript_browsertest.mm b/chrome/browser/ui/cocoa/applescript/window_applescript_browsertest.mm
index be5969f..d5cd471 100644
--- a/chrome/browser/ui/cocoa/applescript/window_applescript_browsertest.mm
+++ b/chrome/browser/ui/cocoa/applescript/window_applescript_browsertest.mm
@@ -4,7 +4,7 @@
#import <Foundation/Foundation.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#import "chrome/browser/app_controller_mac.h"
#import "chrome/browser/chrome_browser_application_mac.h"
diff --git a/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm b/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm
index b2e7b22..986a15d8 100644
--- a/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm
+++ b/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm
@@ -6,9 +6,9 @@
#import <Cocoa/Cocoa.h>
+#import "base/apple/foundation_util.h"
#import "base/apple/scoped_objc_class_swizzler.h"
#include "base/command_line.h"
-#import "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
diff --git a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm
index e76b7a4..821aea4 100644
--- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm
+++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm
@@ -8,9 +8,9 @@
#include <memory>
+#import "base/apple/foundation_util.h"
#import "base/apple/scoped_cftyperef.h"
#include "base/functional/callback_helpers.h"
-#import "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "chrome/browser/apps/app_service/app_launch_params.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
diff --git a/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac_interactive_uitest.mm b/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac_interactive_uitest.mm
index d6763bdb..a41782b 100644
--- a/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac_interactive_uitest.mm
+++ b/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac_interactive_uitest.mm
@@ -4,8 +4,8 @@
#include "chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h"
+#import "base/apple/foundation_util.h"
#include "base/command_line.h"
-#import "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#import "chrome/browser/app_controller_mac.h"
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
index 7ca34a4..b24b48c3 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
@@ -4,7 +4,7 @@
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/sys_string_conversions.h"
diff --git a/chrome/browser/ui/cocoa/browser_window_command_handler.mm b/chrome/browser/ui/cocoa/browser_window_command_handler.mm
index 177b80f7..51a67968 100644
--- a/chrome/browser/ui/cocoa/browser_window_command_handler.mm
+++ b/chrome/browser/ui/cocoa/browser_window_command_handler.mm
@@ -4,8 +4,8 @@
#import "chrome/browser/ui/cocoa/browser_window_command_handler.h"
+#import "base/apple/foundation_util.h"
#include "base/check.h"
-#import "base/mac/foundation_util.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
@@ -22,8 +22,8 @@
namespace {
void SetToggleState(bool toggled, id item) {
- NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item);
- NSButton* buttonItem = base::mac::ObjCCast<NSButton>(item);
+ NSMenuItem* menuItem = base::apple::ObjCCast<NSMenuItem>(item);
+ NSButton* buttonItem = base::apple::ObjCCast<NSButton>(item);
if (menuItem) {
NSControlStateValue old_state = [menuItem state];
NSControlStateValue new_state =
@@ -87,7 +87,7 @@
if (result->set_toggle_state)
SetToggleState(result->new_toggle_state, item);
- if (NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item)) {
+ if (NSMenuItem* menuItem = base::apple::ObjCCast<NSMenuItem>(item)) {
if (result->disable_if_has_no_key_equivalent)
result->enable &= !![[menuItem keyEquivalent] length];
diff --git a/chrome/browser/ui/cocoa/browser_window_mac_browsertest.mm b/chrome/browser/ui/cocoa/browser_window_mac_browsertest.mm
index 65eb1a6..58938e0 100644
--- a/chrome/browser/ui/cocoa/browser_window_mac_browsertest.mm
+++ b/chrome/browser/ui/cocoa/browser_window_mac_browsertest.mm
@@ -59,7 +59,7 @@
IN_PROC_BROWSER_TEST_F(BrowserWindowMacTest,
DISABLED_MenuCommandsFromChildWindow) {
NativeWidgetMacNSWindow* window =
- base::mac::ObjCCastStrict<NativeWidgetMacNSWindow>(
+ base::apple::ObjCCastStrict<NativeWidgetMacNSWindow>(
browser()->window()->GetNativeWindow().GetNativeNSWindow());
// Create a child window.
diff --git a/chrome/browser/ui/cocoa/dock_icon.mm b/chrome/browser/ui/cocoa/dock_icon.mm
index ca8a1741..c7d8175 100644
--- a/chrome/browser/ui/cocoa/dock_icon.mm
+++ b/chrome/browser/ui/cocoa/dock_icon.mm
@@ -7,8 +7,8 @@
#include <stdint.h>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/check_op.h"
-#include "base/mac/foundation_util.h"
#include "content/public/browser/browser_thread.h"
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
@@ -209,7 +209,7 @@
- (void)setDownloads:(int)downloads {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DockTileView* dockTileView =
- base::mac::ObjCCast<DockTileView>(NSApp.dockTile.contentView);
+ base::apple::ObjCCast<DockTileView>(NSApp.dockTile.contentView);
if (downloads != [dockTileView downloads]) {
[dockTileView setDownloads:downloads];
@@ -220,7 +220,7 @@
- (void)setIndeterminate:(BOOL)indeterminate {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DockTileView* dockTileView =
- base::mac::ObjCCast<DockTileView>(NSApp.dockTile.contentView);
+ base::apple::ObjCCast<DockTileView>(NSApp.dockTile.contentView);
if (indeterminate != [dockTileView indeterminate]) {
[dockTileView setIndeterminate:indeterminate];
@@ -231,7 +231,7 @@
- (void)setProgress:(float)progress {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DockTileView* dockTileView =
- base::mac::ObjCCast<DockTileView>(NSApp.dockTile.contentView);
+ base::apple::ObjCCast<DockTileView>(NSApp.dockTile.contentView);
[dockTileView setProgress:progress];
}
diff --git a/chrome/browser/ui/cocoa/history_menu_bridge.mm b/chrome/browser/ui/cocoa/history_menu_bridge.mm
index 308ac30..71f3a6c 100644
--- a/chrome/browser/ui/cocoa/history_menu_bridge.mm
+++ b/chrome/browser/ui/cocoa/history_menu_bridge.mm
@@ -7,8 +7,8 @@
#include <stddef.h>
#include <string>
+#include "base/apple/foundation_util.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
diff --git a/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm b/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm
index a4a2eda7..42c3fbe5 100644
--- a/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm
+++ b/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm
@@ -4,7 +4,7 @@
#import "chrome/browser/ui/cocoa/history_menu_cocoa_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/user_metrics.h"
#include "chrome/app/chrome_command_ids.h" // IDC_HISTORY_MENU
diff --git a/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac_cocoa_browsertest.mm b/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac_cocoa_browsertest.mm
index 3952527a9..61c8d20 100644
--- a/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac_cocoa_browsertest.mm
+++ b/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac_cocoa_browsertest.mm
@@ -4,7 +4,7 @@
#include "chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac_cocoa.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/extensions/application_launch.h"
@@ -90,7 +90,8 @@
// Bring up the contextual menu from the textfield (actually its field
// editor).
- NSView* firstResponder = base::mac::ObjCCast<NSView>([window firstResponder]);
+ NSView* firstResponder =
+ base::apple::ObjCCast<NSView>([window firstResponder]);
[NSMenu popUpContextMenu:popupMenu
withEvent:[NSApp currentEvent]
forView:firstResponder];
diff --git a/chrome/browser/ui/cocoa/screentime/history_bridge.mm b/chrome/browser/ui/cocoa/screentime/history_bridge.mm
index 5a872e2..7c9cfc2 100644
--- a/chrome/browser/ui/cocoa/screentime/history_bridge.mm
+++ b/chrome/browser/ui/cocoa/screentime/history_bridge.mm
@@ -6,7 +6,7 @@
#import <ScreenTime/ScreenTime.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/screentime/history_deleter.h"
diff --git a/chrome/browser/ui/cocoa/screentime/history_deleter_impl.mm b/chrome/browser/ui/cocoa/screentime/history_deleter_impl.mm
index fe327bb..a97cebf 100644
--- a/chrome/browser/ui/cocoa/screentime/history_deleter_impl.mm
+++ b/chrome/browser/ui/cocoa/screentime/history_deleter_impl.mm
@@ -6,7 +6,7 @@
#import <ScreenTime/ScreenTime.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/memory/ptr_util.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
@@ -53,7 +53,7 @@
HistoryDeleterImpl::HistoryDeleterImpl() {
if (@available(macOS 12.1, *)) {
NSError* error = nil;
- NSString* bundle_id = base::SysUTF8ToNSString(base::mac::BaseBundleID());
+ NSString* bundle_id = base::SysUTF8ToNSString(base::apple::BaseBundleID());
platform_deleter_ = [[STWebHistory alloc] initWithBundleIdentifier:bundle_id
error:&error];
DCHECK(!error);
diff --git a/chrome/browser/ui/cocoa/screentime/webpage_controller_impl.mm b/chrome/browser/ui/cocoa/screentime/webpage_controller_impl.mm
index 0b857282..ce66e8c2 100644
--- a/chrome/browser/ui/cocoa/screentime/webpage_controller_impl.mm
+++ b/chrome/browser/ui/cocoa/screentime/webpage_controller_impl.mm
@@ -6,7 +6,7 @@
#include <ScreenTime/ScreenTime.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/sys_string_conversions.h"
#include "net/base/mac/url_conversions.h"
@@ -58,7 +58,7 @@
nativeController:platform_controller_]),
blocked_changed_callback_(blocked_changed_callback) {
NSError* error = nil;
- NSString* bundle_id = base::SysUTF8ToNSString(base::mac::BaseBundleID());
+ NSString* bundle_id = base::SysUTF8ToNSString(base::apple::BaseBundleID());
[platform_controller_ setBundleIdentifier:bundle_id error:&error];
}
diff --git a/chrome/browser/ui/cocoa/share_menu_controller.mm b/chrome/browser/ui/cocoa/share_menu_controller.mm
index 3095f89..e4dea5c 100644
--- a/chrome/browser/ui/cocoa/share_menu_controller.mm
+++ b/chrome/browser/ui/cocoa/share_menu_controller.mm
@@ -4,7 +4,7 @@
#import "chrome/browser/ui/cocoa/share_menu_controller.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/sys_string_conversions.h"
@@ -189,7 +189,7 @@
NSString* title = base::SysUTF16ToNSString(contents->GetTitle());
NSSharingService* service =
- base::mac::ObjCCastStrict<NSSharingService>([sender representedObject]);
+ base::apple::ObjCCastStrict<NSSharingService>([sender representedObject]);
service.delegate = self;
service.subject = title;
diff --git a/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar_unittest.mm b/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar_unittest.mm
index 1506aaa5..ec575df 100644
--- a/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar_unittest.mm
+++ b/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar_unittest.mm
@@ -6,7 +6,7 @@
#import <Cocoa/Cocoa.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
@@ -162,14 +162,14 @@
NSTouchBarItem* item =
[touch_bar itemForIdentifier:BrowserWindowDefaultTouchBar
.reloadOrStopItemIdentifier];
- NSButton* button = base::mac::ObjCCast<NSButton>([item view]);
+ NSButton* button = base::apple::ObjCCast<NSButton>([item view]);
EXPECT_EQ(IDC_RELOAD, [button tag]);
EXPECT_EQ([BrowserWindowDefaultTouchBar reloadIcon], [button image]);
[touch_bar_ setIsPageLoading:YES];
item = [touch_bar itemForIdentifier:BrowserWindowDefaultTouchBar
.reloadOrStopItemIdentifier];
- button = base::mac::ObjCCast<NSButton>([item view]);
+ button = base::apple::ObjCCast<NSButton>([item view]);
EXPECT_EQ(IDC_STOP, [button tag]);
EXPECT_EQ([BrowserWindowDefaultTouchBar navigateStopIcon], [button image]);
}
@@ -182,13 +182,13 @@
NSTouchBarItem* item =
[touch_bar itemForIdentifier:BrowserWindowDefaultTouchBar
.bookmarkStarItemIdentifier];
- NSButton* button = base::mac::ObjCCast<NSButton>([item view]);
+ NSButton* button = base::apple::ObjCCast<NSButton>([item view]);
EXPECT_EQ([BrowserWindowDefaultTouchBar starDefaultIcon], [button image]);
[touch_bar_ setIsStarred:YES];
item = [touch_bar itemForIdentifier:BrowserWindowDefaultTouchBar
.bookmarkStarItemIdentifier];
- button = base::mac::ObjCCast<NSButton>([item view]);
+ button = base::apple::ObjCCast<NSButton>([item view]);
EXPECT_EQ([BrowserWindowDefaultTouchBar starActiveIcon], [button image]);
}
@@ -197,7 +197,7 @@
NSTouchBar* touch_bar = [touch_bar_ makeTouchBar];
NSTouchBarItem* item = [touch_bar
itemForIdentifier:BrowserWindowDefaultTouchBar.backItemIdentifier];
- NSButton* button = base::mac::ObjCCast<NSButton>(item.view);
+ NSButton* button = base::apple::ObjCCast<NSButton>(item.view);
UpdateCommandEnabled(IDC_BACK, true);
EXPECT_TRUE(button.enabled);
@@ -211,7 +211,7 @@
NSTouchBar* touch_bar = [touch_bar_ makeTouchBar];
NSTouchBarItem* item = [touch_bar
itemForIdentifier:BrowserWindowDefaultTouchBar.forwardItemIdentifier];
- NSButton* button = base::mac::ObjCCast<NSButton>(item.view);
+ NSButton* button = base::apple::ObjCCast<NSButton>(item.view);
UpdateCommandEnabled(IDC_FORWARD, true);
EXPECT_TRUE(button.enabled);
diff --git a/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller_browsertest.mm b/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller_browsertest.mm
index e2e1b81..ccabb08 100644
--- a/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller_browsertest.mm
+++ b/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller_browsertest.mm
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#import "base/apple/foundation_util.h"
#include "base/apple/scoped_objc_class_swizzler.h"
-#import "base/mac/foundation_util.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
@@ -255,7 +255,7 @@
auto* current_touch_bar = [native_window() touchBar];
EXPECT_TRUE(current_touch_bar);
BrowserWindowDefaultTouchBar* touch_bar_delegate =
- base::mac::ObjCCastStrict<BrowserWindowDefaultTouchBar>(
+ base::apple::ObjCCastStrict<BrowserWindowDefaultTouchBar>(
[current_touch_bar delegate]);
EXPECT_FALSE([touch_bar_delegate isStarred]);
diff --git a/chrome/browser/ui/views/frame/browser_frame_mac.mm b/chrome/browser/ui/views/frame/browser_frame_mac.mm
index c9a06b1b..3cc34ea 100644
--- a/chrome/browser/ui/views/frame/browser_frame_mac.mm
+++ b/chrome/browser/ui/views/frame/browser_frame_mac.mm
@@ -6,7 +6,7 @@
#import "chrome/browser/ui/views/frame/browser_frame_mac.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/apps/app_shim/app_shim_host_mac.h"
#include "chrome/browser/apps/app_shim/app_shim_manager_mac.h"
@@ -413,7 +413,7 @@
// Clear delegates set in CreateNSWindow() to prevent objects with a reference
// to |window| attempting to validate commands by looking for a Browser*.
NativeWidgetMacNSWindow* ns_window =
- base::mac::ObjCCastStrict<NativeWidgetMacNSWindow>(
+ base::apple::ObjCCastStrict<NativeWidgetMacNSWindow>(
native_window.GetNativeNSWindow());
[ns_window setWindowTouchBarDelegate:nil];
}
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_mac.mm b/chrome/browser/ui/views/frame/immersive_mode_controller_mac.mm
index 693edcf..de784faa 100644
--- a/chrome/browser/ui/views/frame/immersive_mode_controller_mac.mm
+++ b/chrome/browser/ui/views/frame/immersive_mode_controller_mac.mm
@@ -8,8 +8,8 @@
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/check.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/ranges/algorithm.h"
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_mac_interactive_uitest.mm b/chrome/browser/ui/views/frame/immersive_mode_controller_mac_interactive_uitest.mm
index 4560e13..6d0fdd4 100644
--- a/chrome/browser/ui/views/frame/immersive_mode_controller_mac_interactive_uitest.mm
+++ b/chrome/browser/ui/views/frame/immersive_mode_controller_mac_interactive_uitest.mm
@@ -8,7 +8,7 @@
#include <tuple>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#import "base/mac/mac_util.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
@@ -44,7 +44,7 @@
// Convenience function to get the BrowserNativeWidgetWindow from the browser
// window.
BrowserNativeWidgetWindow* browser_window() {
- return base::mac::ObjCCastStrict<BrowserNativeWidgetWindow>(
+ return base::apple::ObjCCastStrict<BrowserNativeWidgetWindow>(
browser()->window()->GetNativeWindow().GetNativeNSWindow());
}
@@ -58,7 +58,7 @@
bool SecondBrowserWindowIsOnTheActiveSpace() {
NSWindow* second_browser_ns_window =
- base::mac::ObjCCastStrict<BrowserNativeWidgetWindow>(
+ base::apple::ObjCCastStrict<BrowserNativeWidgetWindow>(
second_browser_->window()->GetNativeWindow().GetNativeNSWindow());
return [second_browser_ns_window isOnActiveSpace];
@@ -157,7 +157,7 @@
bool WidgetWindowHasDeferredWindowOrderingCommands() {
NativeWidgetMacNSWindow* widgetWindow =
- base::mac::ObjCCastStrict<NativeWidgetMacNSWindow>(
+ base::apple::ObjCCastStrict<NativeWidgetMacNSWindow>(
widget_->GetNativeWindow().GetNativeNSWindow());
return [widgetWindow hasDeferredChildWindowOrderingCommandsForTesting];
diff --git a/chrome/browser/ui/webui/help/version_updater_mac.mm b/chrome/browser/ui/webui/help/version_updater_mac.mm
index d6beab6..ae390bda 100644
--- a/chrome/browser/ui/webui/help/version_updater_mac.mm
+++ b/chrome/browser/ui/webui/help/version_updater_mac.mm
@@ -10,13 +10,13 @@
#include <string>
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/mac/authorization_util.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/escape.h"
@@ -189,11 +189,11 @@
}
void VersionUpdaterMac::UpdateStatus(NSDictionary* dictionary) {
- AutoupdateStatus keystone_status = static_cast<AutoupdateStatus>(
- [base::mac::ObjCCastStrict<NSNumber>(dictionary[kAutoupdateStatusStatus])
- intValue]);
+ AutoupdateStatus keystone_status =
+ static_cast<AutoupdateStatus>([base::apple::ObjCCastStrict<NSNumber>(
+ dictionary[kAutoupdateStatusStatus]) intValue]);
std::string error_messages =
- base::SysNSStringToUTF8(base::mac::ObjCCastStrict<NSString>(
+ base::SysNSStringToUTF8(base::apple::ObjCCastStrict<NSString>(
dictionary[kAutoupdateStatusErrorMessages]));
bool enable_promote_button = true;
diff --git a/chrome/browser/ui/webui/settings/settings_utils_mac.mm b/chrome/browser/ui/webui/settings/settings_utils_mac.mm
index 929d53f..96204b8e 100644
--- a/chrome/browser/ui/webui/settings/settings_utils_mac.mm
+++ b/chrome/browser/ui/webui/settings/settings_utils_mac.mm
@@ -6,10 +6,10 @@
#include "chrome/browser/ui/webui/settings/settings_utils.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/launch_application.h"
#include "base/mac/mac_util.h"
#include "base/strings/sys_string_conversions.h"
@@ -44,7 +44,7 @@
void ShowManageSSLCertificates(content::WebContents* web_contents) {
NSURL* keychain_app = [NSWorkspace.sharedWorkspace
URLForApplicationWithBundleIdentifier:@"com.apple.keychainaccess"];
- base::mac::LaunchApplication(base::mac::NSURLToFilePath(keychain_app),
+ base::mac::LaunchApplication(base::apple::NSURLToFilePath(keychain_app),
/*command_line_args=*/{}, /*url_specs=*/{},
/*options=*/{}, base::DoNothing());
}
diff --git a/chrome/browser/updater/browser_updater_client_mac.mm b/chrome/browser/updater/browser_updater_client_mac.mm
index 57f35934..15e1feb 100644
--- a/chrome/browser/updater/browser_updater_client_mac.mm
+++ b/chrome/browser/updater/browser_updater_client_mac.mm
@@ -7,7 +7,7 @@
#include <string>
#include "base/apple/bundle_locations.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/strcat.h"
#include "chrome/browser/google/google_brand.h"
#include "chrome/browser/updater/browser_updater_client_util.h"
@@ -28,7 +28,7 @@
} // namespace
std::string BrowserUpdaterClient::GetAppId() {
- return base::mac::BaseBundleID();
+ return base::apple::BaseBundleID();
}
updater::RegistrationRequest BrowserUpdaterClient::GetRegistrationRequest() {
diff --git a/chrome/browser/updater/browser_updater_client_util_mac.mm b/chrome/browser/updater/browser_updater_client_util_mac.mm
index 727a553..b18b55d1 100644
--- a/chrome/browser/updater/browser_updater_client_util_mac.mm
+++ b/chrome/browser/updater/browser_updater_client_util_mac.mm
@@ -14,6 +14,7 @@
#include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
@@ -22,7 +23,6 @@
#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/mac/authorization_util.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/scoped_authorizationref.h"
#include "base/memory/scoped_refptr.h"
#include "base/process/launch.h"
@@ -204,9 +204,9 @@
base::FilePath plist_path =
outer_bundle.Append("Contents").Append("Info.plist");
NSDictionary* info_plist = [NSDictionary
- dictionaryWithContentsOfFile:base::mac::FilePathToNSString(plist_path)];
- return base::SysNSStringToUTF8(
- base::mac::ObjCCast<NSString>(info_plist[@"CFBundleShortVersionString"]));
+ dictionaryWithContentsOfFile:base::apple::FilePathToNSString(plist_path)];
+ return base::SysNSStringToUTF8(base::apple::ObjCCast<NSString>(
+ info_plist[@"CFBundleShortVersionString"]));
}
updater::UpdaterScope GetUpdaterScope() {
diff --git a/chrome/browser/updater/browser_updater_helper_client_mac.mm b/chrome/browser/updater/browser_updater_helper_client_mac.mm
index e6e288b08..4b4c18a 100644
--- a/chrome/browser/updater/browser_updater_helper_client_mac.mm
+++ b/chrome/browser/updater/browser_updater_helper_client_mac.mm
@@ -7,10 +7,10 @@
#import <Foundation/Foundation.h>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/bind_post_task.h"
@@ -68,7 +68,7 @@
};
[[xpc_connection_ remoteObjectProxyWithErrorHandler:errorHandler]
- setupSystemUpdaterWithBrowserPath:base::mac::FilePathToNSString(
+ setupSystemUpdaterWithBrowserPath:base::apple::FilePathToNSString(
base::apple::OuterBundlePath())
reply:reply];
}
diff --git a/chrome/browser/web_applications/os_integration/icns_encoder_unittest.cc b/chrome/browser/web_applications/os_integration/icns_encoder_unittest.cc
index c79e777..b50ebb2 100644
--- a/chrome/browser/web_applications/os_integration/icns_encoder_unittest.cc
+++ b/chrome/browser/web_applications/os_integration/icns_encoder_unittest.cc
@@ -8,12 +8,12 @@
#include <numeric>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/path_service.h"
#include "skia/ext/skia_utils_mac.h"
@@ -113,7 +113,7 @@
// Now use Image I/O methods to load the .icns file back in.
base::ScopedCFTypeRef<CFDictionaryRef> empty_dict(
CFDictionaryCreate(nullptr, nullptr, nullptr, 0, nullptr, nullptr));
- base::ScopedCFTypeRef<CFURLRef> url = base::mac::FilePathToCFURL(icon_path);
+ base::ScopedCFTypeRef<CFURLRef> url = base::apple::FilePathToCFURL(icon_path);
base::ScopedCFTypeRef<CGImageSourceRef> source(
CGImageSourceCreateWithURL(url, nullptr));
diff --git a/chrome/browser/web_applications/os_integration/web_app_run_on_os_login_mac_unittest.mm b/chrome/browser/web_applications/os_integration/web_app_run_on_os_login_mac_unittest.mm
index 35e6f5d..20220af 100644
--- a/chrome/browser/web_applications/os_integration/web_app_run_on_os_login_mac_unittest.mm
+++ b/chrome/browser/web_applications/os_integration/web_app_run_on_os_login_mac_unittest.mm
@@ -11,10 +11,10 @@
#include <memory>
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_path_override.h"
#include "chrome/browser/web_applications/os_integration/web_app_shortcut_mac.h"
@@ -77,7 +77,7 @@
public:
void SetUp() override {
WebAppTest::SetUp();
- base::mac::SetBaseBundleID(kFakeChromeBundleId);
+ base::apple::SetBaseBundleID(kFakeChromeBundleId);
override_registration_ =
OsIntegrationTestOverrideImpl::OverrideForTesting();
diff --git a/chrome/browser/web_applications/os_integration/web_app_shortcut_mac.mm b/chrome/browser/web_applications/os_integration/web_app_shortcut_mac.mm
index 1a75fdb..6a7f066e 100644
--- a/chrome/browser/web_applications/os_integration/web_app_shortcut_mac.mm
+++ b/chrome/browser/web_applications/os_integration/web_app_shortcut_mac.mm
@@ -15,6 +15,7 @@
#include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/base_switches.h"
#include "base/check_is_test.h"
@@ -28,7 +29,6 @@
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#import "base/mac/launch_application.h"
#include "base/mac/mac_util.h"
#include "base/memory/ref_counted.h"
@@ -269,7 +269,7 @@
base::FilePath GetWritableApplicationsDirectory() {
base::FilePath path;
- if (base::mac::GetUserDirectory(NSApplicationDirectory, &path)) {
+ if (base::apple::GetUserDirectory(NSApplicationDirectory, &path)) {
if (!base::DirectoryExists(path)) {
if (!base::CreateDirectory(path))
return base::FilePath();
@@ -290,7 +290,7 @@
// Given the path to an app bundle, return the URL of the Info.plist file.
NSURL* GetPlistURL(const base::FilePath& bundle_path) {
- return base::mac::FilePathToNSURL(
+ return base::apple::FilePathToNSURL(
bundle_path.Append("Contents").Append("Info.plist"));
}
@@ -348,9 +348,9 @@
base::FilePath GetFullProfilePath() const {
// Figure out the profile_path. Since the user_data_dir could contain the
// path to the web app data dir.
- base::FilePath user_data_dir = base::mac::NSStringToFilePath(
+ base::FilePath user_data_dir = base::apple::NSStringToFilePath(
plist_[app_mode::kCrAppModeUserDataDirKey]);
- base::FilePath profile_base_name = base::mac::NSStringToFilePath(
+ base::FilePath profile_base_name = base::apple::NSStringToFilePath(
plist_[app_mode::kCrAppModeProfileDirKey]);
if (user_data_dir.DirName().DirName().BaseName() == profile_base_name)
return user_data_dir.DirName().DirName();
@@ -420,10 +420,10 @@
// Manually append it.
// https://crbug.com/1286681
const base::FilePath framework_bundle_path =
- base::mac::AmIBundled() ? base::apple::FrameworkBundlePath()
- : base::apple::FrameworkBundlePath()
- .Append("Versions")
- .Append(version_info::GetVersionNumber());
+ base::apple::AmIBundled() ? base::apple::FrameworkBundlePath()
+ : base::apple::FrameworkBundlePath()
+ .Append("Versions")
+ .Append(version_info::GetVersionNumber());
command_line.AppendSwitchPath(app_mode::kLaunchedByChromeFrameworkBundlePath,
framework_bundle_path);
command_line.AppendSwitchPath(
@@ -451,7 +451,7 @@
runningApplicationsWithBundleIdentifier:base::SysUTF8ToNSString(
bundle_id)];
for (NSRunningApplication* app in apps) {
- if (base::mac::NSURLToFilePath(app.bundleURL) == bundle_path) {
+ if (base::apple::NSURLToFilePath(app.bundleURL) == bundle_path) {
return app;
}
}
@@ -462,7 +462,7 @@
apps = NSWorkspace.sharedWorkspace.runningApplications;
for (NSRunningApplication* app in apps) {
if (base::SysNSStringToUTF8(app.bundleIdentifier) == bundle_id &&
- base::mac::NSURLToFilePath(app.bundleURL) == bundle_path) {
+ base::apple::NSURLToFilePath(app.bundleURL) == bundle_path) {
return app;
}
}
@@ -750,7 +750,7 @@
}
[NSWorkspace.sharedWorkspace
setIcon:folder_icon_image
- forFile:base::mac::FilePathToNSString(apps_directory)
+ forFile:base::apple::FilePathToNSString(apps_directory)
options:0];
}
@@ -770,7 +770,7 @@
std::u16string localized_name =
shell_integration::GetAppShortcutsSubdirName();
NSDictionary* strings_dict = @{
- base::mac::FilePathToNSString(directory_name) :
+ base::apple::FilePathToNSString(directory_name) :
base::SysUTF16ToNSString(localized_name)
};
@@ -778,7 +778,7 @@
l10n_util::GetApplicationLocale(std::string()));
NSString* strings_path =
- base::mac::FilePathToNSString(localized.Append(locale + ".strings"));
+ base::apple::FilePathToNSString(localized.Append(locale + ".strings"));
[strings_dict writeToFile:strings_path atomically:YES];
content::GetUIThreadTaskRunner({})->PostTask(
@@ -822,10 +822,10 @@
std::string normalized_profile_path;
base::ReplaceChars(profile_path.BaseName().value(), " ", "-",
&normalized_profile_path);
- return base::mac::BaseBundleID() + std::string(".app.") +
+ return base::apple::BaseBundleID() + std::string(".app.") +
normalized_profile_path + "-" + app_id;
}
- return base::mac::BaseBundleID() + std::string(".app.") + app_id;
+ return base::apple::BaseBundleID() + std::string(".app.") + app_id;
}
// Return all bundles with the specified |bundle_id| which are for the current
@@ -838,7 +838,7 @@
base::apple::CFToNSOwnershipCast(LSCopyApplicationURLsForBundleIdentifier(
base::SysUTF8ToCFStringRef(bundle_id), /*outError=*/nullptr));
for (NSURL* url : bundle_urls) {
- base::FilePath bundle_path = base::mac::NSURLToFilePath(url);
+ base::FilePath bundle_path = base::apple::NSURLToFilePath(url);
BundleInfoPlist info(bundle_path);
if (!info.IsForCurrentUserDataDir())
continue;
@@ -1274,7 +1274,7 @@
// base::CreateDirectory() routine forces mode 0700.
NSError* error = nil;
if (![NSFileManager.defaultManager
- createDirectoryAtURL:base::mac::FilePathToNSURL(
+ createDirectoryAtURL:base::apple::FilePathToNSURL(
destination_executable_path)
withIntermediateDirectories:YES
attributes:@{
@@ -1427,7 +1427,7 @@
// LaunchServices will eventually detect the (updated) app, but explicitly
// calling LSRegisterURL ensures tests see the right state immediately.
- LSRegisterURL(base::mac::FilePathToCFURL(dst_app_path), true);
+ LSRegisterURL(base::apple::FilePathToCFURL(dst_app_path), true);
updated_paths->push_back(dst_app_path);
}
@@ -1516,7 +1516,7 @@
NSString* extension_title = base::SysUTF16ToNSString(info_->title);
NSString* extension_url = base::SysUTF8ToNSString(info_->url.spec());
NSString* chrome_bundle_id =
- base::SysUTF8ToNSString(base::mac::BaseBundleID());
+ base::SysUTF8ToNSString(base::apple::BaseBundleID());
NSDictionary* replacement_dict = @{
app_mode::kShortcutIdPlaceholder : app_id,
app_mode::kShortcutNamePlaceholder : extension_title,
@@ -1555,15 +1555,15 @@
base::SysUTF8ToNSString(GetBundleIdentifier(info_->app_id));
base::FilePath data_dir = GetMultiProfileAppDataDir(app_data_dir_);
plist[app_mode::kCrAppModeUserDataDirKey] =
- base::mac::FilePathToNSString(data_dir);
+ base::apple::FilePathToNSString(data_dir);
} else {
plist[base::apple::CFToNSPtrCast(kCFBundleIdentifierKey)] =
base::SysUTF8ToNSString(
GetBundleIdentifier(info_->app_id, info_->profile_path));
plist[app_mode::kCrAppModeUserDataDirKey] =
- base::mac::FilePathToNSString(app_data_dir_);
+ base::apple::FilePathToNSString(app_data_dir_);
plist[app_mode::kCrAppModeProfileDirKey] =
- base::mac::FilePathToNSString(info_->profile_path.BaseName());
+ base::apple::FilePathToNSString(info_->profile_path.BaseName());
plist[app_mode::kCrAppModeProfileNameKey] =
base::SysUTF8ToNSString(info_->profile_name);
}
@@ -1653,7 +1653,7 @@
// lines). See also crbug.com/1021804.
base::FilePath app_name = app_path.BaseName().RemoveFinalExtension();
plist[base::apple::CFToNSPtrCast(kCFBundleNameKey)] =
- base::mac::FilePathToNSString(app_name);
+ base::apple::FilePathToNSString(app_name);
return [plist writeToURL:plist_url error:nil];
}
@@ -1693,8 +1693,8 @@
app_mode::kCFBundleDisplayNameKey : display_name
};
- NSString* localized_path =
- base::mac::FilePathToNSString(localized_dir.Append("InfoPlist.strings"));
+ NSString* localized_path = base::apple::FilePathToNSString(
+ localized_dir.Append("InfoPlist.strings"));
return [strings_plist writeToFile:localized_path atomically:YES];
}
@@ -1808,7 +1808,7 @@
if (AppShimRevealDisabledForTest()) {
return;
}
- NSURL* path_url = base::mac::FilePathToNSURL(app_path);
+ NSURL* path_url = base::apple::FilePathToNSURL(app_path);
[[NSWorkspace sharedWorkspace]
activateFileViewerSelectingURLs:@[ path_url ]];
},
diff --git a/chrome/browser/web_applications/os_integration/web_app_shortcut_mac_unittest.mm b/chrome/browser/web_applications/os_integration/web_app_shortcut_mac_unittest.mm
index e5a1e454..50828388 100644
--- a/chrome/browser/web_applications/os_integration/web_app_shortcut_mac_unittest.mm
+++ b/chrome/browser/web_applications/os_integration/web_app_shortcut_mac_unittest.mm
@@ -12,10 +12,10 @@
#include <memory>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_path_override.h"
@@ -130,7 +130,7 @@
WebAppShortcutCreatorTest() = default;
void SetUp() override {
- base::mac::SetBaseBundleID(kFakeChromeBundleId);
+ base::apple::SetBaseBundleID(kFakeChromeBundleId);
override_registration_ =
OsIntegrationTestOverrideImpl::OverrideForTesting();
@@ -232,7 +232,7 @@
base::FilePath plist_path =
shim_path_.Append("Contents").Append("Info.plist");
NSDictionary* plist = [NSDictionary
- dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(plist_path)
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(plist_path)
error:nil];
EXPECT_NSEQ(base::SysUTF8ToNSString(info_->app_id),
plist[app_mode::kCrAppModeShortcutIDKey]);
@@ -249,8 +249,9 @@
// Make sure all values in the plist are actually filled in.
for (id key in plist) {
id value = [plist valueForKey:key];
- if (!base::mac::ObjCCast<NSString>(value))
+ if (!base::apple::ObjCCast<NSString>(value)) {
continue;
+ }
EXPECT_EQ(static_cast<NSUInteger>(NSNotFound),
[value rangeOfString:@"@APP_"].location)
@@ -271,7 +272,7 @@
ShortcutLocations()));
{
NSDictionary* plist = [NSDictionary
- dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(plist_path)
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(plist_path)
error:nil];
NSArray* doc_types_array = plist[app_mode::kCFBundleDocumentTypesKey];
EXPECT_EQ(doc_types_array, nil);
@@ -288,7 +289,7 @@
ShortcutLocations()));
{
NSDictionary* plist = [NSDictionary
- dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(plist_path)
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(plist_path)
error:nil];
NSArray* doc_types_array = plist[app_mode::kCFBundleDocumentTypesKey];
EXPECT_NE(doc_types_array, nil);
@@ -316,7 +317,7 @@
ShortcutLocations()));
{
NSDictionary* plist = [NSDictionary
- dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(plist_path)
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(plist_path)
error:nil];
NSArray* doc_types_array = plist[app_mode::kCFBundleDocumentTypesKey];
EXPECT_NE(doc_types_array, nil);
@@ -344,7 +345,7 @@
ShortcutLocations()));
{
NSDictionary* plist = [NSDictionary
- dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(plist_path)
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(plist_path)
error:nil];
NSArray* doc_types_array = plist[app_mode::kCFBundleDocumentTypesKey];
EXPECT_NE(doc_types_array, nil);
@@ -378,7 +379,7 @@
ShortcutLocations()));
{
NSDictionary* plist = [NSDictionary
- dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(plist_path)
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(plist_path)
error:nil];
NSArray* doc_types_array = plist[app_mode::kCFBundleDocumentTypesKey];
EXPECT_NE(doc_types_array, nil);
@@ -411,7 +412,7 @@
ShortcutLocations()));
{
NSDictionary* plist = [NSDictionary
- dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(plist_path)
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(plist_path)
error:nil];
NSArray* protocol_types_value = plist[app_mode::kCFBundleURLTypesKey];
EXPECT_EQ(protocol_types_value, nil);
@@ -425,7 +426,7 @@
ShortcutLocations()));
{
NSDictionary* plist = [NSDictionary
- dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(plist_path)
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(plist_path)
error:nil];
NSArray* protocol_types_value = plist[app_mode::kCFBundleURLTypesKey];
EXPECT_NE(protocol_types_value, nil);
@@ -435,7 +436,7 @@
// Verify CFBundleURLName is set.
EXPECT_NSEQ(protocol_types_dict[app_mode::kCFBundleURLNameKey],
- base::SysUTF8ToNSString(base::mac::BaseBundleID() +
+ base::SysUTF8ToNSString(base::apple::BaseBundleID() +
std::string(".app.") + info_->app_id));
// Verify CFBundleURLSchemes is set, and contains the expected values.
@@ -459,7 +460,7 @@
ShortcutLocations()));
{
NSDictionary* plist = [NSDictionary
- dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(plist_path)
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(plist_path)
error:nil];
NSArray* protocol_types_value = plist[app_mode::kCFBundleURLTypesKey];
EXPECT_NE(protocol_types_value, nil);
@@ -469,7 +470,7 @@
// Verify CFBundleURLName is set.
EXPECT_NSEQ(protocol_types_dict[app_mode::kCFBundleURLNameKey],
- base::SysUTF8ToNSString(base::mac::BaseBundleID() +
+ base::SysUTF8ToNSString(base::apple::BaseBundleID() +
std::string(".app.") + info_->app_id));
// Verify CFBundleURLSchemes is set, and contains the expected values.
@@ -616,7 +617,7 @@
.Append("Info.plist");
EXPECT_TRUE(base::PathExists(plist_path));
NSDictionary* plist = [NSDictionary
- dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(plist_path)
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(plist_path)
error:nil];
EXPECT_NSEQ(@"Shortcut Title",
plist[base::apple::CFToNSPtrCast(kCFBundleNameKey)]);
@@ -629,9 +630,9 @@
.Append(locale_dir_name)
.Append("InfoPlist.strings");
EXPECT_TRUE(base::PathExists(resource_file_path));
- NSDictionary* resources =
- [NSDictionary dictionaryWithContentsOfFile:base::mac::FilePathToNSString(
- resource_file_path)];
+ NSDictionary* resources = [NSDictionary
+ dictionaryWithContentsOfFile:base::apple::FilePathToNSString(
+ resource_file_path)];
EXPECT_NSEQ(@"Shortcut Title", resources[app_mode::kCFBundleDisplayNameKey]);
// UpdateShortcuts does this as well, but clear the app bundle contents to
@@ -656,7 +657,7 @@
.Append("Info.plist");
EXPECT_TRUE(base::PathExists(plist_path));
plist = [NSDictionary
- dictionaryWithContentsOfFile:base::mac::FilePathToNSString(plist_path)];
+ dictionaryWithContentsOfFile:base::apple::FilePathToNSString(plist_path)];
EXPECT_NSEQ(@"Shortcut Title",
plist[base::apple::CFToNSPtrCast(kCFBundleNameKey)]);
@@ -666,9 +667,9 @@
.Append(locale_dir_name)
.Append("InfoPlist.strings");
EXPECT_TRUE(base::PathExists(resource_file_path));
- resources =
- [NSDictionary dictionaryWithContentsOfFile:base::mac::FilePathToNSString(
- resource_file_path)];
+ resources = [NSDictionary
+ dictionaryWithContentsOfFile:base::apple::FilePathToNSString(
+ resource_file_path)];
EXPECT_NSEQ(@"Shortcut Title", resources[app_mode::kCFBundleDisplayNameKey]);
// Now simulate an update with a different title.
@@ -700,7 +701,7 @@
.Append("Info.plist");
EXPECT_TRUE(base::PathExists(plist_path));
plist = [NSDictionary
- dictionaryWithContentsOfFile:base::mac::FilePathToNSString(plist_path)];
+ dictionaryWithContentsOfFile:base::apple::FilePathToNSString(plist_path)];
EXPECT_NSEQ(@"Shortcut Title",
plist[base::apple::CFToNSPtrCast(kCFBundleNameKey)]);
@@ -711,9 +712,9 @@
.Append(locale_dir_name)
.Append("InfoPlist.strings");
EXPECT_TRUE(base::PathExists(resource_file_path));
- resources =
- [NSDictionary dictionaryWithContentsOfFile:base::mac::FilePathToNSString(
- resource_file_path)];
+ resources = [NSDictionary
+ dictionaryWithContentsOfFile:base::apple::FilePathToNSString(
+ resource_file_path)];
EXPECT_NSEQ(@"New App Title", resources[app_mode::kCFBundleDisplayNameKey]);
}
@@ -773,7 +774,7 @@
.Append("Info.plist");
EXPECT_TRUE(base::PathExists(plist_path));
NSDictionary* plist = [NSDictionary
- dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(plist_path)
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(plist_path)
error:nil];
EXPECT_NSEQ(@"App Title: New",
plist[base::apple::CFToNSPtrCast(kCFBundleNameKey)]);
@@ -786,9 +787,9 @@
.Append(locale_dir_name)
.Append("InfoPlist.strings");
EXPECT_TRUE(base::PathExists(resource_file_path));
- NSDictionary* resources =
- [NSDictionary dictionaryWithContentsOfFile:base::mac::FilePathToNSString(
- resource_file_path)];
+ NSDictionary* resources = [NSDictionary
+ dictionaryWithContentsOfFile:base::apple::FilePathToNSString(
+ resource_file_path)];
EXPECT_NSEQ(@"App Title New", resources[app_mode::kCFBundleDisplayNameKey]);
}
@@ -927,7 +928,7 @@
info_->favicon.Add(product_logo_32);
ASSERT_TRUE(shortcut_creator.UpdateIcon(shim_path_));
NSImage* image = [[NSImage alloc]
- initWithContentsOfFile:base::mac::FilePathToNSString(icon_path)];
+ initWithContentsOfFile:base::apple::FilePathToNSString(icon_path)];
EXPECT_TRUE(image);
EXPECT_EQ(product_logo_32.Width(), image.size.width);
EXPECT_EQ(product_logo_32.Height(), image.size.height);
@@ -936,7 +937,7 @@
info_->favicon_maskable.Add(product_logo_16);
ASSERT_TRUE(shortcut_creator.UpdateIcon(shim_path_));
image = [[NSImage alloc]
- initWithContentsOfFile:base::mac::FilePathToNSString(icon_path)];
+ initWithContentsOfFile:base::apple::FilePathToNSString(icon_path)];
EXPECT_TRUE(image);
EXPECT_EQ(product_logo_16.Width(), image.size.width);
EXPECT_EQ(product_logo_16.Height(), image.size.height);
diff --git a/chrome/browser/web_applications/os_integration/web_app_shortcut_manager_mac_unittest.cc b/chrome/browser/web_applications/os_integration/web_app_shortcut_manager_mac_unittest.cc
index 650dc6d..cda1e6f 100644
--- a/chrome/browser/web_applications/os_integration/web_app_shortcut_manager_mac_unittest.cc
+++ b/chrome/browser/web_applications/os_integration/web_app_shortcut_manager_mac_unittest.cc
@@ -4,8 +4,8 @@
#include "chrome/browser/web_applications/os_integration/web_app_shortcut_manager.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file_util.h"
-#include "base/mac/foundation_util.h"
#include "base/test/bind.h"
#include "chrome/browser/web_applications/os_integration/os_integration_manager.h"
#include "chrome/browser/web_applications/test/fake_os_integration_manager.h"
@@ -33,7 +33,7 @@
void SetUp() override {
WebAppTest::SetUp();
- base::mac::SetBaseBundleID(kFakeChromeBundleId);
+ base::apple::SetBaseBundleID(kFakeChromeBundleId);
// Put shortcuts somewhere under the home dir, as otherwise LaunchServices
// won't be able to find them.
override_registration_ =
diff --git a/chrome/browser/web_applications/test/os_integration_test_override_impl.cc b/chrome/browser/web_applications/test/os_integration_test_override_impl.cc
index 3872bee2..ae8cc50 100644
--- a/chrome/browser/web_applications/test/os_integration_test_override_impl.cc
+++ b/chrome/browser/web_applications/test/os_integration_test_override_impl.cc
@@ -45,9 +45,9 @@
#if BUILDFLAG(IS_MAC)
#include <ImageIO/ImageIO.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/mac/foundation_util.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/web_applications/app_shim_registry_mac.h"
#include "net/base/filename_util.h"
@@ -787,7 +787,7 @@
shortcut_path.AppendASCII("Contents/Resources/app.icns");
base::ScopedCFTypeRef<CFDictionaryRef> empty_dict(
CFDictionaryCreate(nullptr, nullptr, nullptr, 0, nullptr, nullptr));
- base::ScopedCFTypeRef<CFURLRef> url = base::mac::FilePathToCFURL(icon_path);
+ base::ScopedCFTypeRef<CFURLRef> url = base::apple::FilePathToCFURL(icon_path);
base::ScopedCFTypeRef<CGImageSourceRef> source(
CGImageSourceCreateWithURL(url, nullptr));
if (!source) {
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
index 6440a88..0bbca3d 100644
--- a/chrome/common/chrome_paths.cc
+++ b/chrome/common/chrome_paths.cc
@@ -27,7 +27,7 @@
#if BUILDFLAG(IS_MAC)
#include "base/apple/bundle_locations.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
#if BUILDFLAG(IS_WIN)
@@ -113,7 +113,7 @@
#if BUILDFLAG(IS_MAC)
// If called from Chrome, get internal plugins from a subdirectory of the
// framework.
- if (base::mac::AmIBundled()) {
+ if (base::apple::AmIBundled()) {
*result = chrome::GetFrameworkBundlePath();
DCHECK(!result->empty());
*result = result->Append("Internet Plug-Ins");
@@ -136,7 +136,7 @@
bool GetComponentDirectory(base::FilePath* result) {
#if BUILDFLAG(IS_MAC)
// If called from Chrome, return the framework's Libraries directory.
- if (base::mac::AmIBundled()) {
+ if (base::apple::AmIBundled()) {
*result = chrome::GetFrameworkBundlePath();
DCHECK(!result->empty());
*result = result->Append("Libraries");
@@ -165,7 +165,7 @@
// TODO(crbug.com/1262330): implement workable solution for Fuchsia.
#if BUILDFLAG(IS_MAC)
// Apps may not write into their own bundle.
- if (base::mac::AmIBundled()) {
+ if (base::apple::AmIBundled()) {
return base::PathService::Get(chrome::DIR_USER_DATA, result);
}
#endif // BUILDFLAG(IS_MAC)
@@ -357,7 +357,7 @@
if (!base::PathService::Get(base::DIR_EXE, &cur)) {
return false;
}
- if (base::mac::AmIBundled()) {
+ if (base::apple::AmIBundled()) {
// If we're called from chrome, it's beside the app (outside the
// app bundle), if we're called from a unittest, we'll already be
// outside the bundle so use the exe dir.
diff --git a/chrome/common/chrome_paths_mac.mm b/chrome/common/chrome_paths_mac.mm
index 112fe01d..8895d10 100644
--- a/chrome/common/chrome_paths_mac.mm
+++ b/chrome/common/chrome_paths_mac.mm
@@ -8,9 +8,9 @@
#include <memory>
#include <string>
+#import "base/apple/foundation_util.h"
#include "base/base_paths.h"
#include "base/check_op.h"
-#import "base/mac/foundation_util.h"
#include "base/memory/free_deleter.h"
#include "base/path_service.h"
#include "base/strings/sys_string_conversions.h"
@@ -25,12 +25,12 @@
// chrome::OuterAppBundle(), which should be the only caller.
NSBundle* OuterAppBundleInternal() {
@autoreleasepool {
- if (!base::mac::AmIBundled()) {
+ if (!base::apple::AmIBundled()) {
// If unbundled (as in a test), there's no app bundle.
return nil;
}
- if (!base::mac::IsBackgroundOnlyProcess()) {
+ if (!base::apple::IsBackgroundOnlyProcess()) {
// Shortcut: in the browser process, just return the main app bundle.
return NSBundle.mainBundle;
}
@@ -109,7 +109,7 @@
}
bool GetUserDocumentsDirectory(base::FilePath* result) {
- return base::mac::GetUserDirectory(NSDocumentDirectory, result);
+ return base::apple::GetUserDirectory(NSDocumentDirectory, result);
}
void GetUserCacheDirectory(const base::FilePath& profile_dir,
@@ -136,19 +136,19 @@
}
bool GetUserDownloadsDirectory(base::FilePath* result) {
- return base::mac::GetUserDirectory(NSDownloadsDirectory, result);
+ return base::apple::GetUserDirectory(NSDownloadsDirectory, result);
}
bool GetUserMusicDirectory(base::FilePath* result) {
- return base::mac::GetUserDirectory(NSMusicDirectory, result);
+ return base::apple::GetUserDirectory(NSMusicDirectory, result);
}
bool GetUserPicturesDirectory(base::FilePath* result) {
- return base::mac::GetUserDirectory(NSPicturesDirectory, result);
+ return base::apple::GetUserDirectory(NSPicturesDirectory, result);
}
bool GetUserVideosDirectory(base::FilePath* result) {
- return base::mac::GetUserDirectory(NSMoviesDirectory, result);
+ return base::apple::GetUserDirectory(NSMoviesDirectory, result);
}
base::FilePath GetFrameworkBundlePath() {
@@ -170,7 +170,7 @@
path = path.DirName().DirName();
DCHECK_EQ(path.BaseName().value(), "Contents");
- if (base::mac::IsBackgroundOnlyProcess()) {
+ if (base::apple::IsBackgroundOnlyProcess()) {
// |path| is Chromium.app/Contents/Frameworks/Chromium Framework.framework/
// Versions/X/Helpers/Chromium Helper.app/Contents. Go up three times to
// the versioned framework directory.
@@ -200,11 +200,11 @@
}
bool GetLocalLibraryDirectory(base::FilePath* result) {
- return base::mac::GetLocalDirectory(NSLibraryDirectory, result);
+ return base::apple::GetLocalDirectory(NSLibraryDirectory, result);
}
bool GetGlobalApplicationSupportDirectory(base::FilePath* result) {
- return base::mac::GetLocalDirectory(NSApplicationSupportDirectory, result);
+ return base::apple::GetLocalDirectory(NSApplicationSupportDirectory, result);
}
NSBundle* OuterAppBundle() {
diff --git a/chrome/common/extensions/image_writer/image_writer_util_mac.cc b/chrome/common/extensions/image_writer/image_writer_util_mac.cc
index 4e8bcc7..c40afa58 100644
--- a/chrome/common/extensions/image_writer/image_writer_util_mac.cc
+++ b/chrome/common/extensions/image_writer/image_writer_util_mac.cc
@@ -8,9 +8,9 @@
#include <IOKit/IOBSD.h>
#include <IOKit/storage/IOMedia.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/mach_logging.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/scoped_ioobject.h"
#include "base/strings/sys_string_conversions.h"
@@ -62,22 +62,23 @@
// Do not allow Core Storage volumes, even though they are marked as "whole
// media", as they are entirely contained on a different volume.
- CFBooleanRef cf_corestorage = base::mac::GetValueFromDictionary<CFBooleanRef>(
- dict, CFSTR("CoreStorage"));
+ CFBooleanRef cf_corestorage =
+ base::apple::GetValueFromDictionary<CFBooleanRef>(dict,
+ CFSTR("CoreStorage"));
if (cf_corestorage && CFBooleanGetValue(cf_corestorage))
return false;
// Do not allow APFS containers, even though they are marked as "whole
// media", as they are entirely contained on a different volume.
CFStringRef cf_content =
- base::mac::GetValueFromDictionary<CFStringRef>(dict, CFSTR("Content"));
+ base::apple::GetValueFromDictionary<CFStringRef>(dict, CFSTR("Content"));
if (cf_content &&
CFStringCompare(cf_content, CFSTR("EF57347C-0000-11AA-AA11-00306543ECAC"),
0) == kCFCompareEqualTo) {
return false;
}
- CFBooleanRef cf_removable = base::mac::GetValueFromDictionary<CFBooleanRef>(
+ CFBooleanRef cf_removable = base::apple::GetValueFromDictionary<CFBooleanRef>(
dict, CFSTR(kIOMediaRemovableKey));
bool removable = CFBooleanGetValue(cf_removable);
bool is_usb = IsUsbDevice(disk_obj);
@@ -86,8 +87,9 @@
return false;
if (out_size_in_bytes) {
- CFNumberRef cf_media_size = base::mac::GetValueFromDictionary<CFNumberRef>(
- dict, CFSTR(kIOMediaSizeKey));
+ CFNumberRef cf_media_size =
+ base::apple::GetValueFromDictionary<CFNumberRef>(
+ dict, CFSTR(kIOMediaSizeKey));
if (cf_media_size)
CFNumberGetValue(cf_media_size, kCFNumberLongLongType, out_size_in_bytes);
else
@@ -95,7 +97,7 @@
}
if (out_bsd_name) {
- CFStringRef cf_bsd_name = base::mac::GetValueFromDictionary<CFStringRef>(
+ CFStringRef cf_bsd_name = base::apple::GetValueFromDictionary<CFStringRef>(
dict, CFSTR(kIOBSDNameKey));
if (out_bsd_name)
*out_bsd_name = base::SysCFStringRefToUTF8(cf_bsd_name);
diff --git a/chrome/common/mac/app_mode_chrome_locator.mm b/chrome/common/mac/app_mode_chrome_locator.mm
index c3ca155e..c8ac9538 100644
--- a/chrome/common/mac/app_mode_chrome_locator.mm
+++ b/chrome/common/mac/app_mode_chrome_locator.mm
@@ -10,9 +10,9 @@
#include <set>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/mac/app_mode_common.h"
@@ -81,10 +81,10 @@
base::FilePath last_run_bundle_path;
{
NSString* cr_bundle_path_ns = base::apple::CFToNSOwnershipCast(
- base::mac::CFCastStrict<CFStringRef>(CFPreferencesCopyAppValue(
+ base::apple::CFCastStrict<CFStringRef>(CFPreferencesCopyAppValue(
base::apple::NSToCFPtrCast(app_mode::kLastRunAppBundlePathPrefsKey),
base::apple::NSToCFPtrCast(bundle_id))));
- last_run_bundle_path = base::mac::NSStringToFilePath(cr_bundle_path_ns);
+ last_run_bundle_path = base::apple::NSStringToFilePath(cr_bundle_path_ns);
}
// Look up running instances of the specified bundle ID.
@@ -97,7 +97,7 @@
runningApplicationsWithBundleIdentifier:bundle_id];
for (NSRunningApplication* running_application : running_applications) {
base::FilePath bundle_path =
- base::mac::NSURLToFilePath(running_application.bundleURL);
+ base::apple::NSURLToFilePath(running_application.bundleURL);
DCHECK(!bundle_path.empty());
running_bundle_paths.insert(bundle_path);
}
@@ -131,7 +131,7 @@
NSURL* url = [NSWorkspace.sharedWorkspace
URLForApplicationWithBundleIdentifier:bundle_id];
if (url) {
- *out_bundle = base::mac::NSURLToFilePath(url);
+ *out_bundle = base::apple::NSURLToFilePath(url);
return true;
}
}
@@ -143,7 +143,7 @@
base::FilePath* executable_path,
base::FilePath* framework_path,
base::FilePath* framework_dylib_path) {
- NSString* cr_bundle_path = base::mac::FilePathToNSString(chrome_bundle);
+ NSString* cr_bundle_path = base::apple::FilePathToNSString(chrome_bundle);
NSBundle* cr_bundle = [NSBundle bundleWithPath:cr_bundle_path];
if (!cr_bundle)
return false;
@@ -179,7 +179,7 @@
// rather broken new-style bundle). Try explicitly specifying the version of
// the framework matching the outer bundle version.
if (!framework_path_and_structure) {
- NSString* cr_version = base::mac::ObjCCast<NSString>([cr_bundle
+ NSString* cr_version = base::apple::ObjCCast<NSString>([cr_bundle
objectForInfoDictionaryKey:app_mode::kCFBundleShortVersionStringKey]);
if (cr_version) {
framework_path_and_structure =
@@ -217,9 +217,9 @@
}
// Everything is OK; copy the output parameters.
- *executable_path = base::mac::NSStringToFilePath(cr_bundle.executablePath);
- *framework_path = base::mac::NSStringToFilePath(cr_framework_path);
- *framework_dylib_path = base::mac::NSStringToFilePath(
+ *executable_path = base::apple::NSStringToFilePath(cr_bundle.executablePath);
+ *framework_path = base::apple::NSStringToFilePath(cr_framework_path);
+ *framework_dylib_path = base::apple::NSStringToFilePath(
framework_path_and_structure->framework_dylib_path);
return true;
}
diff --git a/chrome/common/printing/printer_capabilities_mac.mm b/chrome/common/printing/printer_capabilities_mac.mm
index 767dd4d5..1a5d18c 100644
--- a/chrome/common/printing/printer_capabilities_mac.mm
+++ b/chrome/common/printing/printer_capabilities_mac.mm
@@ -6,10 +6,10 @@
#import <AppKit/AppKit.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/check_op.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/no_destructor.h"
#include "base/strings/sys_string_conversions.h"
#include "base/threading/scoped_blocking_call.h"
@@ -42,7 +42,7 @@
base::FilePath local_library;
bool success =
- base::mac::GetUserDirectory(NSLibraryDirectory, &local_library);
+ base::apple::GetUserDirectory(NSLibraryDirectory, &local_library);
DCHECK(success);
base::FilePath plist = local_library.Append("Preferences")
@@ -69,7 +69,7 @@
base::ScopedBlockingCall scoped_block(FROM_HERE,
base::BlockingType::MAY_BLOCK);
custom_papers_dict = [[NSDictionary alloc]
- initWithContentsOfURL:base::mac::FilePathToNSURL(path)
+ initWithContentsOfURL:base::apple::FilePathToNSURL(path)
error:nil];
if (!custom_papers_dict) {
return custom_paper_sizes;
@@ -77,7 +77,7 @@
}
for (id key in custom_papers_dict) {
- NSDictionary* paper = base::mac::ObjCCast<NSDictionary>(
+ NSDictionary* paper = base::apple::ObjCCast<NSDictionary>(
[custom_papers_dict objectForKey:key]);
if (!paper) {
continue;
diff --git a/chrome/common/printing/printer_capabilities_mac_unittest.mm b/chrome/common/printing/printer_capabilities_mac_unittest.mm
index db8371f..3ee9517 100644
--- a/chrome/common/printing/printer_capabilities_mac_unittest.mm
+++ b/chrome/common/printing/printer_capabilities_mac_unittest.mm
@@ -4,8 +4,8 @@
#include "chrome/common/printing/printer_capabilities_mac.h"
+#include "base/apple/foundation_util.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/mac/foundation_util.h"
#include "base/path_service.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/rect.h"
@@ -18,7 +18,7 @@
const char* name,
NSDictionary* dict) {
base::FilePath path = dir.Append(name);
- if (![dict writeToURL:base::mac::FilePathToNSURL(path) error:nil]) {
+ if (![dict writeToURL:base::apple::FilePathToNSURL(path) error:nil]) {
path.clear();
}
return path;
diff --git a/chrome/test/base/launchservices_utils_mac.mm b/chrome/test/base/launchservices_utils_mac.mm
index d2fb8dc..9fe454bb 100644
--- a/chrome/test/base/launchservices_utils_mac.mm
+++ b/chrome/test/base/launchservices_utils_mac.mm
@@ -7,16 +7,16 @@
#include <Foundation/Foundation.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/base_paths.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/path_service.h"
#include "build/branding_buildflags.h"
namespace test {
bool RegisterAppWithLaunchServices() {
- NSURL* bundleURL = base::mac::FilePathToNSURL(GuessAppBundlePath());
+ NSURL* bundleURL = base::apple::FilePathToNSURL(GuessAppBundlePath());
if (![bundleURL checkResourceIsReachableAndReturnError:nil]) {
return false;
@@ -38,7 +38,7 @@
// .app directory:
NSURL* bundleURL = NSBundle.mainBundle.bundleURL;
if ([bundleURL.lastPathComponent hasSuffix:@".app"]) {
- return base::mac::NSURLToFilePath(bundleURL);
+ return base::apple::NSURLToFilePath(bundleURL);
}
base::FilePath exe_path;
diff --git a/chrome/test/base/scoped_bundle_swizzler_mac.mm b/chrome/test/base/scoped_bundle_swizzler_mac.mm
index aca0e14..246c2ca 100644
--- a/chrome/test/base/scoped_bundle_swizzler_mac.mm
+++ b/chrome/test/base/scoped_bundle_swizzler_mac.mm
@@ -8,9 +8,9 @@
#include <memory>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_objc_class_swizzler.h"
#include "base/check.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
static id __strong g_swizzled_main_bundle = nil;
@@ -33,7 +33,7 @@
- (instancetype)initWithRealBundle:(NSBundle*)bundle {
_mainBundle = bundle;
- _bundleID = base::SysUTF8ToNSString(base::mac::BaseBundleID());
+ _bundleID = base::SysUTF8ToNSString(base::apple::BaseBundleID());
return self;
}
diff --git a/chrome/test/chromedriver/chrome/chrome_finder_mac.mm b/chrome/test/chromedriver/chrome/chrome_finder_mac.mm
index 132e60f5..31f054c 100644
--- a/chrome/test/chromedriver/chrome/chrome_finder_mac.mm
+++ b/chrome/test/chromedriver/chrome/chrome_finder_mac.mm
@@ -4,14 +4,16 @@
#import <Foundation/Foundation.h>
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
void GetApplicationDirs(std::vector<base::FilePath>* app_dirs) {
base::FilePath user_app_dir;
- if (base::mac::GetUserDirectory(NSApplicationDirectory, &user_app_dir))
+ if (base::apple::GetUserDirectory(NSApplicationDirectory, &user_app_dir)) {
app_dirs->push_back(user_app_dir);
+ }
base::FilePath local_app_dir;
- if (base::mac::GetLocalDirectory(NSApplicationDirectory, &local_app_dir))
+ if (base::apple::GetLocalDirectory(NSApplicationDirectory, &local_app_dir)) {
app_dirs->push_back(local_app_dir);
+ }
}
diff --git a/chrome/updater/device_management/dm_storage_mac.mm b/chrome/updater/device_management/dm_storage_mac.mm
index 67ff7dca..ecfaa54 100644
--- a/chrome/updater/device_management/dm_storage_mac.mm
+++ b/chrome/updater/device_management/dm_storage_mac.mm
@@ -8,12 +8,12 @@
#include <string>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/important_file_writer.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_ioobject.h"
#include "base/memory/scoped_refptr.h"
@@ -37,7 +37,7 @@
return false;
}
- CFStringRef value_string = base::mac::CFCast<CFStringRef>(token_value);
+ CFStringRef value_string = base::apple::CFCast<CFStringRef>(token_value);
if (!value_string)
return false;
@@ -56,7 +56,7 @@
// /Library/Google/Chrome/CloudManagementEnrollmentToken.
base::FilePath GetEnrollmentTokenFilePath() {
base::FilePath lib_path;
- if (!base::mac::GetLocalDirectory(NSLibraryDirectory, &lib_path)) {
+ if (!base::apple::GetLocalDirectory(NSLibraryDirectory, &lib_path)) {
VLOG(1) << "Failed to get local library path.";
return base::FilePath();
}
@@ -70,7 +70,8 @@
// /Library/Application Support/Google/CloudManagement.
base::FilePath GetDmTokenFilePath() {
base::FilePath app_path;
- if (!base::mac::GetLocalDirectory(NSApplicationSupportDirectory, &app_path)) {
+ if (!base::apple::GetLocalDirectory(NSApplicationSupportDirectory,
+ &app_path)) {
VLOG(1) << "Failed to get Application support path.";
return base::FilePath();
}
diff --git a/chrome/updater/external_constants_override.cc b/chrome/updater/external_constants_override.cc
index 930fee30..4556c39 100644
--- a/chrome/updater/external_constants_override.cc
+++ b/chrome/updater/external_constants_override.cc
@@ -31,7 +31,7 @@
#include "url/gurl.h"
#if BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#elif BUILDFLAG(IS_WIN)
#include "base/path_service.h"
#endif
diff --git a/chrome/updater/mac/keystone/ksadmin.mm b/chrome/updater/mac/keystone/ksadmin.mm
index d09d4acb..6df7243 100644
--- a/chrome/updater/mac/keystone/ksadmin.mm
+++ b/chrome/updater/mac/keystone/ksadmin.mm
@@ -11,6 +11,7 @@
#include <utility>
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/containers/contains.h"
@@ -20,7 +21,6 @@
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/message_loop/message_pump_type.h"
#include "base/no_destructor.h"
@@ -198,7 +198,7 @@
if (path &&
[NSFileManager.defaultManager
- fileExistsAtPath:base::mac::FilePathToNSString(path.value())]) {
+ fileExistsAtPath:base::apple::FilePathToNSString(path.value())]) {
// Updater is already installed.
return;
}
@@ -210,9 +210,9 @@
const absl::optional<base::FilePath> setup_path = GetUpdaterExecutablePath(
IsSystemShim() ? UpdaterScope::kSystem : UpdaterScope::kUser);
- if (!setup_path ||
- ![NSFileManager.defaultManager
- fileExistsAtPath:base::mac::FilePathToNSString(setup_path.value())]) {
+ if (!setup_path || ![NSFileManager.defaultManager
+ fileExistsAtPath:base::apple::FilePathToNSString(
+ setup_path.value())]) {
return;
}
diff --git a/chrome/updater/mac/privileged_helper/service.mm b/chrome/updater/mac/privileged_helper/service.mm
index 8234875..c19528c 100644
--- a/chrome/updater/mac/privileged_helper/service.mm
+++ b/chrome/updater/mac/privileged_helper/service.mm
@@ -12,6 +12,7 @@
#include <string>
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/command_line.h"
#include "base/files/file_enumerator.h"
@@ -21,7 +22,6 @@
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
@@ -193,7 +193,7 @@
base::ScopedCFTypeRef<SecStaticCodeRef> code;
base::ScopedCFTypeRef<CFErrorRef> errors;
if (SecStaticCodeCreateWithPath(
- base::mac::FilePathToCFURL(updater_app_bundle), kSecCSDefaultFlags,
+ base::apple::FilePathToCFURL(updater_app_bundle), kSecCSDefaultFlags,
code.InitializeInto()) != errSecSuccess) {
return false;
}
diff --git a/chrome/updater/mac/setup/keystone.mm b/chrome/updater/mac/setup/keystone.mm
index e331ab7..afd78e9 100644
--- a/chrome/updater/mac/setup/keystone.mm
+++ b/chrome/updater/mac/setup/keystone.mm
@@ -8,13 +8,13 @@
#include <vector>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/callback.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/process/launch.h"
#include "base/process/process.h"
#include "base/strings/string_split.h"
@@ -47,7 +47,7 @@
+ (instancetype)storeAtPath:(const base::FilePath&)path {
return [[CountingMetricsStore alloc]
- initWithURL:[base::mac::FilePathToNSURL(path)
+ initWithURL:[base::apple::FilePathToNSURL(path)
URLByAppendingPathComponent:@"CountingMetrics.plist"]];
}
@@ -314,7 +314,7 @@
}
if (ticket.existenceChecker) {
registration.existence_checker_path =
- base::mac::NSStringToFilePath(ticket.existenceChecker.path);
+ base::apple::NSStringToFilePath(ticket.existenceChecker.path);
}
registration.brand_code =
base::SysNSStringToUTF8([ticket determineBrand]);
@@ -322,7 +322,7 @@
// New updater only supports hard-coded brandKey, only migrate brand
// path if the key matches.
registration.brand_path =
- base::mac::NSStringToFilePath(ticket.brandPath);
+ base::apple::NSStringToFilePath(ticket.brandPath);
}
registration.ap = base::SysNSStringToUTF8([ticket determineTag]);
diff --git a/chrome/updater/mac/setup/ks_tickets.mm b/chrome/updater/mac/setup/ks_tickets.mm
index 8b9a162..86c6991 100644
--- a/chrome/updater/mac/setup/ks_tickets.mm
+++ b/chrome/updater/mac/setup/ks_tickets.mm
@@ -6,9 +6,9 @@
#import <Foundation/Foundation.h>
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
@@ -94,7 +94,7 @@
- (instancetype)initWithFilePath:(const base::FilePath&)filePath {
if ((self = [super init])) {
- path_ = base::mac::FilePathToNSString(filePath);
+ path_ = base::apple::FilePathToNSString(filePath);
}
return self;
}
@@ -279,15 +279,16 @@
if (!ecp.empty()) {
existenceChecker_ = [[KSPathExistenceChecker alloc] initWithFilePath:ecp];
- tagPath_ = [NSString stringWithFormat:@"%@/Contents/Info.plist",
- base::mac::FilePathToNSString(ecp)];
+ tagPath_ =
+ [NSString stringWithFormat:@"%@/Contents/Info.plist",
+ base::apple::FilePathToNSString(ecp)];
tagKey_ = kCRUTicketTagKey;
}
tag_ = tag;
brandCode_ = brandCode;
if (!brandPath.empty()) {
- brandPath_ = base::mac::FilePathToNSString(brandPath);
+ brandPath_ = base::apple::FilePathToNSString(brandPath);
brandKey_ = kCRUTicketBrandKey;
}
serverURL_ =
diff --git a/chrome/updater/mac/setup/setup.mm b/chrome/updater/mac/setup/setup.mm
index a939a39..40ff3b5 100644
--- a/chrome/updater/mac/setup/setup.mm
+++ b/chrome/updater/mac/setup/setup.mm
@@ -10,6 +10,7 @@
#include <unistd.h>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/debug/dump_without_crashing.h"
@@ -17,7 +18,6 @@
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/path_service.h"
#include "base/process/launch.h"
#include "base/process/process.h"
@@ -129,7 +129,7 @@
return false;
}
@autoreleasepool {
- NSURL* const url = base::mac::FilePathToNSURL(*path);
+ NSURL* const url = base::apple::FilePathToNSURL(*path);
// If the file is unchanged, avoid a spammy notification by not touching it.
if (previousPlistExists &&
@@ -172,7 +172,7 @@
GetInstallDirectory(scope);
if (install_path) {
OSStatus ls_result = LSRegisterURL(
- base::mac::FilePathToCFURL(
+ base::apple::FilePathToCFURL(
install_path->Append("Current").Append(base::StrCat(
{PRODUCT_FULLNAME_STRING, kExecutableSuffix, ".app"}))),
true);
diff --git a/chrome/updater/mac/setup/setup_unittest.mm b/chrome/updater/mac/setup/setup_unittest.mm
index 7293b86..c7bf019 100644
--- a/chrome/updater/mac/setup/setup_unittest.mm
+++ b/chrome/updater/mac/setup/setup_unittest.mm
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/mac/foundation_util.h"
#include "base/no_destructor.h"
#include "base/path_service.h"
#include "base/process/launch.h"
@@ -77,7 +77,7 @@
};
ASSERT_TRUE([launchd_plist
- writeToURL:base::mac::FilePathToNSURL(test_app_info_plist_path)
+ writeToURL:base::apple::FilePathToNSURL(test_app_info_plist_path)
atomically:YES]);
}
diff --git a/chrome/updater/mac/setup/wake_task.mm b/chrome/updater/mac/setup/wake_task.mm
index 28bf50e..051caee 100644
--- a/chrome/updater/mac/setup/wake_task.mm
+++ b/chrome/updater/mac/setup/wake_task.mm
@@ -6,8 +6,8 @@
#include <Foundation/Foundation.h>
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/strcat.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/updater/constants.h"
diff --git a/chrome/updater/net/network_fetcher_mac.mm b/chrome/updater/net/network_fetcher_mac.mm
index 7dfdc2f..92553ab 100644
--- a/chrome/updater/net/network_fetcher_mac.mm
+++ b/chrome/updater/net/network_fetcher_mac.mm
@@ -11,13 +11,13 @@
#include <string>
#include <utility>
+#import "base/apple/foundation_util.h"
#include "base/containers/flat_map.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
-#import "base/mac/foundation_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/sequence_checker.h"
#include "base/strings/string_util.h"
@@ -231,7 +231,7 @@
return;
const base::FilePath tempPath =
- base::mac::NSStringToFilePath([location path]);
+ base::apple::NSStringToFilePath([location path]);
_moveTempFileSuccessful = base::Move(tempPath, _filePath);
if (!_moveTempFileSuccessful) {
DPLOG(ERROR)
diff --git a/chrome/updater/policy/mac/managed_preference_policy_manager_impl.mm b/chrome/updater/policy/mac/managed_preference_policy_manager_impl.mm
index e9b0ad41..113b05d0 100644
--- a/chrome/updater/policy/mac/managed_preference_policy_manager_impl.mm
+++ b/chrome/updater/policy/mac/managed_preference_policy_manager_impl.mm
@@ -6,8 +6,8 @@
#include <Foundation/Foundation.h>
+#include "base/apple/foundation_util.h"
#include "base/enterprise_util.h"
-#include "base/mac/foundation_util.h"
#include "chrome/updater/constants.h"
#include "chrome/updater/policy/manager.h"
@@ -108,7 +108,7 @@
- (instancetype)initWithDictionary:(CRUAppPolicyDictionary*)policyDict {
if (([super init])) {
_downloadPreference =
- base::mac::ObjCCast<NSString>(policyDict[kDownloadPreferenceKey]);
+ base::apple::ObjCCast<NSString>(policyDict[kDownloadPreferenceKey]);
_defaultUpdatePolicy = updater::TranslateUpdatePolicyValue(
updater::ReadPolicyInteger(policyDict[kUpdateDefaultKey]));
_updatesSuppressed.start_hour_ =
@@ -171,9 +171,9 @@
_updatePolicy = updater::TranslateUpdatePolicyValue(
updater::ReadPolicyInteger(policyDict[kUpdateDefaultKey]));
_targetChannel =
- base::mac::ObjCCast<NSString>(policyDict[kTargetChannelKey]);
+ base::apple::ObjCCast<NSString>(policyDict[kTargetChannelKey]);
_targetVersionPrefix =
- base::mac::ObjCCast<NSString>(policyDict[kTargetVersionPrefixKey]);
+ base::apple::ObjCCast<NSString>(policyDict[kTargetVersionPrefixKey]);
_rollbackToTargetVersion =
updater::ReadPolicyInteger(policyDict[kRollbackToTargetVersionKey]);
}
diff --git a/chrome/updater/test/integration_tests_mac.mm b/chrome/updater/test/integration_tests_mac.mm
index 63acf76..d0c7283 100644
--- a/chrome/updater/test/integration_tests_mac.mm
+++ b/chrome/updater/test/integration_tests_mac.mm
@@ -6,13 +6,13 @@
#include <string>
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/notreached.h"
#include "base/path_service.h"
#include "base/process/launch.h"
diff --git a/chrome/updater/tools/keystone_ticketstore_tool.mm b/chrome/updater/tools/keystone_ticketstore_tool.mm
index c269b50f..d6bf5b6 100644
--- a/chrome/updater/tools/keystone_ticketstore_tool.mm
+++ b/chrome/updater/tools/keystone_ticketstore_tool.mm
@@ -6,9 +6,9 @@
#include <iostream>
+#include "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#import "chrome/updater/mac/setup/ks_tickets.h"
@@ -36,7 +36,7 @@
version_ = version;
if (ecp.length) {
existenceChecker_ = [[KSPathExistenceChecker alloc]
- initWithFilePath:base::mac::NSStringToFilePath(ecp)];
+ initWithFilePath:base::apple::NSStringToFilePath(ecp)];
}
tag_ = tag;
if (tagPath.length) {
@@ -89,7 +89,7 @@
int ReadTicketStore(const base::FilePath& path) {
@autoreleasepool {
NSDictionary<NSString*, KSTicket*>* store =
- [KSTicketStore readStoreWithPath:base::mac::FilePathToNSString(path)];
+ [KSTicketStore readStoreWithPath:base::apple::FilePathToNSString(path)];
for (NSString* key in store) {
std::cout << "------ Key " << base::SysNSStringToUTF8(key) << std::endl
<< base::SysNSStringToUTF8(
@@ -106,7 +106,7 @@
NSError* error = nil;
NSDictionary<NSString*, NSDictionary<NSString*, id>*>* tickets_data =
[NSDictionary
- dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(input)
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(input)
error:&error];
if (error) {
std::cerr << "Error read store: "
@@ -157,7 +157,7 @@
return 1;
}
- if (![storeData writeToFile:base::mac::FilePathToNSString(output)
+ if (![storeData writeToFile:base::apple::FilePathToNSString(output)
options:NSDataWritingAtomic
error:&error]) {
std::cerr << "Failed to write output: "
diff --git a/chrome/updater/update_usage_stats_task_mac.mm b/chrome/updater/update_usage_stats_task_mac.mm
index 4520f50..c7d48fd 100644
--- a/chrome/updater/update_usage_stats_task_mac.mm
+++ b/chrome/updater/update_usage_stats_task_mac.mm
@@ -8,10 +8,10 @@
#include <string>
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
-#include "base/mac/foundation_util.h"
#include "chrome/updater/updater_branding.h"
#include "chrome/updater/updater_scope.h"
#include "chrome/updater/util/mac_util.h"
@@ -63,7 +63,7 @@
// In the system case, iterate all users. If any user has opted-in to usage
// stats, the system updater may transmit usage stats.
base::FilePath user_dir;
- if (!base::mac::GetLocalDirectory(NSUserDirectory, &user_dir)) {
+ if (!base::apple::GetLocalDirectory(NSUserDirectory, &user_dir)) {
return false;
}
base::FileEnumerator files(user_dir, false,
diff --git a/chrome/updater/util/mac_util.mm b/chrome/updater/util/mac_util.mm
index 214e90d..81b3833 100644
--- a/chrome/updater/util/mac_util.mm
+++ b/chrome/updater/util/mac_util.mm
@@ -6,13 +6,13 @@
#import <CoreFoundation/CoreFoundation.h>
+#include "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/files/file.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/process/launch.h"
#include "base/strings/strcat.h"
@@ -55,11 +55,11 @@
absl::optional<base::FilePath> GetLibraryFolderPath(UpdaterScope scope) {
switch (scope) {
case UpdaterScope::kUser:
- return base::mac::GetUserLibraryPath();
+ return base::apple::GetUserLibraryPath();
case UpdaterScope::kSystem: {
base::FilePath local_library_path;
- if (!base::mac::GetLocalDirectory(NSLibraryDirectory,
- &local_library_path)) {
+ if (!base::apple::GetLocalDirectory(NSLibraryDirectory,
+ &local_library_path)) {
VLOG(1) << "Could not get local library path";
return absl::nullopt;
}
@@ -73,12 +73,15 @@
base::FilePath path;
switch (scope) {
case UpdaterScope::kUser:
- if (base::mac::GetUserDirectory(NSApplicationSupportDirectory, &path))
+ if (base::apple::GetUserDirectory(NSApplicationSupportDirectory, &path)) {
return path;
+ }
break;
case UpdaterScope::kSystem:
- if (base::mac::GetLocalDirectory(NSApplicationSupportDirectory, &path))
+ if (base::apple::GetLocalDirectory(NSApplicationSupportDirectory,
+ &path)) {
return path;
+ }
break;
}
@@ -258,7 +261,7 @@
if ([library_paths count] < 1) {
return absl::nullopt;
}
- return base::mac::NSStringToFilePath(library_paths[0])
+ return base::apple::NSStringToFilePath(library_paths[0])
.Append(IsSystemInstall(scope) ? "LaunchDaemons" : "LaunchAgents")
.AppendASCII(base::StrCat({GetWakeLaunchdName(scope), ".plist"}));
}
diff --git a/chrome/utility/image_writer/disk_unmounter_mac.h b/chrome/utility/image_writer/disk_unmounter_mac.h
index a28c1ed..0303d71 100644
--- a/chrome/utility/image_writer/disk_unmounter_mac.h
+++ b/chrome/utility/image_writer/disk_unmounter_mac.h
@@ -10,9 +10,9 @@
#include <memory>
+#include "base/apple/foundation_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
-#include "base/mac/foundation_util.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread.h"
diff --git a/chrome/utility/importer/importer_creator.cc b/chrome/utility/importer/importer_creator.cc
index e7c3bf8d..ae5e64ce 100644
--- a/chrome/utility/importer/importer_creator.cc
+++ b/chrome/utility/importer/importer_creator.cc
@@ -16,7 +16,7 @@
#endif
#if BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "chrome/utility/importer/safari_importer.h"
#endif
@@ -41,7 +41,7 @@
#endif
#if BUILDFLAG(IS_MAC)
case TYPE_SAFARI:
- return new SafariImporter(base::mac::GetUserLibraryPath());
+ return new SafariImporter(base::apple::GetUserLibraryPath());
#endif
default:
NOTREACHED();
diff --git a/chrome/utility/importer/safari_importer.mm b/chrome/utility/importer/safari_importer.mm
index 3b41ac4..cce118ce 100644
--- a/chrome/utility/importer/safari_importer.mm
+++ b/chrome/utility/importer/safari_importer.mm
@@ -9,8 +9,8 @@
#include <string>
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/files/file_util.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
@@ -177,7 +177,7 @@
DCHECK(bookmarks);
// Construct ~/Library/Safari/Bookmarks.plist path
- NSURL* library_dir = base::mac::FilePathToNSURL(library_dir_);
+ NSURL* library_dir = base::apple::FilePathToNSURL(library_dir_);
NSURL* safari_dir = [library_dir URLByAppendingPathComponent:@"Safari"];
NSURL* bookmarks_plist =
[safari_dir URLByAppendingPathComponent:@"Bookmarks.plist"];
diff --git a/chrome/utility/safe_browsing/mac/udif.cc b/chrome/utility/safe_browsing/mac/udif.cc
index 7bf5bb4..431d9f9b 100644
--- a/chrome/utility/safe_browsing/mac/udif.cc
+++ b/chrome/utility/safe_browsing/mac/udif.cc
@@ -13,9 +13,9 @@
#include <memory>
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/notreached.h"
#include "base/numerics/ostream_operators.h"
@@ -470,7 +470,8 @@
CFPropertyListCreateWithData(kCFAllocatorDefault, plist_data,
kCFPropertyListImmutable, nullptr, &error));
- CFDictionaryRef plist_dict = base::mac::CFCast<CFDictionaryRef>(plist.get());
+ CFDictionaryRef plist_dict =
+ base::apple::CFCast<CFDictionaryRef>(plist.get());
base::ScopedCFTypeRef<CFErrorRef> error_ref(error);
if (error) {
base::ScopedCFTypeRef<CFStringRef> error_string(
@@ -485,15 +486,15 @@
return false;
}
- auto* resource_fork = base::mac::GetValueFromDictionary<CFDictionaryRef>(
+ auto* resource_fork = base::apple::GetValueFromDictionary<CFDictionaryRef>(
plist_dict, CFSTR("resource-fork"));
if (!resource_fork) {
DLOG(ERROR) << "No resource-fork entry in plist";
return false;
}
- auto* blkx = base::mac::GetValueFromDictionary<CFArrayRef>(resource_fork,
- CFSTR("blkx"));
+ auto* blkx = base::apple::GetValueFromDictionary<CFArrayRef>(resource_fork,
+ CFSTR("blkx"));
if (!blkx) {
DLOG(ERROR) << "No blkx entry in resource-fork";
return false;
@@ -501,15 +502,15 @@
for (CFIndex i = 0; i < CFArrayGetCount(blkx); ++i) {
auto* block_dictionary =
- base::mac::CFCast<CFDictionaryRef>(CFArrayGetValueAtIndex(blkx, i));
+ base::apple::CFCast<CFDictionaryRef>(CFArrayGetValueAtIndex(blkx, i));
if (!block_dictionary) {
DLOG(ERROR) << "Skipping block " << i
<< " because it is not a CFDictionary";
continue;
}
- auto* data = base::mac::GetValueFromDictionary<CFDataRef>(block_dictionary,
- CFSTR("Data"));
+ auto* data = base::apple::GetValueFromDictionary<CFDataRef>(
+ block_dictionary, CFSTR("Data"));
if (!data) {
DLOG(ERROR) << "Skipping block " << i
<< " because it has no Data section";
@@ -537,7 +538,7 @@
continue;
}
- CFStringRef partition_name_cf = base::mac::CFCast<CFStringRef>(
+ CFStringRef partition_name_cf = base::apple::CFCast<CFStringRef>(
CFDictionaryGetValue(block_dictionary, CFSTR("Name")));
if (!partition_name_cf) {
DLOG(ERROR) << "Skipping block " << i << " because it has no name";
diff --git a/components/autofill/core/browser/autofill_merge_unittest.cc b/components/autofill/core/browser/autofill_merge_unittest.cc
index 5ad4924..5c775a6 100644
--- a/components/autofill/core/browser/autofill_merge_unittest.cc
+++ b/components/autofill/core/browser/autofill_merge_unittest.cc
@@ -32,7 +32,7 @@
#include "url/gurl.h"
#if BUILDFLAG(IS_APPLE)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
namespace autofill {
@@ -83,7 +83,7 @@
std::sort(files.begin(), files.end());
#if BUILDFLAG(IS_APPLE)
- base::mac::ClearAmIBundledCache();
+ base::apple::ClearAmIBundledCache();
#endif // BUILDFLAG(IS_APPLE)
return files;
diff --git a/components/autofill/ios/browser/autofill_agent.mm b/components/autofill/ios/browser/autofill_agent.mm
index 1f9a053..56327da 100644
--- a/components/autofill/ios/browser/autofill_agent.mm
+++ b/components/autofill/ios/browser/autofill_agent.mm
@@ -10,10 +10,10 @@
#import <string>
#import <utility>
+#import "base/apple/foundation_util.h"
#import "base/format_macros.h"
#import "base/json/json_reader.h"
#import "base/json/json_writer.h"
-#import "base/mac/foundation_util.h"
#import "base/memory/weak_ptr.h"
#import "base/metrics/field_trial.h"
#import "base/metrics/histogram_macros.h"
diff --git a/components/autofill/ios/browser/autofill_util.mm b/components/autofill/ios/browser/autofill_util.mm
index f844edb..916067f8 100644
--- a/components/autofill/ios/browser/autofill_util.mm
+++ b/components/autofill/ios/browser/autofill_util.mm
@@ -6,11 +6,11 @@
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/components/autofill/ios/form_util/form_handlers_unittest.mm b/components/autofill/ios/form_util/form_handlers_unittest.mm
index f92a9ab5..9fbb747 100644
--- a/components/autofill/ios/form_util/form_handlers_unittest.mm
+++ b/components/autofill/ios/form_util/form_handlers_unittest.mm
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#import "base/apple/foundation_util.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "base/time/time.h"
diff --git a/components/bookmarks/browser/bookmark_pasteboard_helper_mac.mm b/components/bookmarks/browser/bookmark_pasteboard_helper_mac.mm
index fe00a7a..cd2cea73 100644
--- a/components/bookmarks/browser/bookmark_pasteboard_helper_mac.mm
+++ b/components/bookmarks/browser/bookmark_pasteboard_helper_mac.mm
@@ -10,8 +10,8 @@
#include <memory>
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/uuid.h"
#include "components/bookmarks/browser/bookmark_node.h"
@@ -52,8 +52,8 @@
[dictionary
enumerateKeysAndObjectsUsingBlock:^(id key, id value, BOOL* stop) {
- NSString* key_ns = base::mac::ObjCCast<NSString>(key);
- NSString* value_ns = base::mac::ObjCCast<NSString>(value);
+ NSString* key_ns = base::apple::ObjCCast<NSString>(key);
+ NSString* value_ns = base::apple::ObjCCast<NSString>(value);
if (key_ns && value_ns) {
meta_info_map[base::SysNSStringToUTF8(key_ns)] =
base::SysNSStringToUTF8(value_ns);
@@ -80,7 +80,7 @@
std::vector<BookmarkNodeData::Element>* elements) {
for (NSDictionary* bookmark_dict in input) {
NSString* type =
- base::mac::ObjCCast<NSString>(bookmark_dict[kWebBookmarkTypeKey]);
+ base::apple::ObjCCast<NSString>(bookmark_dict[kWebBookmarkTypeKey]);
if (!type)
continue;
@@ -89,7 +89,7 @@
GURL url = GURL();
if (!is_folder) {
NSString* url_string =
- base::mac::ObjCCast<NSString>(bookmark_dict[kURLStringKey]);
+ base::apple::ObjCCast<NSString>(bookmark_dict[kURLStringKey]);
if (!url_string)
continue;
url = GURL(base::SysNSStringToUTF8(url_string));
@@ -99,16 +99,16 @@
/*id=*/0, base::Uuid::GenerateRandomV4(), url);
NSNumber* node_id =
- base::mac::ObjCCast<NSNumber>(bookmark_dict[kChromiumBookmarkIdKey]);
+ base::apple::ObjCCast<NSNumber>(bookmark_dict[kChromiumBookmarkIdKey]);
if (node_id)
new_node->set_id(node_id.longLongValue);
- NSDictionary* meta_info = base::mac::ObjCCast<NSDictionary>(
+ NSDictionary* meta_info = base::apple::ObjCCast<NSDictionary>(
bookmark_dict[kChromiumBookmarkMetaInfoKey]);
if (meta_info)
new_node->SetMetaInfoMap(MetaInfoMapFromDictionary(meta_info));
- NSString* title = base::mac::ObjCCast<NSString>(bookmark_dict[kTitleKey]);
+ NSString* title = base::apple::ObjCCast<NSString>(bookmark_dict[kTitleKey]);
new_node->SetTitle(base::SysNSStringToUTF16(title));
BookmarkNodeData::Element e = BookmarkNodeData::Element(new_node.get());
@@ -133,7 +133,7 @@
if (!bookmarks)
return false;
- NSArray* bookmarks_array = base::mac::ObjCCast<NSArray>(bookmarks);
+ NSArray* bookmarks_array = base::apple::ObjCCast<NSArray>(bookmarks);
if (!bookmarks_array)
return false;
diff --git a/components/crash/core/app/crashpad_ios.mm b/components/crash/core/app/crashpad_ios.mm
index 66e148f6..e12830c 100644
--- a/components/crash/core/app/crashpad_ios.mm
+++ b/components/crash/core/app/crashpad_ios.mm
@@ -8,7 +8,7 @@
#include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "build/branding_buildflags.h"
#include "components/crash/core/app/crash_reporter_client.h"
@@ -32,7 +32,7 @@
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
process_annotations["prod"] = "Chrome_iOS";
#else
- NSString* product = base::mac::ObjCCast<NSString>(
+ NSString* product = base::apple::ObjCCast<NSString>(
[outer_bundle objectForInfoDictionaryKey:base::apple::CFToNSPtrCast(
kCFBundleNameKey)]);
process_annotations["prod"] =
@@ -45,14 +45,14 @@
#else
const bool allow_empty_channel = false;
#endif
- NSString* channel = base::mac::ObjCCast<NSString>(
+ NSString* channel = base::apple::ObjCCast<NSString>(
[outer_bundle objectForInfoDictionaryKey:@"KSChannelID"]);
// Must be a developer build.
if (!allow_empty_channel && (!channel || !channel.length))
channel = @"developer";
process_annotations["channel"] = base::SysNSStringToUTF8(channel);
NSString* version =
- base::mac::ObjCCast<NSString>([base::apple::FrameworkBundle()
+ base::apple::ObjCCast<NSString>([base::apple::FrameworkBundle()
objectForInfoDictionaryKey:@"CFBundleVersion"]);
process_annotations["ver"] = base::SysNSStringToUTF8(version);
process_annotations["plat"] = std::string("iOS");
diff --git a/components/crash/core/app/crashpad_mac.mm b/components/crash/core/app/crashpad_mac.mm
index e6c1805b..eb5bcfe 100644
--- a/components/crash/core/app/crashpad_mac.mm
+++ b/components/crash/core/app/crashpad_mac.mm
@@ -14,9 +14,9 @@
#include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/check.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/sys_string_conversions.h"
@@ -42,7 +42,7 @@
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
process_annotations["prod"] = "Chrome_Mac";
#else
- NSString* product = base::mac::ObjCCast<NSString>(
+ NSString* product = base::apple::ObjCCast<NSString>(
[outer_bundle objectForInfoDictionaryKey:base::apple::CFToNSPtrCast(
kCFBundleNameKey)]);
process_annotations["prod"] =
@@ -55,7 +55,7 @@
#else
const bool allow_empty_channel = false;
#endif
- NSString* channel = base::mac::ObjCCast<NSString>(
+ NSString* channel = base::apple::ObjCCast<NSString>(
[outer_bundle objectForInfoDictionaryKey:@"KSChannelID"]);
if (!channel || [channel isEqual:@"arm64"] ||
[channel isEqual:@"universal"]) {
@@ -79,7 +79,7 @@
}
NSString* version =
- base::mac::ObjCCast<NSString>([base::apple::FrameworkBundle()
+ base::apple::ObjCCast<NSString>([base::apple::FrameworkBundle()
objectForInfoDictionaryKey:@"CFBundleShortVersionString"]);
process_annotations["ver"] = base::SysNSStringToUTF8(version);
diff --git a/components/cronet/ios/cronet_environment.mm b/components/cronet/ios/cronet_environment.mm
index 93f8abdf..e6b1832 100644
--- a/components/cronet/ios/cronet_environment.mm
+++ b/components/cronet/ios/cronet_environment.mm
@@ -7,13 +7,13 @@
#include <atomic>
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/message_loop/message_pump_type.h"
#include "base/path_service.h"
#include "base/synchronization/waitable_event.h"
diff --git a/components/device_signals/core/browser/mac/plist_settings_client.mm b/components/device_signals/core/browser/mac/plist_settings_client.mm
index b87f135..63ace44 100644
--- a/components/device_signals/core/browser/mac/plist_settings_client.mm
+++ b/components/device_signals/core/browser/mac/plist_settings_client.mm
@@ -8,10 +8,10 @@
#include <utility>
+#import "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/json/json_writer.h"
-#import "base/mac/foundation_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/thread_pool.h"
@@ -36,7 +36,7 @@
NSArray* indexes = [path componentsSeparatedByString:@"["];
for (NSString* index_with_bracket in indexes) {
- NSArray* data_array = base::mac::ObjCCast<NSArray>(data_obj);
+ NSArray* data_array = base::apple::ObjCCast<NSArray>(data_obj);
if (!data_array) {
return nil;
}
@@ -134,7 +134,7 @@
}
NSError* error = nil;
- NSURL* url = base::mac::FilePathToNSURL(resolved_path);
+ NSURL* url = base::apple::FilePathToNSURL(resolved_path);
NSDictionary* plist_dict =
[[NSDictionary alloc] initWithContentsOfURL:url error:&error];
if (error && error.code == NSFileReadNoPermissionError) {
@@ -161,7 +161,7 @@
continue;
}
- if (NSString* setting_str = base::mac::ObjCCast<NSString>(value_ptr)) {
+ if (NSString* setting_str = base::apple::ObjCCast<NSString>(value_ptr)) {
if (setting_str.length <= kMaxStringSizeInBytes) {
std::string setting_json_string;
base::JSONWriter::Write(
@@ -169,7 +169,8 @@
&setting_json_string);
item.setting_json_value = setting_json_string;
}
- } else if (NSNumber* value_num = base::mac::ObjCCast<NSNumber>(value_ptr)) {
+ } else if (NSNumber* value_num =
+ base::apple::ObjCCast<NSNumber>(value_ptr)) {
// Differentiating between integer and float types.
const char* value_type = value_num.objCType;
if (strcmp(value_type, "d") == 0 || strcmp(value_type, "f") == 0) {
diff --git a/components/device_signals/core/system_signals/mac/mac_platform_delegate.mm b/components/device_signals/core/system_signals/mac/mac_platform_delegate.mm
index 7c5035e..450dbd21 100644
--- a/components/device_signals/core/system_signals/mac/mac_platform_delegate.mm
+++ b/components/device_signals/core/system_signals/mac/mac_platform_delegate.mm
@@ -7,9 +7,9 @@
#include <CoreFoundation/CoreFoundation.h>
#import <Foundation/Foundation.h>
+#import "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_path.h"
-#import "base/mac/foundation_util.h"
#include "crypto/sha2.h"
#include "net/cert/asn1_util.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
@@ -24,11 +24,11 @@
base::FilePath GetBinaryFilePath(const base::FilePath& file_path) {
// Try to load the path into a bundle.
NSBundle* bundle =
- [NSBundle bundleWithPath:base::mac::FilePathToNSString(file_path)];
+ [NSBundle bundleWithPath:base::apple::FilePathToNSString(file_path)];
if (bundle) {
NSString* executable_path = bundle.executablePath;
if (executable_path) {
- return base::mac::NSStringToFilePath(executable_path);
+ return base::apple::NSStringToFilePath(executable_path);
}
}
@@ -45,7 +45,7 @@
base::FilePath current_path = file_path;
do {
NSString* current_path_string =
- base::mac::FilePathToNSString(current_path);
+ base::apple::FilePathToNSString(current_path);
NSBundle* bundle = [NSBundle bundleWithPath:current_path_string];
if (bundle.infoDictionary.count > 0) {
// Current path points to a bundle that has metadata.
@@ -93,7 +93,7 @@
SigningCertificatesPublicKeys public_keys;
base::ScopedCFTypeRef<CFURLRef> file_url =
- base::mac::FilePathToCFURL(file_path);
+ base::apple::FilePathToCFURL(file_path);
base::ScopedCFTypeRef<SecStaticCodeRef> file_code;
if (SecStaticCodeCreateWithPath(file_url, kSecCSDefaultFlags,
file_code.InitializeInto()) !=
@@ -108,7 +108,7 @@
return public_keys;
}
- CFArrayRef cert_chain = base::mac::GetValueFromDictionary<CFArrayRef>(
+ CFArrayRef cert_chain = base::apple::GetValueFromDictionary<CFArrayRef>(
signing_information, kSecCodeInfoCertificates);
if (!cert_chain) {
return public_keys;
diff --git a/components/device_signals/core/system_signals/mac/mac_platform_delegate_unittest.mm b/components/device_signals/core/system_signals/mac/mac_platform_delegate_unittest.mm
index 54db4dfd..e69c380 100644
--- a/components/device_signals/core/system_signals/mac/mac_platform_delegate_unittest.mm
+++ b/components/device_signals/core/system_signals/mac/mac_platform_delegate_unittest.mm
@@ -6,10 +6,10 @@
#import <Foundation/Foundation.h>
+#import "base/apple/foundation_util.h"
#include "base/base64.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
-#import "base/mac/foundation_util.h"
#include "components/device_signals/test/test_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/dom_distiller/ios/distiller_page_ios.mm b/components/dom_distiller/ios/distiller_page_ios.mm
index 7283dfd8..add3176 100644
--- a/components/dom_distiller/ios/distiller_page_ios.mm
+++ b/components/dom_distiller/ios/distiller_page_ios.mm
@@ -8,10 +8,10 @@
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/functional/bind.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
diff --git a/components/download/internal/background_service/ios/background_download_task_helper.mm b/components/download/internal/background_service/ios/background_download_task_helper.mm
index 11480f3..0d001b5 100644
--- a/components/download/internal/background_service/ios/background_download_task_helper.mm
+++ b/components/download/internal/background_service/ios/background_download_task_helper.mm
@@ -8,11 +8,11 @@
#include <deque>
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
#include "base/rand_util.h"
@@ -175,7 +175,7 @@
// service's target directory. This must happen immediately on the current
// thread or iOS may delete the file.
const base::FilePath tempPath =
- base::mac::NSStringToFilePath([location path]);
+ base::apple::NSStringToFilePath([location path]);
if (!base::Move(tempPath, it->second->download_path_)) {
LOG(ERROR) << "Failed to move file from:" << tempPath
<< ", to:" << it->second->download_path_;
diff --git a/components/metal_util/hdr_copier_layer.mm b/components/metal_util/hdr_copier_layer.mm
index a33e4fa8..cf746b27 100644
--- a/components/metal_util/hdr_copier_layer.mm
+++ b/components/metal_util/hdr_copier_layer.mm
@@ -10,8 +10,8 @@
#include <MetalKit/MetalKit.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "components/metal_util/device.h"
#include "third_party/skia/modules/skcms/skcms.h"
@@ -405,7 +405,7 @@
id<MTLDevice> device,
const gfx::ColorSpace& color_space,
const absl::optional<gfx::HDRMetadata>& hdr_metadata) {
- if (auto* hdr_copier_layer = base::mac::ObjCCast<HDRCopierLayer>(layer)) {
+ if (auto* hdr_copier_layer = base::apple::ObjCCast<HDRCopierLayer>(layer)) {
[hdr_copier_layer setHDRContents:buffer
device:device
colorSpace:color_space
diff --git a/components/metrics/drive_metrics_provider_mac.mm b/components/metrics/drive_metrics_provider_mac.mm
index 2a24b66..31345099 100644
--- a/components/metrics/drive_metrics_provider_mac.mm
+++ b/components/metrics/drive_metrics_provider_mac.mm
@@ -13,9 +13,9 @@
#include <sys/stat.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_ioobject.h"
@@ -54,7 +54,7 @@
if (!characteristics)
return false;
- CFStringRef type_ref = base::mac::GetValueFromDictionary<CFStringRef>(
+ CFStringRef type_ref = base::apple::GetValueFromDictionary<CFStringRef>(
characteristics, CFSTR(kIOPropertyMediumTypeKey));
if (!type_ref)
return false;
diff --git a/components/open_from_clipboard/clipboard_recent_content_impl_ios.mm b/components/open_from_clipboard/clipboard_recent_content_impl_ios.mm
index a1e6a39..9ef5b2b 100644
--- a/components/open_from_clipboard/clipboard_recent_content_impl_ios.mm
+++ b/components/open_from_clipboard/clipboard_recent_content_impl_ios.mm
@@ -7,8 +7,8 @@
#import <MobileCoreServices/MobileCoreServices.h>
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
#include "base/system/sys_info.h"
@@ -675,7 +675,7 @@
- (void)loadFromUserDefaults {
self.lastPasteboardChangeCount =
[self.sharedUserDefaults integerForKey:kPasteboardChangeCountKey];
- self.lastPasteboardChangeDate = base::mac::ObjCCastStrict<NSDate>(
+ self.lastPasteboardChangeDate = base::apple::ObjCCastStrict<NSDate>(
[self.sharedUserDefaults objectForKey:kPasteboardChangeDateKey]);
}
diff --git a/components/optimization_guide/core/entity_annotator_native_library.cc b/components/optimization_guide/core/entity_annotator_native_library.cc
index 3bd69a8..261ecba8 100644
--- a/components/optimization_guide/core/entity_annotator_native_library.cc
+++ b/components/optimization_guide/core/entity_annotator_native_library.cc
@@ -17,7 +17,7 @@
#if BUILDFLAG(IS_MAC)
#include "base/apple/bundle_locations.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
// IMPORTANT: All functions in this file that call dlsym()'ed
@@ -86,7 +86,7 @@
base::FilePath base_dir;
#if !BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_MAC)
- if (base::mac::AmIBundled()) {
+ if (base::apple::AmIBundled()) {
base_dir = base::apple::FrameworkBundlePath().Append("Libraries");
} else {
#endif // BUILDFLAG(IS_MAC)
diff --git a/components/password_manager/core/browser/login_database_ios.cc b/components/password_manager/core/browser/login_database_ios.cc
index 705d3623..f0c78dc 100644
--- a/components/password_manager/core/browser/login_database_ios.cc
+++ b/components/password_manager/core/browser/login_database_ios.cc
@@ -10,11 +10,11 @@
#include <memory>
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/base64.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "components/password_manager/core/common/passwords_directory_util_ios.h"
@@ -106,7 +106,7 @@
return ENCRYPTION_RESULT_SERVICE_FAILURE;
}
- CFDataRef data = base::mac::CFCast<CFDataRef>(data_cftype);
+ CFDataRef data = base::apple::CFCast<CFDataRef>(data_cftype);
const size_t size = CFDataGetLength(data);
std::unique_ptr<UInt8[]> buffer(new UInt8[size]);
CFDataGetBytes(data, CFRangeMake(0, size), buffer.get());
diff --git a/components/password_manager/core/browser/login_database_ios_unittest.cc b/components/password_manager/core/browser/login_database_ios_unittest.cc
index 57283d4..4aecaf8 100644
--- a/components/password_manager/core/browser/login_database_ios_unittest.cc
+++ b/components/password_manager/core/browser/login_database_ios_unittest.cc
@@ -10,9 +10,9 @@
#include <tuple>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/task_environment.h"
@@ -84,7 +84,7 @@
}
EXPECT_EQ(errSecSuccess, status);
- return CFArrayGetCount(base::mac::CFCast<CFArrayRef>(result));
+ return CFArrayGetCount(base::apple::CFCast<CFArrayRef>(result));
}
TEST_F(LoginDatabaseIOSTest, KeychainStorage) {
diff --git a/components/password_manager/ios/shared_password_controller.mm b/components/password_manager/ios/shared_password_controller.mm
index fec7cee..105e349 100644
--- a/components/password_manager/ios/shared_password_controller.mm
+++ b/components/password_manager/ios/shared_password_controller.mm
@@ -13,9 +13,9 @@
#include <utility>
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/components/policy/core/common/mac_util.cc b/components/policy/core/common/mac_util.cc
index b1d4392..61ade5f 100644
--- a/components/policy/core/common/mac_util.cc
+++ b/components/policy/core/common/mac_util.cc
@@ -8,11 +8,11 @@
#include <string>
#include <utility>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/values.h"
-using base::mac::CFCast;
+using base::apple::CFCast;
namespace policy {
diff --git a/components/policy/core/common/policy_loader_ios.mm b/components/policy/core/common/policy_loader_ios.mm
index 947a089c..0b3ff1e 100644
--- a/components/policy/core/common/policy_loader_ios.mm
+++ b/components/policy/core/common/policy_loader_ios.mm
@@ -8,11 +8,11 @@
#import <UIKit/UIKit.h>
#import <stddef.h>
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/functional/bind.h"
#import "base/json/json_reader.h"
#import "base/location.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/task/sequenced_task_runner.h"
#import "base/time/time.h"
diff --git a/components/policy/core/common/policy_loader_mac.mm b/components/policy/core/common/policy_loader_mac.mm
index 4e063c7..3e0d27a 100644
--- a/components/policy/core/common/policy_loader_mac.mm
+++ b/components/policy/core/common/policy_loader_mac.mm
@@ -8,13 +8,13 @@
#include <Foundation/Foundation.h>
+#include "base/apple/foundation_util.h"
#include "base/enterprise_util.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
-#include "base/mac/foundation_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/sys_string_conversions.h"
#import "base/task/sequenced_task_runner.h"
@@ -162,8 +162,9 @@
// missed the change.
base::FilePath path;
- if (!base::mac::GetLocalDirectory(NSLibraryDirectory, &path))
+ if (!base::apple::GetLocalDirectory(NSLibraryDirectory, &path)) {
return base::FilePath();
+ }
path = path.Append(FILE_PATH_LITERAL("Managed Preferences"));
char* login = getlogin();
if (!login)
diff --git a/components/policy/core/common/preferences_mac.mm b/components/policy/core/common/preferences_mac.mm
index 62476603..4284a94 100644
--- a/components/policy/core/common/preferences_mac.mm
+++ b/components/policy/core/common/preferences_mac.mm
@@ -5,8 +5,8 @@
#import <Foundation/Foundation.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/feature_list.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/values.h"
#include "components/policy/core/common/features.h"
diff --git a/components/power_metrics/energy_impact_mac.mm b/components/power_metrics/energy_impact_mac.mm
index 040a12a..c4eddf9 100644
--- a/components/power_metrics/energy_impact_mac.mm
+++ b/components/power_metrics/energy_impact_mac.mm
@@ -7,8 +7,8 @@
#include <Foundation/Foundation.h>
#import <IOKit/IOKitLib.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/scoped_ioobject.h"
#include "base/strings/sys_string_conversions.h"
#include "base/time/time.h"
@@ -21,13 +21,13 @@
NSDictionary* MaybeGetDictionaryFromPath(const base::FilePath& path) {
// The folder where the energy coefficient plist files are stored.
- return
- [NSDictionary dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(path)
- error:nil];
+ return [NSDictionary
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(path)
+ error:nil];
}
double GetNamedCoefficientOrZero(NSDictionary* dict, NSString* key) {
- NSNumber* num = base::mac::ObjCCast<NSNumber>(dict[key]);
+ NSNumber* num = base::apple::ObjCCast<NSNumber>(dict[key]);
return num.floatValue;
}
@@ -183,7 +183,7 @@
// This is what libpmenergy is observed to do in order to retrieve the correct
// coefficients file for the local computer.
base::ScopedCFTypeRef<CFDataRef> board_id_data(
- base::mac::CFCast<CFDataRef>(IORegistryEntryCreateCFProperty(
+ base::apple::CFCast<CFDataRef>(IORegistryEntryCreateCFProperty(
platform_expert, CFSTR("board-id"), kCFAllocatorDefault, 0)));
if (!board_id_data)
diff --git a/components/power_metrics/m1_sensors_mac.mm b/components/power_metrics/m1_sensors_mac.mm
index d5945b6..ff65ff9 100644
--- a/components/power_metrics/m1_sensors_mac.mm
+++ b/components/power_metrics/m1_sensors_mac.mm
@@ -12,7 +12,7 @@
#include <utility>
#include "base/apple/bridging.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/memory/ptr_util.h"
#include "components/power_metrics/m1_sensors_internal_types_mac.h"
@@ -82,7 +82,7 @@
IOHIDServiceClientRef service =
(IOHIDServiceClientRef)CFArrayGetValueAtIndex(services, i);
- base::ScopedCFTypeRef<CFStringRef> product(base::mac::CFCast<CFStringRef>(
+ base::ScopedCFTypeRef<CFStringRef> product(base::apple::CFCast<CFStringRef>(
IOHIDServiceClientCopyProperty(service, CFSTR(kIOHIDProductKey))));
if (product == nil) {
continue;
diff --git a/components/remote_cocoa/app_shim/alert.mm b/components/remote_cocoa/app_shim/alert.mm
index f499b7bd..97c0937 100644
--- a/components/remote_cocoa/app_shim/alert.mm
+++ b/components/remote_cocoa/app_shim/alert.mm
@@ -4,9 +4,9 @@
#include "components/remote_cocoa/app_shim/alert.h"
+#import "base/apple/foundation_util.h"
#include "base/functional/bind.h"
#include "base/i18n/rtl.h"
-#import "base/mac/foundation_util.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/strings/sys_string_conversions.h"
#include "ui/accelerated_widget_mac/window_resize_helper_mac.h"
@@ -132,7 +132,7 @@
// of the NSAlert, but it is safer (and more forward-compatible) to search
// for them in the subviews.
for (NSView* view in _alert.window.contentView.subviews) {
- NSTextField* text_field = base::mac::ObjCCast<NSTextField>(view);
+ NSTextField* text_field = base::apple::ObjCCast<NSTextField>(view);
if ([text_field.stringValue isEqualTo:message_text]) {
message_text_field = text_field;
} else if ([text_field.stringValue isEqualTo:informative_text]) {
diff --git a/components/remote_cocoa/app_shim/bridged_content_view.mm b/components/remote_cocoa/app_shim/bridged_content_view.mm
index ad0dff9..5e2e2859 100644
--- a/components/remote_cocoa/app_shim/bridged_content_view.mm
+++ b/components/remote_cocoa/app_shim/bridged_content_view.mm
@@ -6,9 +6,9 @@
#include <limits>
+#import "base/apple/foundation_util.h"
#include "base/apple/owned_objc.h"
#include "base/check_op.h"
-#import "base/mac/foundation_util.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
#import "components/remote_cocoa/app_shim/drag_drop_client.h"
diff --git a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
index 1332ba3..9db1a07a 100644
--- a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
+++ b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
@@ -32,7 +32,7 @@
bool overrideTitlebarHeight = false;
float titlebarHeight = 0;
- auto* window = base::mac::ObjCCast<NativeWidgetMacNSWindow>([self window]);
+ auto* window = base::apple::ObjCCast<NativeWidgetMacNSWindow>([self window]);
remote_cocoa::NativeWidgetNSWindowBridge* bridge = [window bridge];
if (!bridge) {
return [super _titlebarHeight];
diff --git a/components/remote_cocoa/app_shim/certificate_viewer.mm b/components/remote_cocoa/app_shim/certificate_viewer.mm
index 6bb2927..db12f8b 100644
--- a/components/remote_cocoa/app_shim/certificate_viewer.mm
+++ b/components/remote_cocoa/app_shim/certificate_viewer.mm
@@ -9,8 +9,8 @@
#import <SecurityInterface/SecurityInterface.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/notreached.h"
#include "net/cert/x509_util_apple.h"
diff --git a/components/remote_cocoa/app_shim/immersive_mode_controller.mm b/components/remote_cocoa/app_shim/immersive_mode_controller.mm
index 5ece1a7..20c3ea7 100644
--- a/components/remote_cocoa/app_shim/immersive_mode_controller.mm
+++ b/components/remote_cocoa/app_shim/immersive_mode_controller.mm
@@ -4,10 +4,10 @@
#include "components/remote_cocoa/app_shim/immersive_mode_controller.h"
+#include "base/apple/foundation_util.h"
#include "base/auto_reset.h"
#include "base/check.h"
#include "base/containers/contains.h"
-#include "base/mac/foundation_util.h"
#import "components/remote_cocoa/app_shim/immersive_mode_delegate_mac.h"
#import "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h"
#include "ui/gfx/geometry/rect.h"
@@ -191,7 +191,7 @@
// local strong reference. This view will be re-parented into the AppKit
// created NSWindow.
BridgedContentView* overlay_content_view =
- base::mac::ObjCCastStrict<BridgedContentView>(
+ base::apple::ObjCCastStrict<BridgedContentView>(
overlay_window_.contentView);
overlay_content_view_ = overlay_content_view;
[overlay_content_view removeFromSuperview];
@@ -353,7 +353,7 @@
void ImmersiveModeController::ObserveChildWindows(NSWindow* window) {
// Watch the Widget for addition and removal of child Widgets.
NativeWidgetMacNSWindow* widget_window =
- base::mac::ObjCCastStrict<NativeWidgetMacNSWindow>(window);
+ base::apple::ObjCCastStrict<NativeWidgetMacNSWindow>(window);
widget_window.childWindowAddedHandler = ^(NSWindow* child) {
OnChildWindowAdded(child);
};
@@ -364,7 +364,7 @@
void ImmersiveModeController::StopObservingChildWindows(NSWindow* window) {
NativeWidgetMacNSWindow* widget_window =
- base::mac::ObjCCastStrict<NativeWidgetMacNSWindow>(window);
+ base::apple::ObjCCastStrict<NativeWidgetMacNSWindow>(window);
widget_window.childWindowAddedHandler = nil;
widget_window.childWindowRemovedHandler = nil;
}
diff --git a/components/remote_cocoa/app_shim/immersive_mode_tabbed_controller.mm b/components/remote_cocoa/app_shim/immersive_mode_tabbed_controller.mm
index 24a9a11..43bf8e8 100644
--- a/components/remote_cocoa/app_shim/immersive_mode_tabbed_controller.mm
+++ b/components/remote_cocoa/app_shim/immersive_mode_tabbed_controller.mm
@@ -4,8 +4,8 @@
#include "components/remote_cocoa/app_shim/immersive_mode_tabbed_controller.h"
+#include "base/apple/foundation_util.h"
#include "base/functional/callback_forward.h"
-#include "base/mac/foundation_util.h"
#import "components/remote_cocoa/app_shim/bridged_content_view.h"
#include "components/remote_cocoa/app_shim/immersive_mode_controller.h"
@@ -43,7 +43,7 @@
void ImmersiveModeTabbedController::Enable() {
ImmersiveModeController::Enable();
BridgedContentView* tab_content_view =
- base::mac::ObjCCastStrict<BridgedContentView>(tab_window_.contentView);
+ base::apple::ObjCCastStrict<BridgedContentView>(tab_window_.contentView);
[tab_content_view removeFromSuperview];
tab_content_view_ = tab_content_view;
diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h
index 90da6ac4..8c0114f 100644
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h
@@ -7,7 +7,7 @@
#import <Cocoa/Cocoa.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "components/remote_cocoa/app_shim/remote_cocoa_app_shim_export.h"
#import "ui/base/cocoa/command_dispatcher.h"
diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
index b07bcae..8eff95b 100644
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
@@ -4,9 +4,9 @@
#import "components/remote_cocoa/app_shim/native_widget_mac_nswindow.h"
+#include "base/apple/foundation_util.h"
#include "base/auto_reset.h"
#include "base/debug/dump_without_crashing.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/trace_event/trace_event.h"
@@ -364,7 +364,7 @@
// Private methods.
- (ViewsNSWindowDelegate*)viewsNSWindowDelegate {
- return base::mac::ObjCCastStrict<ViewsNSWindowDelegate>([self delegate]);
+ return base::apple::ObjCCastStrict<ViewsNSWindowDelegate>([self delegate]);
}
- (BOOL)hasViewsMenuActive {
@@ -605,7 +605,7 @@
// arrange for our removal after our parent becomes the active window
// to avoid triggering a Space switch.
NativeWidgetMacNSWindow* parentWindow =
- base::mac::ObjCCast<NativeWidgetMacNSWindow>([self parentWindow]);
+ base::apple::ObjCCast<NativeWidgetMacNSWindow>([self parentWindow]);
if (parentWindow != nil && ![parentWindow isOnActiveSpace]) {
[parentWindow removeChildWindowOnActivation:self];
} else {
@@ -857,7 +857,7 @@
for (NSWindow* childWindow in self.childWindows) {
NativeWidgetMacNSWindow* nativeWidgetMacNSWindow =
- base::mac::ObjCCast<NativeWidgetMacNSWindow>(childWindow);
+ base::apple::ObjCCast<NativeWidgetMacNSWindow>(childWindow);
[nativeWidgetMacNSWindow
performSelector:@selector(processChildWindowOrderingCommands)
diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
index 8d6c87c..5b9ba84 100644
--- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
+++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
@@ -11,10 +11,10 @@
#include <cmath>
#include <memory>
+#import "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/logging.h"
-#import "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -229,7 +229,7 @@
for (NSWindow* child in child_windows) {
NativeWidgetMacNSWindow* parentWindow =
- base::mac::ObjCCast<NativeWidgetMacNSWindow>([child parentWindow]);
+ base::apple::ObjCCast<NativeWidgetMacNSWindow>([child parentWindow]);
// The child may be in an intermediary state where it's been removed from
// Views but not from the childWindow list (see the description of
@@ -282,7 +282,7 @@
gfx::NativeWindow native_window) {
NSWindow* window = native_window.GetNativeNSWindow();
if (NativeWidgetMacNSWindow* widget_window =
- base::mac::ObjCCast<NativeWidgetMacNSWindow>(window)) {
+ base::apple::ObjCCast<NativeWidgetMacNSWindow>(window)) {
return GetFromId([widget_window bridgedNativeWidgetId]);
}
return nullptr;
@@ -771,7 +771,7 @@
[window_ orderOut:nil];
NativeWidgetMacNSWindow* parentWindow =
- base::mac::ObjCCast<NativeWidgetMacNSWindow>([window_ parentWindow]);
+ base::apple::ObjCCast<NativeWidgetMacNSWindow>([window_ parentWindow]);
DCHECK(!window_visible_ ||
[parentWindow willRemoveChildWindowOnActivation:window_]);
return;
@@ -1108,7 +1108,7 @@
void NativeWidgetNSWindowBridge::OnVisibilityChanged() {
NativeWidgetMacNSWindow* parentWindow =
- base::mac::ObjCCast<NativeWidgetMacNSWindow>([window_ parentWindow]);
+ base::apple::ObjCCast<NativeWidgetMacNSWindow>([window_ parentWindow]);
const bool window_visible =
[window_ isVisible] &&
![parentWindow willRemoveChildWindowOnActivation:window_];
@@ -1713,7 +1713,7 @@
[childWindow orderOut:nil];
}
NativeWidgetMacNSWindow* parentWindow =
- base::mac::ObjCCast<NativeWidgetMacNSWindow>(
+ base::apple::ObjCCast<NativeWidgetMacNSWindow>(
[childWindow parentWindow]);
DCHECK(!child->window_visible_ ||
diff --git a/components/remote_cocoa/app_shim/select_file_dialog_bridge.mm b/components/remote_cocoa/app_shim/select_file_dialog_bridge.mm
index 8df7a18..b7b0b2e 100644
--- a/components/remote_cocoa/app_shim/select_file_dialog_bridge.mm
+++ b/components/remote_cocoa/app_shim/select_file_dialog_bridge.mm
@@ -11,10 +11,10 @@
#include <stddef.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_util.h"
#include "base/i18n/case_conversion.h"
-#include "base/mac/foundation_util.h"
#import "base/mac/mac_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
@@ -557,7 +557,7 @@
if (type_ == SelectFileDialogType::kSaveAsFile) {
NSURL* url = [panel_ URL];
if ([url isFileURL]) {
- paths.push_back(base::mac::NSStringToFilePath([url path]));
+ paths.push_back(base::apple::NSStringToFilePath([url path]));
}
NSView* accessoryView = [panel_ accessoryView];
@@ -595,7 +595,7 @@
continue;
}
- paths.push_back(base::mac::NSStringToFilePath(path));
+ paths.push_back(base::apple::NSStringToFilePath(path));
}
}
}
diff --git a/components/services/quarantine/common_mac.mm b/components/services/quarantine/common_mac.mm
index 0f1bfdb5..5401741 100644
--- a/components/services/quarantine/common_mac.mm
+++ b/components/services/quarantine/common_mac.mm
@@ -7,18 +7,18 @@
#import <ApplicationServices/ApplicationServices.h>
#include <Foundation/Foundation.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_path.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/strings/sys_string_conversions.h"
namespace quarantine {
NSDictionary* GetQuarantineProperties(const base::FilePath& file) {
- NSURL* file_url = base::mac::FilePathToNSURL(file);
+ NSURL* file_url = base::apple::FilePathToNSURL(file);
if (!file_url) {
return nil;
}
@@ -40,7 +40,7 @@
}
NSDictionary* quarantine_properties_dict =
- base::mac::ObjCCast<NSDictionary>(quarantine_properties);
+ base::apple::ObjCCast<NSDictionary>(quarantine_properties);
if (!quarantine_properties_dict) {
LOG(WARNING) << "Quarantine properties have wrong class: "
<< base::SysNSStringToUTF8(
diff --git a/components/services/quarantine/quarantine_mac.mm b/components/services/quarantine/quarantine_mac.mm
index cde415d..921cc51 100644
--- a/components/services/quarantine/quarantine_mac.mm
+++ b/components/services/quarantine/quarantine_mac.mm
@@ -8,12 +8,12 @@
#import <Foundation/Foundation.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/threading/scoped_blocking_call.h"
@@ -56,7 +56,7 @@
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK);
- NSString* file_path = base::mac::FilePathToNSString(file);
+ NSString* file_path = base::apple::FilePathToNSString(file);
if (!file_path) {
return false;
}
diff --git a/components/services/quarantine/quarantine_mac_unittest.mm b/components/services/quarantine/quarantine_mac_unittest.mm
index 7e73e6f..dd9105f 100644
--- a/components/services/quarantine/quarantine_mac_unittest.mm
+++ b/components/services/quarantine/quarantine_mac_unittest.mm
@@ -8,12 +8,12 @@
#import <Foundation/Foundation.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/run_loop.h"
#include "base/strings/sys_string_conversions.h"
#include "base/test/task_environment.h"
@@ -44,7 +44,7 @@
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
ASSERT_TRUE(
base::CreateTemporaryFileInDir(temp_dir_.GetPath(), &test_file_));
- file_url_ = base::mac::FilePathToNSURL(test_file_);
+ file_url_ = base::apple::FilePathToNSURL(test_file_);
NSDictionary* properties = @{
static_cast<NSString*>(kLSQuarantineAgentBundleIdentifierKey) :
@@ -162,7 +162,7 @@
base::BindOnce(&CheckQuarantineResult, QuarantineFileResult::OK));
base::RunLoop().RunUntilIdle();
- NSString* file_path = base::mac::FilePathToNSString(test_file_);
+ NSString* file_path = base::apple::FilePathToNSString(test_file_);
ASSERT_NE(nullptr, file_path);
base::ScopedCFTypeRef<MDItemRef> md_item(
MDItemCreate(kCFAllocatorDefault, base::apple::NSToCFPtrCast(file_path)));
diff --git a/components/services/quarantine/test_support_mac.mm b/components/services/quarantine/test_support_mac.mm
index 1c8b48a..c111b79 100644
--- a/components/services/quarantine/test_support_mac.mm
+++ b/components/services/quarantine/test_support_mac.mm
@@ -8,9 +8,9 @@
#import <Foundation/Foundation.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/threading/scoped_blocking_call.h"
#include "components/services/quarantine/common.h"
diff --git a/components/shared_highlighting/core/common/shared_highlighting_data_driven_test.cc b/components/shared_highlighting/core/common/shared_highlighting_data_driven_test.cc
index bbe5eec..19acdae 100644
--- a/components/shared_highlighting/core/common/shared_highlighting_data_driven_test.cc
+++ b/components/shared_highlighting/core/common/shared_highlighting_data_driven_test.cc
@@ -20,7 +20,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
namespace shared_highlighting {
@@ -100,7 +100,7 @@
std::sort(files.begin(), files.end());
#if BUILDFLAG(IS_MAC)
- base::mac::ClearAmIBundledCache();
+ base::apple::ClearAmIBundledCache();
#endif // BUILDFLAG(IS_MAC)
return files;
diff --git a/components/signin/ios/browser/account_consistency_service.mm b/components/signin/ios/browser/account_consistency_service.mm
index fbdebd6..2798cc7 100644
--- a/components/signin/ios/browser/account_consistency_service.mm
+++ b/components/signin/ios/browser/account_consistency_service.mm
@@ -6,10 +6,10 @@
#import <WebKit/WebKit.h>
+#import "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/logging.h"
-#import "base/mac/foundation_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/sys_string_conversions.h"
@@ -183,7 +183,7 @@
web::WebStatePolicyDecider::ResponseInfo response_info,
web::WebStatePolicyDecider::PolicyDecisionCallback callback) {
NSHTTPURLResponse* http_response =
- base::mac::ObjCCast<NSHTTPURLResponse>(response);
+ base::apple::ObjCCast<NSHTTPURLResponse>(response);
if (!http_response) {
std::move(callback).Run(PolicyDecision::Allow());
return;
diff --git a/components/spellcheck/browser/spellcheck_platform_mac.mm b/components/spellcheck/browser/spellcheck_platform_mac.mm
index c0c07295..451ee3e 100644
--- a/components/spellcheck/browser/spellcheck_platform_mac.mm
+++ b/components/spellcheck/browser/spellcheck_platform_mac.mm
@@ -8,10 +8,10 @@
#import <Cocoa/Cocoa.h>
+#include "base/apple/foundation_util.h"
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
-#include "base/mac/foundation_util.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
#include "base/time/time.h"
diff --git a/components/storage_monitor/image_capture_device.h b/components/storage_monitor/image_capture_device.h
index ee0b8090..655c215 100644
--- a/components/storage_monitor/image_capture_device.h
+++ b/components/storage_monitor/image_capture_device.h
@@ -8,9 +8,9 @@
#import <Foundation/Foundation.h>
#import <ImageCaptureCore/ImageCaptureCore.h>
+#include "base/apple/foundation_util.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
diff --git a/components/storage_monitor/image_capture_device.mm b/components/storage_monitor/image_capture_device.mm
index ed8e5c2a..2ae5e548 100644
--- a/components/storage_monitor/image_capture_device.mm
+++ b/components/storage_monitor/image_capture_device.mm
@@ -7,10 +7,10 @@
#include <ImageCaptureCore/ImageCaptureCore.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/containers/adapters.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/weak_ptr.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
@@ -115,9 +115,9 @@
if (itemName == name) {
// To create save options for ImageCapture, we need to split the target
// filename into directory/name and encode the directory as a URL.
- NSURL* saveDirectory = base::mac::FilePathToNSURL(localPath.DirName());
+ NSURL* saveDirectory = base::apple::FilePathToNSURL(localPath.DirName());
NSString* saveFilename =
- base::mac::FilePathToNSString(localPath.BaseName());
+ base::apple::FilePathToNSString(localPath.BaseName());
NSDictionary* options = @{
ICDownloadsDirectoryURL : saveDirectory,
@@ -125,12 +125,13 @@
ICOverwrite : @YES,
};
- [_camera requestDownloadFile:base::mac::ObjCCastStrict<ICCameraFile>(item)
- options:options
- downloadDelegate:self
- didDownloadSelector:@selector
- (didDownloadFile:error:options:contextInfo:)
- contextInfo:nullptr];
+ [_camera
+ requestDownloadFile:base::apple::ObjCCastStrict<ICCameraFile>(item)
+ options:options
+ downloadDelegate:self
+ didDownloadSelector:@selector(didDownloadFile:
+ error:options:contextInfo:)
+ contextInfo:nullptr];
return;
}
}
@@ -178,7 +179,7 @@
if ([item.UTI isEqualToString:base::apple::CFToNSPtrCast(kUTTypeFolder)]) {
info.is_directory = true;
} else {
- info.size = base::mac::ObjCCastStrict<ICCameraFile>(item).fileSize;
+ info.size = base::apple::ObjCCastStrict<ICCameraFile>(item).fileSize;
}
base::FilePath path = storage_monitor::PathForCameraItem(item);
diff --git a/components/storage_monitor/image_capture_device_manager.mm b/components/storage_monitor/image_capture_device_manager.mm
index 52016d1..62b83b6 100644
--- a/components/storage_monitor/image_capture_device_manager.mm
+++ b/components/storage_monitor/image_capture_device_manager.mm
@@ -96,7 +96,7 @@
return;
ICCameraDevice* cameraDevice =
- base::mac::ObjCCastStrict<ICCameraDevice>(addedDevice);
+ base::apple::ObjCCastStrict<ICCameraDevice>(addedDevice);
[_cameras addObject:addedDevice];
diff --git a/components/storage_monitor/image_capture_device_manager_unittest.mm b/components/storage_monitor/image_capture_device_manager_unittest.mm
index 0b3813d8..b29c11a 100644
--- a/components/storage_monitor/image_capture_device_manager_unittest.mm
+++ b/components/storage_monitor/image_capture_device_manager_unittest.mm
@@ -6,10 +6,10 @@
#import <ImageCaptureCore/ImageCaptureCore.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "components/storage_monitor/image_capture_device.h"
@@ -91,7 +91,7 @@
didDownloadSelector:(SEL)selector
contextInfo:(void*)contextInfo {
base::FilePath saveDir =
- base::mac::NSURLToFilePath(options[ICDownloadsDirectoryURL]);
+ base::apple::NSURLToFilePath(options[ICDownloadsDirectoryURL]);
std::string saveAsFilename =
base::SysNSStringToUTF8(options[ICSaveAsFilename]);
// It appears that the ImageCapture library adds an extension to the requested
diff --git a/components/storage_monitor/storage_monitor_mac.mm b/components/storage_monitor/storage_monitor_mac.mm
index a32b0073..6632183 100644
--- a/components/storage_monitor/storage_monitor_mac.mm
+++ b/components/storage_monitor/storage_monitor_mac.mm
@@ -9,8 +9,8 @@
#include <memory>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
@@ -32,7 +32,7 @@
std::u16string GetUTF16FromDictionary(CFDictionaryRef dictionary,
CFStringRef key) {
CFStringRef value =
- base::mac::GetValueFromDictionary<CFStringRef>(dictionary, key);
+ base::apple::GetValueFromDictionary<CFStringRef>(dictionary, key);
if (!value)
return std::u16string();
return base::SysCFStringRefToUTF16(value);
@@ -60,16 +60,17 @@
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK);
- CFStringRef device_bsd_name = base::mac::GetValueFromDictionary<CFStringRef>(
- dict, kDADiskDescriptionMediaBSDNameKey);
+ CFStringRef device_bsd_name =
+ base::apple::GetValueFromDictionary<CFStringRef>(
+ dict, kDADiskDescriptionMediaBSDNameKey);
if (device_bsd_name && bsd_name)
*bsd_name = base::SysCFStringRefToUTF8(device_bsd_name);
- CFURLRef url = base::mac::GetValueFromDictionary<CFURLRef>(
+ CFURLRef url = base::apple::GetValueFromDictionary<CFURLRef>(
dict, kDADiskDescriptionVolumePathKey);
base::FilePath location =
- base::mac::NSURLToFilePath(base::apple::CFToNSPtrCast(url));
- CFNumberRef size_number = base::mac::GetValueFromDictionary<CFNumberRef>(
+ base::apple::NSURLToFilePath(base::apple::CFToNSPtrCast(url));
+ CFNumberRef size_number = base::apple::GetValueFromDictionary<CFNumberRef>(
dict, kDADiskDescriptionMediaSizeKey);
uint64_t size_in_bytes = 0;
if (size_number)
@@ -82,7 +83,7 @@
std::u16string label =
GetUTF16FromDictionary(dict, kDADiskDescriptionVolumeNameKey);
- CFUUIDRef uuid = base::mac::GetValueFromDictionary<CFUUIDRef>(
+ CFUUIDRef uuid = base::apple::GetValueFromDictionary<CFUUIDRef>(
dict, kDADiskDescriptionVolumeUUIDKey);
std::string unique_id;
if (uuid) {
@@ -101,7 +102,7 @@
}
CFBooleanRef is_removable_ref =
- base::mac::GetValueFromDictionary<CFBooleanRef>(
+ base::apple::GetValueFromDictionary<CFBooleanRef>(
dict, kDADiskDescriptionMediaRemovableKey);
bool is_removable = is_removable_ref && CFBooleanGetValue(is_removable_ref);
// Checking for DCIM only matters on removable devices.
diff --git a/components/storage_monitor/storage_monitor_mac_unittest.mm b/components/storage_monitor/storage_monitor_mac_unittest.mm
index 65106cd..fbc8a69 100644
--- a/components/storage_monitor/storage_monitor_mac_unittest.mm
+++ b/components/storage_monitor/storage_monitor_mac_unittest.mm
@@ -8,11 +8,11 @@
#include <memory>
+#include "base/apple/foundation_util.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
-#include "base/mac/foundation_util.h"
#include "base/run_loop.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/components/viz/service/display_embedder/software_output_device_mac.cc b/components/viz/service/display_embedder/software_output_device_mac.cc
index 761eb3e..4ceb1a9 100644
--- a/components/viz/service/display_embedder/software_output_device_mac.cc
+++ b/components/viz/service/display_embedder/software_output_device_mac.cc
@@ -7,7 +7,7 @@
#include <memory>
#include <utility>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/task/sequenced_task_runner.h"
#include "base/trace_event/trace_event.h"
#include "third_party/skia/include/core/SkCanvas.h"
diff --git a/components/wifi/wifi_service_mac.mm b/components/wifi/wifi_service_mac.mm
index 6d8ebc7..9d281c07 100644
--- a/components/wifi/wifi_service_mac.mm
+++ b/components/wifi/wifi_service_mac.mm
@@ -13,9 +13,9 @@
#include <string>
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#import "base/task/sequenced_task_runner.h"
#import "base/task/single_thread_task_runner.h"
diff --git a/content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.mm b/content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.mm
index b766ec4..00edf3f 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.mm
@@ -7,8 +7,8 @@
#include <Foundation/Foundation.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "components/remote_cocoa/app_shim/ns_view_ids.h"
#include "content/app_shim_remote_cocoa/render_widget_host_ns_view_host_helper.h"
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index f65f8a19..bf1776a8 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -11,10 +11,10 @@
#include <tuple>
#include <utility>
+#import "base/apple/foundation_util.h"
#include "base/apple/owned_objc.h"
#include "base/containers/contains.h"
#include "base/debug/crash_logging.h"
-#import "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/sys_string_conversions.h"
#include "components/remote_cocoa/app_shim/ns_view_ids.h"
@@ -1800,7 +1800,7 @@
- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item {
if (item.action == @selector(orderFrontSubstitutionsPanel:))
return YES;
- if (NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item)) {
+ if (NSMenuItem* menuItem = base::apple::ObjCCast<NSMenuItem>(item)) {
if (item.action == @selector(toggleAutomaticQuoteSubstitution:)) {
menuItem.state = self.automaticQuoteSubstitutionEnabled;
return !!(self.allowedTextCheckingTypes & NSTextCheckingTypeQuote);
diff --git a/content/app_shim_remote_cocoa/web_contents_occlusion_checker_mac.mm b/content/app_shim_remote_cocoa/web_contents_occlusion_checker_mac.mm
index cdf94c4..2eb84e4 100644
--- a/content/app_shim_remote_cocoa/web_contents_occlusion_checker_mac.mm
+++ b/content/app_shim_remote_cocoa/web_contents_occlusion_checker_mac.mm
@@ -6,12 +6,12 @@
#include <memory>
+#import "base/apple/foundation_util.h"
#import "base/apple/scoped_objc_class_swizzler.h"
#include "base/auto_reset.h"
#include "base/debug/crash_logging.h"
#include "base/debug/dump_without_crashing.h"
#include "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#include "base/metrics/field_trial_params.h"
#include "base/no_destructor.h"
#include "base/system/sys_info.h"
diff --git a/content/app_shim_remote_cocoa/web_drag_source_mac.mm b/content/app_shim_remote_cocoa/web_drag_source_mac.mm
index 4ead1a7..cc4dcec 100644
--- a/content/app_shim_remote_cocoa/web_drag_source_mac.mm
+++ b/content/app_shim_remote_cocoa/web_drag_source_mac.mm
@@ -12,10 +12,10 @@
#include <utility>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/pickle.h"
#include "base/strings/escape.h"
#include "base/strings/string_util.h"
@@ -272,14 +272,14 @@
}
base::FilePath filePath =
- base::mac::NSURLToFilePath([NSURL URLWithString:dropDestination]);
+ base::apple::NSURLToFilePath([NSURL URLWithString:dropDestination]);
filePath = filePath.Append(_downloadFileName);
_host->DragPromisedFileTo(filePath, _dropData, _downloadURL, &filePath);
// The process of writing the file may have altered the value of
// `filePath` if, say, an existing file at the drop site already had that
// name. Return the actual URL to the file that was written.
- return base::mac::FilePathToNSURL(filePath).absoluteString;
+ return base::apple::FilePathToNSURL(filePath).absoluteString;
}
// Plain text.
diff --git a/content/app_shim_remote_cocoa/window_occlusion_browsertest_mac.mm b/content/app_shim_remote_cocoa/window_occlusion_browsertest_mac.mm
index 3bb5ce9..e53da807b 100644
--- a/content/app_shim_remote_cocoa/window_occlusion_browsertest_mac.mm
+++ b/content/app_shim_remote_cocoa/window_occlusion_browsertest_mac.mm
@@ -4,8 +4,8 @@
#include <memory>
+#import "base/apple/foundation_util.h"
#include "base/apple/scoped_objc_class_swizzler.h"
-#import "base/mac/foundation_util.h"
#import "base/mac/mac_util.h"
#import "base/task/single_thread_task_runner.h"
#include "base/test/scoped_feature_list.h"
@@ -94,7 +94,7 @@
- (void)updateWebContentsVisibility:
(remote_cocoa::mojom::Visibility)windowVisibility {
WebContentsHostWindowForOcclusionTesting* hostWindow =
- base::mac::ObjCCast<WebContentsHostWindowForOcclusionTesting>(
+ base::apple::ObjCCast<WebContentsHostWindowForOcclusionTesting>(
[self window]);
EXPECT_FALSE([hostWindow modifyingChildWindowList]);
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
index f0c23b72..d7a5973 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -14,8 +14,8 @@
#include <memory>
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 2a00c12..7fb1b1d 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -239,7 +239,7 @@
#endif
#if defined(ENABLE_IPC_FUZZER) && BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
#if BUILDFLAG(MOJO_RANDOM_DELAYS_ENABLED)
@@ -331,7 +331,7 @@
return false;
#if BUILDFLAG(IS_MAC)
- if (base::mac::AmIBundled()) {
+ if (base::apple::AmIBundled()) {
// The bundled app executables (Chromium, TestShell, etc) live three
// levels down from the build directory, eg:
// Chromium.app/Contents/MacOS/Chromium
diff --git a/content/browser/child_process_host_impl.cc b/content/browser/child_process_host_impl.cc
index cb673c2..d476c13 100644
--- a/content/browser/child_process_host_impl.cc
+++ b/content/browser/child_process_host_impl.cc
@@ -41,7 +41,7 @@
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include "base/linux_util.h"
#elif BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "content/browser/mac_helpers.h"
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
@@ -87,7 +87,7 @@
#if BUILDFLAG(IS_MAC)
std::string child_base_name = child_path.BaseName().value();
- if (flags != CHILD_NORMAL && base::mac::AmIBundled()) {
+ if (flags != CHILD_NORMAL && base::apple::AmIBundled()) {
// This is a specialized helper, with the |child_path| at
// ../Framework.framework/Versions/X/Helpers/Chromium Helper.app/Contents/
// MacOS/Chromium Helper. Go back up to the "Helpers" directory to select
diff --git a/content/browser/child_process_task_port_provider_mac.cc b/content/browser/child_process_task_port_provider_mac.cc
index 73b2aaa..654cff2 100644
--- a/content/browser/child_process_task_port_provider_mac.cc
+++ b/content/browser/child_process_task_port_provider_mac.cc
@@ -4,12 +4,12 @@
#include "content/browser/child_process_task_port_provider_mac.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/mach_logging.h"
#include "base/containers/cxx20_erase.h"
#include "base/debug/crash_logging.h"
#include "base/functional/bind.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/no_destructor.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
@@ -57,7 +57,7 @@
CHECK(base::apple::CreateMachPort(¬ification_port_, nullptr));
const std::string dispatch_name = base::StringPrintf(
- "%s.ChildProcessTaskPortProvider.%p", base::mac::BaseBundleID(), this);
+ "%s.ChildProcessTaskPortProvider.%p", base::apple::BaseBundleID(), this);
notification_source_ = std::make_unique<base::DispatchSourceMach>(
dispatch_name.c_str(), notification_port_.get(), ^{
OnTaskPortDied();
diff --git a/content/browser/cocoa/system_hotkey_helper_mac.mm b/content/browser/cocoa/system_hotkey_helper_mac.mm
index 57a3824..3386581 100644
--- a/content/browser/cocoa/system_hotkey_helper_mac.mm
+++ b/content/browser/cocoa/system_hotkey_helper_mac.mm
@@ -4,8 +4,8 @@
#include "content/browser/cocoa/system_hotkey_helper_mac.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "content/browser/cocoa/system_hotkey_map.h"
@@ -16,8 +16,8 @@
"Preferences/com.apple.symbolichotkeys.plist";
content::SystemHotkeyMap LoadSystemHotkeyMap() {
- auto* hotkey_plist_url = base::mac::FilePathToNSURL(
- base::mac::GetUserLibraryPath().Append(kSystemHotkeyPlistPath));
+ auto* hotkey_plist_url = base::apple::FilePathToNSURL(
+ base::apple::GetUserLibraryPath().Append(kSystemHotkeyPlistPath));
NSDictionary* dictionary =
[NSDictionary dictionaryWithContentsOfURL:hotkey_plist_url error:nil];
diff --git a/content/browser/cocoa/system_hotkey_map.mm b/content/browser/cocoa/system_hotkey_map.mm
index 4dc799f1..66860bb 100644
--- a/content/browser/cocoa/system_hotkey_map.mm
+++ b/content/browser/cocoa/system_hotkey_map.mm
@@ -6,7 +6,7 @@
#import <Carbon/Carbon.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#pragma mark - NSDictionary Helper Functions
diff --git a/content/browser/cocoa/system_hotkey_map_unittest.mm b/content/browser/cocoa/system_hotkey_map_unittest.mm
index e176721..b0faf5e 100644
--- a/content/browser/cocoa/system_hotkey_map_unittest.mm
+++ b/content/browser/cocoa/system_hotkey_map_unittest.mm
@@ -5,8 +5,8 @@
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
+#import "base/apple/foundation_util.h"
#include "base/files/file_path.h"
-#import "base/mac/foundation_util.h"
#include "base/path_service.h"
#import "content/browser/cocoa/system_hotkey_map.h"
#include "content/public/common/content_paths.h"
@@ -26,7 +26,7 @@
base::FilePath test_path = test_data_dir.AppendASCII(file);
return [NSDictionary
- dictionaryWithContentsOfURL:base::mac::FilePathToNSURL(test_path)
+ dictionaryWithContentsOfURL:base::apple::FilePathToNSURL(test_path)
error:nil];
}
diff --git a/content/browser/font_access/font_enumeration_data_source_mac.h b/content/browser/font_access/font_enumeration_data_source_mac.h
index 83a934e..e97b6c2 100644
--- a/content/browser/font_access/font_enumeration_data_source_mac.h
+++ b/content/browser/font_access/font_enumeration_data_source_mac.h
@@ -7,7 +7,7 @@
#include <string>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/sequence_checker.h"
#include "content/browser/font_access/font_enumeration_data_source.h"
#include "third_party/blink/public/common/font_access/font_enumeration_table.pb.h"
diff --git a/content/browser/font_access/font_enumeration_data_source_mac.mm b/content/browser/font_access/font_enumeration_data_source_mac.mm
index 8162b5a1..a1c766d 100644
--- a/content/browser/font_access/font_enumeration_data_source_mac.mm
+++ b/content/browser/font_access/font_enumeration_data_source_mac.mm
@@ -23,13 +23,13 @@
base::ScopedCFTypeRef<CFStringRef> GetLocalizedString(CTFontDescriptorRef fd,
CFStringRef attribute) {
return base::ScopedCFTypeRef<CFStringRef>(
- base::mac::CFCast<CFStringRef>(CTFontDescriptorCopyLocalizedAttribute(
+ base::apple::CFCast<CFStringRef>(CTFontDescriptorCopyLocalizedAttribute(
fd, attribute, /*language=*/nullptr)));
}
base::ScopedCFTypeRef<CFStringRef> GetString(CTFontDescriptorRef fd,
CFStringRef attribute) {
- return base::ScopedCFTypeRef<CFStringRef>(base::mac::CFCast<CFStringRef>(
+ return base::ScopedCFTypeRef<CFStringRef>(base::apple::CFCast<CFStringRef>(
CTFontDescriptorCopyAttribute(fd, attribute)));
}
@@ -88,7 +88,7 @@
std::set<std::string> fonts_seen;
for (CFIndex i = 0; i < CFArrayGetCount(font_descs); ++i) {
- CTFontDescriptorRef fd = base::mac::CFCast<CTFontDescriptorRef>(
+ CTFontDescriptorRef fd = base::apple::CFCast<CTFontDescriptorRef>(
CFArrayGetValueAtIndex(font_descs, i));
if (!IsValidFontMac(fd)) {
// Skip invalid fonts.
diff --git a/content/browser/media/capture/screen_capture_kit_device_mac.mm b/content/browser/media/capture/screen_capture_kit_device_mac.mm
index 2c2c43c..814eab6 100644
--- a/content/browser/media/capture/screen_capture_kit_device_mac.mm
+++ b/content/browser/media/capture/screen_capture_kit_device_mac.mm
@@ -7,7 +7,7 @@
#import <ScreenCaptureKit/ScreenCaptureKit.h>
#include "base/apple/bridging.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/task/bind_post_task.h"
#import "base/task/single_thread_task_runner.h"
#include "base/threading/thread_checker.h"
@@ -63,16 +63,16 @@
CFArrayRef attachmentsArray = CMSampleBufferGetSampleAttachmentsArray(
sampleBuffer, /*createIfNecessary=*/false);
if (attachmentsArray && CFArrayGetCount(attachmentsArray) > 0) {
- CFDictionaryRef attachment = base::mac::CFCast<CFDictionaryRef>(
+ CFDictionaryRef attachment = base::apple::CFCast<CFDictionaryRef>(
CFArrayGetValueAtIndex(attachmentsArray, 0));
if (attachment) {
- CFDictionaryRef contentRectValue = base::mac::CFCast<CFDictionaryRef>(
+ CFDictionaryRef contentRectValue = base::apple::CFCast<CFDictionaryRef>(
CFDictionaryGetValue(attachment, base::apple::NSToCFPtrCast(
SCStreamFrameInfoContentRect)));
- CFNumberRef scaleFactorValue = base::mac::CFCast<CFNumberRef>(
+ CFNumberRef scaleFactorValue = base::apple::CFCast<CFNumberRef>(
CFDictionaryGetValue(attachment, base::apple::NSToCFPtrCast(
SCStreamFrameInfoScaleFactor)));
- CFNumberRef contentScaleValue = base::mac::CFCast<CFNumberRef>(
+ CFNumberRef contentScaleValue = base::apple::CFCast<CFNumberRef>(
CFDictionaryGetValue(attachment, base::apple::NSToCFPtrCast(
SCStreamFrameInfoContentScale)));
diff --git a/content/browser/renderer_host/popup_menu_helper_mac.mm b/content/browser/renderer_host/popup_menu_helper_mac.mm
index c4ee62e..006fb2a9 100644
--- a/content/browser/renderer_host/popup_menu_helper_mac.mm
+++ b/content/browser/renderer_host/popup_menu_helper_mac.mm
@@ -96,7 +96,7 @@
// Check if the underlying native window is headless and if so, return early
// to avoid showing the popup menu.
NativeWidgetMacNSWindow* ns_window =
- base::mac::ObjCCastStrict<NativeWidgetMacNSWindow>([cocoa_view window]);
+ base::apple::ObjCCastStrict<NativeWidgetMacNSWindow>([cocoa_view window]);
if (ns_window && [ns_window isHeadless]) {
return;
}
diff --git a/content/browser/sandbox_mac_unittest.mm b/content/browser/sandbox_mac_unittest.mm
index a13e888..2aa7d31be 100644
--- a/content/browser/sandbox_mac_unittest.mm
+++ b/content/browser/sandbox_mac_unittest.mm
@@ -7,13 +7,13 @@
#include <fcntl.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/ref_counted.h"
@@ -229,7 +229,7 @@
MULTIPROCESS_TEST_MAIN(NetworkProcessPrefs) {
CheckCreateSeatbeltServer();
- const std::string kBundleId = base::mac::BaseBundleID();
+ const std::string kBundleId = base::apple::BaseBundleID();
const std::string kUserName = base::SysNSStringToUTF8(NSUserName());
const std::vector<std::string> kPaths = {
"/Library/Managed Preferences/.GlobalPreferences.plist",
diff --git a/content/browser/sandbox_parameters_mac.mm b/content/browser/sandbox_parameters_mac.mm
index 383c9cf..2a5d6ef 100644
--- a/content/browser/sandbox_parameters_mac.mm
+++ b/content/browser/sandbox_parameters_mac.mm
@@ -7,11 +7,11 @@
#include <unistd.h>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/check.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/files/file_util.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/no_destructor.h"
#include "base/numerics/checked_math.h"
@@ -108,7 +108,7 @@
sandbox::policy::GetCanonicalPath(base::apple::MainBundlePath()).value();
CHECK(compiler->SetParameter(sandbox::policy::kParamBundlePath, bundle_path));
- std::string bundle_id = base::mac::BaseBundleID();
+ std::string bundle_id = base::apple::BaseBundleID();
DCHECK(!bundle_id.empty()) << "base::apple::OuterBundle is unset";
CHECK(compiler->SetParameter(sandbox::policy::kParamBundleId, bundle_id));
@@ -212,7 +212,7 @@
sandbox::policy::switches::kDisableMetalShaderCache)));
base::FilePath helper_bundle_path =
- base::mac::GetInnermostAppBundlePath(command_line.GetProgram());
+ base::apple::GetInnermostAppBundlePath(command_line.GetProgram());
// The helper may not be contained in an app bundle for unit tests.
// In that case `kParamHelperBundleId` will remain unset.
diff --git a/content/browser/speech/tts_mac.mm b/content/browser/speech/tts_mac.mm
index af921b9..ad2148a4 100644
--- a/content/browser/speech/tts_mac.mm
+++ b/content/browser/speech/tts_mac.mm
@@ -11,8 +11,8 @@
#include <algorithm>
#include <string>
+#include "base/apple/foundation_util.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/no_destructor.h"
#include "base/strings/sys_string_conversions.h"
@@ -134,7 +134,7 @@
}
int GetUtteranceId(AVSpeechUtterance* utterance) {
- NSNumber* identifier = base::mac::ObjCCast<NSNumber>(
+ NSNumber* identifier = base::apple::ObjCCast<NSNumber>(
objc_getAssociatedObject(utterance, @selector(identifier)));
if (identifier) {
return identifier.intValue;
diff --git a/content/browser/web_contents/web_drag_source_mac_unittest.mm b/content/browser/web_contents/web_drag_source_mac_unittest.mm
index 6f484be..0700f982 100644
--- a/content/browser/web_contents/web_drag_source_mac_unittest.mm
+++ b/content/browser/web_contents/web_drag_source_mac_unittest.mm
@@ -4,7 +4,7 @@
#import "content/app_shim_remote_cocoa/web_drag_source_mac.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "content/public/common/drop_data.h"
#include "content/public/test/test_renderer_host.h"
#include "testing/gtest_mac.h"
@@ -24,7 +24,7 @@
// Test that asking for the data of an invalidly-escaped URL doesn't throw any
// exceptions. http://crbug.com/128371
id result = [source pasteboardPropertyListForType:NSPasteboardTypeURL];
- NSString* result_string = base::mac::ObjCCast<NSString>(result);
+ NSString* result_string = base::apple::ObjCCast<NSString>(result);
EXPECT_NSEQ(@"javascript:%25", result_string);
}
diff --git a/content/common/font_list_mac.mm b/content/common/font_list_mac.mm
index e65367d..7821a31a 100644
--- a/content/common/font_list_mac.mm
+++ b/content/common/font_list_mac.mm
@@ -10,9 +10,9 @@
#include <utility>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/values.h"
@@ -81,13 +81,13 @@
CFIndex descriptor_count = descriptors ? CFArrayGetCount(descriptors) : 0;
for (CFIndex i = 0; i < descriptor_count; ++i) {
CTFontDescriptorRef descriptor =
- base::mac::CFCastStrict<CTFontDescriptorRef>(
+ base::apple::CFCastStrict<CTFontDescriptorRef>(
CFArrayGetValueAtIndex(descriptors, i));
DCHECK(descriptor != nullptr)
<< "The descriptors array has a null element.";
base::ScopedCFTypeRef<CFStringRef> descriptor_family_name(
- base::mac::CFCastStrict<CFStringRef>(CTFontDescriptorCopyAttribute(
+ base::apple::CFCastStrict<CFStringRef>(CTFontDescriptorCopyAttribute(
descriptor, kCTFontFamilyNameAttribute)));
if (CFStringCompare(family_name, descriptor_family_name,
/*compareOptions=*/0) == kCFCompareEqualTo) {
@@ -124,7 +124,7 @@
}
base::ScopedCFTypeRef<CFStringRef> localized_family_name(
- base::mac::CFCastStrict<CFStringRef>(
+ base::apple::CFCastStrict<CFStringRef>(
CTFontDescriptorCopyLocalizedAttribute(descriptor,
kCTFontFamilyNameAttribute,
/*language=*/nullptr)));
diff --git a/content/common/mac/attributed_string_type_converters.mm b/content/common/mac/attributed_string_type_converters.mm
index 24f3e056..59b3fb03 100644
--- a/content/common/mac/attributed_string_type_converters.mm
+++ b/content/common/mac/attributed_string_type_converters.mm
@@ -7,8 +7,8 @@
#include <AppKit/AppKit.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/check.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/common/common_param_traits.h"
diff --git a/content/common/mac/attributed_string_type_converters_unittest.mm b/content/common/mac/attributed_string_type_converters_unittest.mm
index 0d4cd37..c739890d 100644
--- a/content/common/mac/attributed_string_type_converters_unittest.mm
+++ b/content/common/mac/attributed_string_type_converters_unittest.mm
@@ -9,7 +9,7 @@
#include <memory>
#include "base/apple/bridging.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/content/public/test/content_browser_test.cc b/content/public/test/content_browser_test.cc
index 057bf2e..c1e125e 100644
--- a/content/public/test/content_browser_test.cc
+++ b/content/public/test/content_browser_test.cc
@@ -27,7 +27,7 @@
#include "ui/events/platform/platform_event_source.h"
#if BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
@@ -52,7 +52,7 @@
// uses this same function to change the ContentBrowserClient.
ContentClient::SetCanChangeContentBrowserClientForTesting(false);
#if BUILDFLAG(IS_MAC)
- base::mac::SetOverrideAmIBundled(true);
+ base::apple::SetOverrideAmIBundled(true);
// See comment in InProcessBrowserTest::InProcessBrowserTest().
base::FilePath content_shell_path;
diff --git a/content/shell/app/paths_mac.mm b/content/shell/app/paths_mac.mm
index 635995c1..6943e51b 100644
--- a/content/shell/app/paths_mac.mm
+++ b/content/shell/app/paths_mac.mm
@@ -5,8 +5,8 @@
#include "content/shell/app/paths_mac.h"
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/base_paths.h"
-#include "base/mac/foundation_util.h"
#include "base/path_service.h"
#include "content/public/common/content_paths.h"
@@ -18,7 +18,7 @@
base::PathService::Get(base::FILE_EXE, &path);
// Up to Contents.
- if (base::mac::IsBackgroundOnlyProcess()) {
+ if (base::apple::IsBackgroundOnlyProcess()) {
// The running executable is the helper, located at:
// Content Shell.app/Contents/Frameworks/
// Content Shell Framework.framework/Versions/C/Helpers/Content Shell
diff --git a/content/shell/app/shell_main_delegate_mac.h b/content/shell/app/shell_main_delegate_mac.h
index e292a31..6909436 100644
--- a/content/shell/app/shell_main_delegate_mac.h
+++ b/content/shell/app/shell_main_delegate_mac.h
@@ -11,7 +11,7 @@
// the expected pixel results on retina capable displays.
void EnsureCorrectResolutionSettings();
-// Sets up base::mac::BaseBundleID.
+// Sets up base::apple::BaseBundleID.
void OverrideBundleID();
// Initializes NSApplication.
diff --git a/content/shell/app/shell_main_delegate_mac.mm b/content/shell/app/shell_main_delegate_mac.mm
index 9820c9f..9a86a8f 100644
--- a/content/shell/app/shell_main_delegate_mac.mm
+++ b/content/shell/app/shell_main_delegate_mac.mm
@@ -7,10 +7,10 @@
#include <unistd.h>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/check.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "content/public/common/content_switches.h"
#include "content/shell/app/paths_mac.h"
@@ -29,7 +29,7 @@
NSString* const kHighResolutionCapable = @"NSHighResolutionCapable";
base::FilePath info_plist = GetInfoPlistPath();
NSMutableDictionary* info_dict = [[NSMutableDictionary alloc]
- initWithContentsOfFile:base::mac::FilePathToNSString(info_plist)];
+ initWithContentsOfFile:base::apple::FilePathToNSString(info_plist)];
bool running_web_tests = switches::IsRunWebTestsSwitchPresent();
NSNumber* high_resolution_capable_from_info_dict =
@@ -43,7 +43,7 @@
// We need to update our Info.plist before we can continue.
[info_dict setObject:@(!running_web_tests) forKey:kHighResolutionCapable];
- CHECK([info_dict writeToFile:base::mac::FilePathToNSString(info_plist)
+ CHECK([info_dict writeToFile:base::apple::FilePathToNSString(info_plist)
atomically:YES]);
const base::CommandLine::StringVector& original_argv =
@@ -59,7 +59,7 @@
void OverrideBundleID() {
NSBundle* bundle = base::apple::OuterBundle();
- base::mac::SetBaseBundleID(
+ base::apple::SetBaseBundleID(
base::SysNSStringToUTF8([bundle bundleIdentifier]).c_str());
}
diff --git a/content/shell/browser/shell_platform_delegate_mac.mm b/content/shell/browser/shell_platform_delegate_mac.mm
index 570163a..5b7cdb6 100644
--- a/content/shell/browser/shell_platform_delegate_mac.mm
+++ b/content/shell/browser/shell_platform_delegate_mac.mm
@@ -8,9 +8,9 @@
#include <algorithm>
+#import "base/apple/foundation_util.h"
#include "base/check_op.h"
#include "base/containers/contains.h"
-#import "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/notreached.h"
#include "base/strings/string_piece.h"
@@ -56,7 +56,7 @@
// the various global lists. By returning YES, we allow the window to be
// removed from the screen.
- (BOOL)windowShouldClose:(id)sender {
- CHECK_EQ(base::mac::ObjCCastStrict<NSWindow>(sender), _window);
+ CHECK_EQ(base::apple::ObjCCastStrict<NSWindow>(sender), _window);
// Don't leave a dangling pointer if the window lives beyond
// this method. See crbug.com/719830.
_window.delegate = nil;
diff --git a/content/test/test_blink_web_unit_test_support.cc b/content/test/test_blink_web_unit_test_support.cc
index bb82132b..6296bf3 100644
--- a/content/test/test_blink_web_unit_test_support.cc
+++ b/content/test/test_blink_web_unit_test_support.cc
@@ -43,8 +43,8 @@
#include "v8/include/v8.h"
#if BUILDFLAG(IS_APPLE)
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_nsautorelease_pool.h"
-#include "base/mac/foundation_util.h"
#endif
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
diff --git a/content/web_test/browser/web_test_browser_context.cc b/content/web_test/browser/web_test_browser_context.cc
index 48b12a49..b21e8f13 100644
--- a/content/web_test/browser/web_test_browser_context.cc
+++ b/content/web_test/browser/web_test_browser_context.cc
@@ -32,8 +32,8 @@
#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include "base/nix/xdg_util.h"
#elif BUILDFLAG(IS_MAC)
+#include "base/apple/foundation_util.h"
#include "base/base_paths_mac.h"
-#include "base/mac/foundation_util.h"
#endif
namespace content {
diff --git a/content/web_test/browser/web_test_control_host.cc b/content/web_test/browser/web_test_control_host.cc
index 23b8b1e..7e0733f 100644
--- a/content/web_test/browser/web_test_control_host.cc
+++ b/content/web_test/browser/web_test_control_host.cc
@@ -110,7 +110,7 @@
#include "url/url_constants.h"
#if BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
namespace content {
diff --git a/content/web_test/browser/web_test_shell_platform_delegate_mac.mm b/content/web_test/browser/web_test_shell_platform_delegate_mac.mm
index 029097d..f193f53 100644
--- a/content/web_test/browser/web_test_shell_platform_delegate_mac.mm
+++ b/content/web_test/browser/web_test_shell_platform_delegate_mac.mm
@@ -4,8 +4,8 @@
#include "content/web_test/browser/web_test_shell_platform_delegate.h"
+#import "base/apple/foundation_util.h"
#include "base/containers/contains.h"
-#import "base/mac/foundation_util.h"
#include "content/browser/renderer_host/render_widget_host_view_mac.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_widget_host.h"
diff --git a/content/web_test/renderer/blink_test_helpers.cc b/content/web_test/renderer/blink_test_helpers.cc
index 3a1f8301..f43b616 100644
--- a/content/web_test/renderer/blink_test_helpers.cc
+++ b/content/web_test/renderer/blink_test_helpers.cc
@@ -20,7 +20,7 @@
#if BUILDFLAG(IS_MAC)
#include "base/apple/bundle_locations.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
using blink::WebURL;
@@ -110,7 +110,7 @@
static base::FilePath GetBuildDirectory() {
#if BUILDFLAG(IS_MAC)
- if (base::mac::AmIBundled()) {
+ if (base::apple::AmIBundled()) {
// If this is a bundled Content Shell.app, go up one from the outer bundle
// directory.
return base::apple::OuterBundlePath().DirName();
diff --git a/crypto/apple_keychain_ios.mm b/crypto/apple_keychain_ios.mm
index 87324c1a..8925cca 100644
--- a/crypto/apple_keychain_ios.mm
+++ b/crypto/apple_keychain_ios.mm
@@ -7,8 +7,8 @@
#import <Foundation/Foundation.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
namespace {
@@ -166,7 +166,7 @@
}
if (passwordData) {
- CFDataRef data = base::mac::CFCast<CFDataRef>(result);
+ CFDataRef data = base::apple::CFCast<CFDataRef>(result);
NSUInteger length = CFDataGetLength(data);
*passwordData = malloc(length * sizeof(UInt8));
CFDataGetBytes(data, CFRangeMake(0, length), (UInt8*)*passwordData);
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index 4b1d57ef..75343e1f 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -13,11 +13,11 @@
#include <string>
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_ioobject.h"
#include "base/memory/ptr_util.h"
@@ -152,7 +152,7 @@
}
base::ScopedCFTypeRef<CFBooleanRef> connected(
- base::mac::CFCast<CFBooleanRef>(IORegistryEntryCreateCFProperty(
+ base::apple::CFCast<CFBooleanRef>(IORegistryEntryCreateCFProperty(
service, CFSTR("BluetoothTransportConnected"), kCFAllocatorDefault,
0)));
return CFBooleanGetValue(connected);
diff --git a/device/bluetooth/bluetooth_low_energy_adapter_apple.mm b/device/bluetooth/bluetooth_low_energy_adapter_apple.mm
index 728875ee..746f25b6 100644
--- a/device/bluetooth/bluetooth_low_energy_adapter_apple.mm
+++ b/device/bluetooth/bluetooth_low_energy_adapter_apple.mm
@@ -12,11 +12,11 @@
#include <string>
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_ioobject.h"
#include "base/memory/ptr_util.h"
diff --git a/device/bluetooth/bluetooth_remote_gatt_descriptor_mac.mm b/device/bluetooth/bluetooth_remote_gatt_descriptor_mac.mm
index 1726acd4..04ce2c3 100644
--- a/device/bluetooth/bluetooth_remote_gatt_descriptor_mac.mm
+++ b/device/bluetooth/bluetooth_remote_gatt_descriptor_mac.mm
@@ -4,15 +4,15 @@
#include "device/bluetooth/bluetooth_remote_gatt_descriptor_mac.h"
+#import "base/apple/foundation_util.h"
#include "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#import "base/task/single_thread_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "device/bluetooth/bluetooth_low_energy_adapter_apple.h"
#import "device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h"
-using base::mac::ObjCCast;
+using base::apple::ObjCCast;
namespace device {
diff --git a/device/bluetooth/test/bluetooth_test_mac.mm b/device/bluetooth/test/bluetooth_test_mac.mm
index da228af..ca6af8a 100644
--- a/device/bluetooth/test/bluetooth_test_mac.mm
+++ b/device/bluetooth/test/bluetooth_test_mac.mm
@@ -9,8 +9,8 @@
#include <memory>
+#import "base/apple/foundation_util.h"
#include "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/sys_string_conversions.h"
#include "build/build_config.h"
@@ -33,7 +33,7 @@
#import "device/bluetooth/bluetooth_adapter_mac.h"
#endif
-using base::mac::ObjCCast;
+using base::apple::ObjCCast;
namespace device {
@@ -663,7 +663,7 @@
return;
auto* mock_central_manager =
- base::mac::ObjCCastStrict<MockCentralManager>(
+ base::apple::ObjCCastStrict<MockCentralManager>(
adapter_mac->GetCentralManager());
[mock_central_manager setState:powered ? CBManagerStatePoweredOn
: CBManagerStatePoweredOff];
diff --git a/device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm b/device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm
index 25d1480..61f101a 100644
--- a/device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm
+++ b/device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm
@@ -4,11 +4,11 @@
#include "device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "device/bluetooth/bluetooth_gatt_characteristic.h"
#include "device/bluetooth/test/mock_bluetooth_cbdescriptor_mac.h"
-using base::mac::ObjCCast;
+using base::apple::ObjCCast;
namespace device {
diff --git a/device/bluetooth/test/mock_bluetooth_cbdescriptor_mac.mm b/device/bluetooth/test/mock_bluetooth_cbdescriptor_mac.mm
index 3733e7c..0d10367 100644
--- a/device/bluetooth/test/mock_bluetooth_cbdescriptor_mac.mm
+++ b/device/bluetooth/test/mock_bluetooth_cbdescriptor_mac.mm
@@ -4,10 +4,10 @@
#include "device/bluetooth/test/mock_bluetooth_cbdescriptor_mac.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "device/bluetooth/bluetooth_gatt_characteristic.h"
-using base::mac::ObjCCast;
+using base::apple::ObjCCast;
@interface MockCBDescriptor () {
// Owner of this instance.
diff --git a/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm b/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
index 771b13b..a31334ea 100644
--- a/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
+++ b/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
@@ -4,13 +4,13 @@
#include "device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "device/bluetooth/test/bluetooth_test_mac.h"
#include "device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.h"
#include "device/bluetooth/test/mock_bluetooth_cbdescriptor_mac.h"
#include "device/bluetooth/test/mock_bluetooth_cbservice_mac.h"
-using base::mac::ObjCCast;
+using base::apple::ObjCCast;
@implementation MockCBPeripheral {
NSUUID* __strong _identifier;
diff --git a/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm b/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
index 7cdae17e..b140b36 100644
--- a/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
+++ b/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
@@ -4,11 +4,11 @@
#include "device/bluetooth/test/mock_bluetooth_cbservice_mac.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "device/bluetooth/test/bluetooth_test.h"
#include "device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.h"
-using base::mac::ObjCCast;
+using base::apple::ObjCCast;
@interface MockCBService () {
// Owner of this instance.
diff --git a/device/bluetooth/test/mock_bluetooth_central_manager_mac.mm b/device/bluetooth/test/mock_bluetooth_central_manager_mac.mm
index e219195d..792b3b5 100644
--- a/device/bluetooth/test/mock_bluetooth_central_manager_mac.mm
+++ b/device/bluetooth/test/mock_bluetooth_central_manager_mac.mm
@@ -4,7 +4,7 @@
#import "device/bluetooth/test/mock_bluetooth_central_manager_mac.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "device/bluetooth/test/bluetooth_test_mac.h"
#import "device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h"
@@ -68,7 +68,7 @@
// When cancelPeripheralConnection is called macOS marks the device as
// disconnected.
MockCBPeripheral* mock_peripheral =
- base::mac::ObjCCastStrict<MockCBPeripheral>(peripheral);
+ base::apple::ObjCCastStrict<MockCBPeripheral>(peripheral);
[mock_peripheral setState:CBPeripheralStateDisconnected];
}
diff --git a/device/fido/mac/browsing_data_deletion_unittest.mm b/device/fido/mac/browsing_data_deletion_unittest.mm
index d42823f..b51bf42 100644
--- a/device/fido/mac/browsing_data_deletion_unittest.mm
+++ b/device/fido/mac/browsing_data_deletion_unittest.mm
@@ -8,9 +8,9 @@
#include <Foundation/Foundation.h>
#include <Security/Security.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/test/task_environment.h"
#include "device/base/features.h"
diff --git a/device/fido/mac/credential_store.h b/device/fido/mac/credential_store.h
index 4a4aca77..808c052 100644
--- a/device/fido/mac/credential_store.h
+++ b/device/fido/mac/credential_store.h
@@ -12,9 +12,9 @@
#include <utility>
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/component_export.h"
#include "base/functional/callback.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "device/fido/mac/authenticator_config.h"
#include "device/fido/mac/credential_metadata.h"
diff --git a/device/fido/mac/credential_store.mm b/device/fido/mac/credential_store.mm
index a5bab6c..ff635a6 100644
--- a/device/fido/mac/credential_store.mm
+++ b/device/fido/mac/credential_store.mm
@@ -10,13 +10,13 @@
#import <Security/Security.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/containers/contains.h"
#include "base/containers/cxx20_erase.h"
#include "base/feature_list.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/sys_string_conversions.h"
#include "components/device_event_log/device_event_log.h"
@@ -66,8 +66,8 @@
// If the creation date is missing for some obscure reason, treat as if
// the date is inside the interval, i.e. keep it in the list.
CFDateRef creation_date_cf =
- base::mac::GetValueFromDictionary<CFDateRef>(attributes,
- kSecAttrCreationDate);
+ base::apple::GetValueFromDictionary<CFDateRef>(
+ attributes, kSecAttrCreationDate);
if (!creation_date_cf) {
return false;
}
@@ -115,7 +115,7 @@
}
for (CFIndex i = 0; i < CFArrayGetCount(keychain_items); ++i) {
- CFDictionaryRef attributes = base::mac::CFCast<CFDictionaryRef>(
+ CFDictionaryRef attributes = base::apple::CFCast<CFDictionaryRef>(
CFArrayGetValueAtIndex(keychain_items, i));
if (!attributes) {
DLOG(ERROR) << "unexpected result type";
@@ -125,8 +125,8 @@
// Skip items that don't belong to the correct keychain access group
// because the kSecAttrAccessGroup filter is broken.
CFStringRef attr_access_group =
- base::mac::GetValueFromDictionary<CFStringRef>(attributes,
- kSecAttrAccessGroup);
+ base::apple::GetValueFromDictionary<CFStringRef>(attributes,
+ kSecAttrAccessGroup);
if (!attr_access_group || base::SysCFStringRefToUTF8(attr_access_group) !=
keychain_access_group) {
DVLOG(1) << "missing/invalid access group";
@@ -136,8 +136,9 @@
// If the RP ID, stored encrypted in the item's label, cannot be decrypted
// with the given metadata secret, then the credential belongs to a
// different profile and must be ignored.
- CFStringRef sec_attr_label = base::mac::GetValueFromDictionary<CFStringRef>(
- attributes, kSecAttrLabel);
+ CFStringRef sec_attr_label =
+ base::apple::GetValueFromDictionary<CFStringRef>(attributes,
+ kSecAttrLabel);
if (!sec_attr_label) {
DLOG(ERROR) << "missing label";
continue;
@@ -455,8 +456,9 @@
for (const base::ScopedCFTypeRef<CFDictionaryRef>& attributes :
*keychain_items) {
// kSecAttrApplicationLabel stores the credential ID.
- CFDataRef credential_id_data = base::mac::GetValueFromDictionary<CFDataRef>(
- attributes.get(), kSecAttrApplicationLabel);
+ CFDataRef credential_id_data =
+ base::apple::GetValueFromDictionary<CFDataRef>(
+ attributes.get(), kSecAttrApplicationLabel);
if (!credential_id_data) {
DLOG(ERROR) << "missing application label";
continue;
@@ -534,7 +536,7 @@
// empty in which case all credentials should be returned.
std::list<Credential> credentials;
for (CFIndex i = 0; i < CFArrayGetCount(keychain_items); ++i) {
- CFDictionaryRef attributes = base::mac::CFCast<CFDictionaryRef>(
+ CFDictionaryRef attributes = base::apple::CFCast<CFDictionaryRef>(
CFArrayGetValueAtIndex(keychain_items, i));
if (!attributes) {
FIDO_LOG(ERROR) << "credential with missing attributes";
@@ -543,16 +545,16 @@
// Skip items that don't belong to the correct keychain access group
// because the kSecAttrAccessGroup filter is broken.
CFStringRef attr_access_group =
- base::mac::GetValueFromDictionary<CFStringRef>(attributes,
- kSecAttrAccessGroup);
+ base::apple::GetValueFromDictionary<CFStringRef>(attributes,
+ kSecAttrAccessGroup);
if (!attr_access_group) {
continue;
}
std::string rp_id_value;
if (!rp_id) {
CFStringRef sec_attr_label =
- base::mac::GetValueFromDictionary<CFStringRef>(attributes,
- kSecAttrLabel);
+ base::apple::GetValueFromDictionary<CFStringRef>(attributes,
+ kSecAttrLabel);
if (!sec_attr_label) {
FIDO_LOG(ERROR) << "credential with missing kSecAttrLabel_data";
continue;
@@ -567,8 +569,9 @@
} else {
rp_id_value = *rp_id;
}
- CFDataRef application_label = base::mac::GetValueFromDictionary<CFDataRef>(
- attributes, kSecAttrApplicationLabel);
+ CFDataRef application_label =
+ base::apple::GetValueFromDictionary<CFDataRef>(
+ attributes, kSecAttrApplicationLabel);
if (!application_label) {
FIDO_LOG(ERROR) << "credential with missing application label";
return absl::nullopt;
@@ -585,8 +588,8 @@
// for V3 credentials, or from the credential ID for version <= 2.
absl::optional<CredentialMetadata> metadata;
CFDataRef application_tag_ref =
- base::mac::GetValueFromDictionary<CFDataRef>(attributes,
- kSecAttrApplicationTag);
+ base::apple::GetValueFromDictionary<CFDataRef>(attributes,
+ kSecAttrApplicationTag);
// On version < 3 credentials, kSecAttrApplicationTag is a CFStringRef,
// which means `application_tag_ref` would be nullptr.
if (application_tag_ref) {
@@ -605,8 +608,8 @@
return absl::nullopt;
}
- SecKeyRef key =
- base::mac::GetValueFromDictionary<SecKeyRef>(attributes, kSecValueRef);
+ SecKeyRef key = base::apple::GetValueFromDictionary<SecKeyRef>(
+ attributes, kSecValueRef);
if (!key) {
FIDO_LOG(ERROR) << "credential with missing value ref";
return absl::nullopt;
diff --git a/device/fido/mac/credential_store_unittest.mm b/device/fido/mac/credential_store_unittest.mm
index d366642..101c192 100644
--- a/device/fido/mac/credential_store_unittest.mm
+++ b/device/fido/mac/credential_store_unittest.mm
@@ -5,7 +5,7 @@
#include <Foundation/Foundation.h>
#include <Security/Security.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "device/fido/mac/authenticator_config.h"
#include "device/fido/mac/credential_store.h"
#include "device/fido/mac/fake_keychain.h"
diff --git a/device/fido/mac/fake_keychain.mm b/device/fido/mac/fake_keychain.mm
index 59908e2..44ce82b95 100644
--- a/device/fido/mac/fake_keychain.mm
+++ b/device/fido/mac/fake_keychain.mm
@@ -13,9 +13,9 @@
#include <sanitizer/lsan_interface.h>
#endif
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/check_op.h"
-#include "base/mac/foundation_util.h"
#include "device/fido/mac/credential_store.h"
#include "device/fido/mac/keychain.h"
@@ -36,20 +36,21 @@
CFDictionaryRef params,
CFErrorRef* error) {
// Validate certain fields that we always expect to be set.
- DCHECK(base::mac::GetValueFromDictionary<CFStringRef>(params, kSecAttrLabel));
- DCHECK(base::mac::GetValueFromDictionary<CFDataRef>(
+ DCHECK(
+ base::apple::GetValueFromDictionary<CFStringRef>(params, kSecAttrLabel));
+ DCHECK(base::apple::GetValueFromDictionary<CFDataRef>(
params, kSecAttrApplicationLabel));
// kSecAttrApplicationTag is CFDataRef for new credentials and CFStringRef for
// version < 3. Keychain docs say it should be CFDataRef
// (https://developer.apple.com/documentation/security/ksecattrapplicationtag).
- DCHECK(base::mac::GetValueFromDictionary<CFDataRef>(params,
- kSecAttrApplicationTag) ||
- base::mac::GetValueFromDictionary<CFStringRef>(
+ DCHECK(base::apple::GetValueFromDictionary<CFDataRef>(
+ params, kSecAttrApplicationTag) ||
+ base::apple::GetValueFromDictionary<CFStringRef>(
params, kSecAttrApplicationTag));
DCHECK_EQ(
- base::mac::GetValueFromDictionary<CFStringRef>(params, kSecAttrTokenID),
+ base::apple::GetValueFromDictionary<CFStringRef>(params, kSecAttrTokenID),
kSecAttrTokenIDSecureEnclave);
- DCHECK(CFEqual(base::mac::GetValueFromDictionary<CFStringRef>(
+ DCHECK(CFEqual(base::apple::GetValueFromDictionary<CFStringRef>(
params, kSecAttrAccessGroup),
keychain_access_group_));
@@ -66,9 +67,9 @@
base::ScopedCFTypeRef<CFMutableDictionaryRef> private_key_params(
CFDictionaryCreateMutableCopy(
kCFAllocatorDefault, /*capacity=*/0,
- base::mac::GetValueFromDictionary<CFDictionaryRef>(
+ base::apple::GetValueFromDictionary<CFDictionaryRef>(
params_copy, kSecPrivateKeyAttrs)));
- DCHECK(CFEqual(base::mac::GetValueFromDictionary<CFBooleanRef>(
+ DCHECK(CFEqual(base::apple::GetValueFromDictionary<CFBooleanRef>(
private_key_params, kSecAttrIsPermanent),
kCFBooleanTrue));
CFDictionarySetValue(private_key_params, kSecAttrIsPermanent,
@@ -100,13 +101,13 @@
// In practice we don't need to care about limit queries, or leaving out the
// SecKeyRef or attributes from the result set.
DCHECK_EQ(
- base::mac::GetValueFromDictionary<CFBooleanRef>(query, kSecReturnRef),
+ base::apple::GetValueFromDictionary<CFBooleanRef>(query, kSecReturnRef),
kCFBooleanTrue);
- DCHECK_EQ(base::mac::GetValueFromDictionary<CFBooleanRef>(
+ DCHECK_EQ(base::apple::GetValueFromDictionary<CFBooleanRef>(
query, kSecReturnAttributes),
kCFBooleanTrue);
DCHECK_EQ(
- base::mac::GetValueFromDictionary<CFStringRef>(query, kSecMatchLimit),
+ base::apple::GetValueFromDictionary<CFStringRef>(query, kSecMatchLimit),
kSecMatchLimitAll);
// Filter the items based on `query`.
@@ -116,27 +117,28 @@
// Each `Keychain` instance is expected to operate only on items of a single
// keychain-access-group, which is tied to the `Profile`.
CFStringRef keychain_access_group =
- base::mac::GetValueFromDictionary<CFStringRef>(query,
- kSecAttrAccessGroup);
+ base::apple::GetValueFromDictionary<CFStringRef>(query,
+ kSecAttrAccessGroup);
DCHECK(CFEqual(keychain_access_group,
- base::mac::GetValueFromDictionary<CFStringRef>(
+ base::apple::GetValueFromDictionary<CFStringRef>(
item, kSecAttrAccessGroup)) &&
CFEqual(keychain_access_group, keychain_access_group_));
// Match fields present in `query`.
CFStringRef label =
- base::mac::GetValueFromDictionary<CFStringRef>(query, kSecAttrLabel);
- CFDataRef application_label = base::mac::GetValueFromDictionary<CFDataRef>(
- query, kSecAttrApplicationLabel);
+ base::apple::GetValueFromDictionary<CFStringRef>(query, kSecAttrLabel);
+ CFDataRef application_label =
+ base::apple::GetValueFromDictionary<CFDataRef>(
+ query, kSecAttrApplicationLabel);
// kSecAttrApplicationTag can be CFStringRef for legacy credentials and
// CFDataRef for new ones. We currently don't need to query for either.
DCHECK(!CFDictionaryGetValue(query, kSecAttrApplicationTag));
if ((label &&
- !CFEqual(label, base::mac::GetValueFromDictionary<CFStringRef>(
+ !CFEqual(label, base::apple::GetValueFromDictionary<CFStringRef>(
item, kSecAttrLabel))) ||
(application_label &&
!CFEqual(application_label,
- base::mac::GetValueFromDictionary<CFStringRef>(
+ base::apple::GetValueFromDictionary<CFStringRef>(
item, kSecAttrApplicationLabel)))) {
continue;
}
@@ -153,20 +155,22 @@
OSStatus FakeKeychain::ItemDelete(CFDictionaryRef query) {
// Validate certain fields that we always expect to be set.
- DCHECK_EQ(base::mac::GetValueFromDictionary<CFStringRef>(query, kSecClass),
+ DCHECK_EQ(base::apple::GetValueFromDictionary<CFStringRef>(query, kSecClass),
kSecClassKey);
- DCHECK(CFEqual(base::mac::GetValueFromDictionary<CFStringRef>(
+ DCHECK(CFEqual(base::apple::GetValueFromDictionary<CFStringRef>(
query, kSecAttrAccessGroup),
keychain_access_group_));
// Only supporting deletion via `kSecAttrApplicationLabel` (credential ID) for
// now (see `TouchIdCredentialStore::DeleteCredentialById()`).
- CFDataRef query_credential_id = base::mac::GetValueFromDictionary<CFDataRef>(
- query, kSecAttrApplicationLabel);
+ CFDataRef query_credential_id =
+ base::apple::GetValueFromDictionary<CFDataRef>(query,
+ kSecAttrApplicationLabel);
DCHECK(query_credential_id);
for (auto it = items_.begin(); it != items_.end(); ++it) {
const base::ScopedCFTypeRef<CFDictionaryRef>& item = *it;
- CFDataRef item_credential_id = base::mac::GetValueFromDictionary<CFDataRef>(
- item, kSecAttrApplicationLabel);
+ CFDataRef item_credential_id =
+ base::apple::GetValueFromDictionary<CFDataRef>(
+ item, kSecAttrApplicationLabel);
DCHECK(item_credential_id);
if (CFEqual(query_credential_id, item_credential_id)) {
items_.erase(it); // N.B. `it` becomes invalid
@@ -179,18 +183,20 @@
OSStatus FakeKeychain::ItemUpdate(
CFDictionaryRef query,
base::ScopedCFTypeRef<CFMutableDictionaryRef> attributes_to_update) {
- DCHECK_EQ(base::mac::GetValueFromDictionary<CFStringRef>(query, kSecClass),
+ DCHECK_EQ(base::apple::GetValueFromDictionary<CFStringRef>(query, kSecClass),
kSecClassKey);
- DCHECK(CFEqual(base::mac::GetValueFromDictionary<CFStringRef>(
+ DCHECK(CFEqual(base::apple::GetValueFromDictionary<CFStringRef>(
query, kSecAttrAccessGroup),
keychain_access_group_));
- CFDataRef query_credential_id = base::mac::GetValueFromDictionary<CFDataRef>(
- query, kSecAttrApplicationLabel);
+ CFDataRef query_credential_id =
+ base::apple::GetValueFromDictionary<CFDataRef>(query,
+ kSecAttrApplicationLabel);
DCHECK(query_credential_id);
for (auto it = items_.begin(); it != items_.end(); ++it) {
const base::ScopedCFTypeRef<CFDictionaryRef>& item = *it;
- CFDataRef item_credential_id = base::mac::GetValueFromDictionary<CFDataRef>(
- item, kSecAttrApplicationLabel);
+ CFDataRef item_credential_id =
+ base::apple::GetValueFromDictionary<CFDataRef>(
+ item, kSecAttrApplicationLabel);
DCHECK(item_credential_id);
if (!CFEqual(query_credential_id, item_credential_id)) {
continue;
diff --git a/device/fido/mac/get_assertion_operation.mm b/device/fido/mac/get_assertion_operation.mm
index 1645c53..86eecb5 100644
--- a/device/fido/mac/get_assertion_operation.mm
+++ b/device/fido/mac/get_assertion_operation.mm
@@ -9,10 +9,10 @@
#import <Foundation/Foundation.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "components/device_event_log/device_event_log.h"
diff --git a/device/fido/mac/keychain.mm b/device/fido/mac/keychain.mm
index 5b131e9..c522b5b 100644
--- a/device/fido/mac/keychain.mm
+++ b/device/fido/mac/keychain.mm
@@ -6,8 +6,8 @@
#import <Foundation/Foundation.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/no_destructor.h"
namespace device::fido::mac {
diff --git a/device/fido/mac/make_credential_operation.mm b/device/fido/mac/make_credential_operation.mm
index f6d5202b..a939e69 100644
--- a/device/fido/mac/make_credential_operation.mm
+++ b/device/fido/mac/make_credential_operation.mm
@@ -8,11 +8,11 @@
#import <Foundation/Foundation.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "components/device_event_log/device_event_log.h"
diff --git a/device/fido/mac/touch_id_context.mm b/device/fido/mac/touch_id_context.mm
index 3dd6853..7b7ad8a5 100644
--- a/device/fido/mac/touch_id_context.mm
+++ b/device/fido/mac/touch_id_context.mm
@@ -9,10 +9,10 @@
#include <Security/Security.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/functional/bind.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/ptr_util.h"
#include "base/strings/sys_string_conversions.h"
#import "base/task/sequenced_task_runner.h"
@@ -47,7 +47,7 @@
}
NSArray* entitlement_value_nsarray = base::apple::CFToNSPtrCast(
- base::mac::CFCast<CFArrayRef>(entitlement_value_cftype));
+ base::apple::CFCast<CFArrayRef>(entitlement_value_cftype));
if (!entitlement_value_nsarray) {
return false;
}
diff --git a/device/fido/mac/util.mm b/device/fido/mac/util.mm
index 340bdebd..72696a6 100644
--- a/device/fido/mac/util.mm
+++ b/device/fido/mac/util.mm
@@ -10,10 +10,10 @@
#import <Foundation/Foundation.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "build/branding_buildflags.h"
diff --git a/device/gamepad/gamepad_device_mac.mm b/device/gamepad/gamepad_device_mac.mm
index 3fbb1d6..47599af 100644
--- a/device/gamepad/gamepad_device_mac.mm
+++ b/device/gamepad/gamepad_device_mac.mm
@@ -8,8 +8,8 @@
#import <Foundation/Foundation.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "device/gamepad/dualshock4_controller.h"
#include "device/gamepad/gamepad_data_fetcher.h"
@@ -75,7 +75,7 @@
}
GamepadBusType QueryBusType(IOHIDDeviceRef device) {
- CFStringRef transport_cf = base::mac::CFCast<CFStringRef>(
+ CFStringRef transport_cf = base::apple::CFCast<CFStringRef>(
IOHIDDeviceGetProperty(device, CFSTR(kIOHIDTransportKey)));
if (transport_cf) {
std::string transport = base::SysCFStringRefToUTF8(transport_cf);
diff --git a/device/gamepad/gamepad_platform_data_fetcher_mac.mm b/device/gamepad/gamepad_platform_data_fetcher_mac.mm
index 358e290..a03d82b 100644
--- a/device/gamepad/gamepad_platform_data_fetcher_mac.mm
+++ b/device/gamepad/gamepad_platform_data_fetcher_mac.mm
@@ -8,7 +8,7 @@
#include <string.h>
#include "base/apple/bridging.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#import "base/task/sequenced_task_runner.h"
#include "base/task/sequenced_task_runner.h"
@@ -139,8 +139,8 @@
}
void GamepadPlatformDataFetcherMac::DeviceAdd(IOHIDDeviceRef device) {
+ using base::apple::CFCastStrict;
using base::apple::CFToNSPtrCast;
- using base::mac::CFCastStrict;
if (!enabled_) {
return;
diff --git a/device/gamepad/xbox_controller_mac.mm b/device/gamepad/xbox_controller_mac.mm
index 5517314..8c9ba894 100644
--- a/device/gamepad/xbox_controller_mac.mm
+++ b/device/gamepad/xbox_controller_mac.mm
@@ -15,12 +15,12 @@
#include <cmath>
#include <limits>
+#include "base/apple/foundation_util.h"
#include "base/check_op.h"
#include "base/containers/fixed_flat_set.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/scoped_ioobject.h"
#include "base/task/sequenced_task_runner.h"
#include "device/gamepad/gamepad_uma.h"
diff --git a/device/gamepad/xbox_data_fetcher_mac.cc b/device/gamepad/xbox_data_fetcher_mac.cc
index bd2dc0d..c2862ce 100644
--- a/device/gamepad/xbox_data_fetcher_mac.cc
+++ b/device/gamepad/xbox_data_fetcher_mac.cc
@@ -15,9 +15,9 @@
#include <limits>
#include <string>
+#include "base/apple/foundation_util.h"
#include "base/containers/fixed_flat_set.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "device/gamepad/gamepad_id_list.h"
@@ -132,7 +132,7 @@
while ((ref = IOIteratorNext(iterator))) {
base::mac::ScopedIOObject<io_service_t> scoped_ref(ref);
base::ScopedCFTypeRef<CFNumberRef> number(
- base::mac::CFCastStrict<CFNumberRef>(IORegistryEntryCreateCFProperty(
+ base::apple::CFCastStrict<CFNumberRef>(IORegistryEntryCreateCFProperty(
ref, CFSTR(kUSBDevicePropertyLocationID), kCFAllocatorDefault,
kNilOptions)));
UInt32 location_id = 0;
diff --git a/docs/ios/style.md b/docs/ios/style.md
index e9899189..e16bb8f 100644
--- a/docs/ios/style.md
+++ b/docs/ios/style.md
@@ -9,7 +9,7 @@
As the C++ style guide tells you, we never use C casts and prefer
`static_cast<T>` and `dynamic_cast<T>`. However, for Objective-C casts we have
-two specific casts: `base::mac::ObjCCast<T>arg` is similar to `dynamic_cast<T>`,
+two specific casts: `base::apple::ObjCCast<T>arg` is similar to `dynamic_cast<T>`,
and `ObjcCCastStrict` `DCHECKs` against that class.
## Blocks
diff --git a/extensions/browser/api/file_system/file_system_api.cc b/extensions/browser/api/file_system/file_system_api.cc
index c437a2e..6d90167 100644
--- a/extensions/browser/api/file_system/file_system_api.cc
+++ b/extensions/browser/api/file_system/file_system_api.cc
@@ -64,7 +64,7 @@
#if BUILDFLAG(IS_MAC)
#include <CoreFoundation/CoreFoundation.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/extensions/browser/path_util.cc b/extensions/browser/path_util.cc
index d0837a4..c1efc3bf 100644
--- a/extensions/browser/path_util.cc
+++ b/extensions/browser/path_util.cc
@@ -15,8 +15,8 @@
#if BUILDFLAG(IS_MAC)
#include <CoreFoundation/CoreFoundation.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#endif
namespace extensions {
diff --git a/extensions/shell/browser/shell_native_app_window_mac.mm b/extensions/shell/browser/shell_native_app_window_mac.mm
index 08e3f2c..80d3b22 100644
--- a/extensions/shell/browser/shell_native_app_window_mac.mm
+++ b/extensions/shell/browser/shell_native_app_window_mac.mm
@@ -6,7 +6,7 @@
#import <Cocoa/Cocoa.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index bc3ee7c4..3cdcb02e 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -48,7 +48,7 @@
#if BUILDFLAG(IS_ANDROID)
#include "base/android/apk_assets.h"
#elif BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
#endif // V8_USE_EXTERNAL_STARTUP_DATA
@@ -125,7 +125,7 @@
*path_out =
base::FilePath(FILE_PATH_LITERAL("assets")).AppendASCII(file_name);
#elif BUILDFLAG(IS_MAC)
- *path_out = base::mac::PathForFrameworkBundleResource(file_name);
+ *path_out = base::apple::PathForFrameworkBundleResource(file_name);
#else
base::FilePath data_path;
bool r = base::PathService::Get(base::DIR_ASSETS, &data_path);
diff --git a/google_apis/google_api_keys_mac.mm b/google_apis/google_api_keys_mac.mm
index 5dfccd3..7dff7ba 100644
--- a/google_apis/google_api_keys_mac.mm
+++ b/google_apis/google_api_keys_mac.mm
@@ -7,14 +7,14 @@
#import <Foundation/Foundation.h>
#include "base/apple/bundle_locations.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
namespace google_apis {
std::string GetAPIKeyFromInfoPlist(const std::string& key_name) {
NSString* keyName = base::SysUTF8ToNSString(key_name);
- NSString* keyValue = base::mac::ObjCCast<NSString>(
+ NSString* keyValue = base::apple::ObjCCast<NSString>(
[base::apple::FrameworkBundle() objectForInfoDictionaryKey:keyName]);
return base::SysNSStringToUTF8(keyValue);
}
diff --git a/gpu/command_buffer/service/dawn_instance.cc b/gpu/command_buffer/service/dawn_instance.cc
index 5bf20031..a4264ae 100644
--- a/gpu/command_buffer/service/dawn_instance.cc
+++ b/gpu/command_buffer/service/dawn_instance.cc
@@ -14,7 +14,7 @@
#if BUILDFLAG(IS_MAC)
#include "base/apple/bundle_locations.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
namespace gpu::webgpu {
@@ -26,7 +26,7 @@
std::string dawn_search_path;
base::FilePath module_path;
#if BUILDFLAG(IS_MAC)
- if (base::mac::AmIBundled()) {
+ if (base::apple::AmIBundled()) {
dawn_search_path = base::apple::FrameworkBundlePath()
.Append("Libraries")
.AsEndingWithSeparator()
diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc
index 98d2814..fd2de73 100644
--- a/gpu/config/gpu_info_collector.cc
+++ b/gpu/config/gpu_info_collector.cc
@@ -44,7 +44,7 @@
#if BUILDFLAG(IS_MAC)
#include "base/apple/bundle_locations.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#endif
#if BUILDFLAG(IS_OZONE)
@@ -750,7 +750,7 @@
std::string dawn_search_path;
base::FilePath module_path;
#if BUILDFLAG(IS_MAC)
- if (base::mac::AmIBundled()) {
+ if (base::apple::AmIBundled()) {
dawn_search_path = base::apple::FrameworkBundlePath()
.Append("Libraries")
.AsEndingWithSeparator()
diff --git a/gpu/ipc/service/built_in_shader_cache_loader.cc b/gpu/ipc/service/built_in_shader_cache_loader.cc
index b0b87703..4147bbe 100644
--- a/gpu/ipc/service/built_in_shader_cache_loader.cc
+++ b/gpu/ipc/service/built_in_shader_cache_loader.cc
@@ -4,9 +4,9 @@
#include "gpu/ipc/service/built_in_shader_cache_loader.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/task/thread_pool.h"
#include "base/time/time.h"
@@ -59,9 +59,9 @@
private:
static base::FilePath AdjustPath(const base::FilePath& path) {
- return path.empty()
- ? base::mac::PathForFrameworkBundleResource(kShaderCacheFileName)
- : path;
+ return path.empty() ? base::apple::PathForFrameworkBundleResource(
+ kShaderCacheFileName)
+ : path;
}
bool ReadBytes(uint32_t size, char* data) {
diff --git a/headless/lib/browser/policy/headless_browser_policy_connector.cc b/headless/lib/browser/policy/headless_browser_policy_connector.cc
index bb8f775..bd71d46 100644
--- a/headless/lib/browser/policy/headless_browser_policy_connector.cc
+++ b/headless/lib/browser/policy/headless_browser_policy_connector.cc
@@ -27,7 +27,7 @@
#include "components/policy/core/common/policy_loader_win.h"
#elif BUILDFLAG(IS_MAC)
#include <CoreFoundation/CoreFoundation.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "components/policy/core/common/policy_loader_mac.h"
#include "components/policy/core/common/preferences_mac.h"
@@ -141,7 +141,7 @@
CFStringRef bundle_id = CFSTR("com.google.Chrome");
#else
base::ScopedCFTypeRef<CFStringRef> bundle_id(
- base::SysUTF8ToCFStringRef(base::mac::BaseBundleID()));
+ base::SysUTF8ToCFStringRef(base::apple::BaseBundleID()));
#endif
auto loader = std::make_unique<PolicyLoaderMac>(
base::ThreadPool::CreateSequencedTaskRunner(
diff --git a/ios/chrome/app/application_delegate/app_state.mm b/ios/chrome/app/application_delegate/app_state.mm
index bd554f1..50efc85 100644
--- a/ios/chrome/app/application_delegate/app_state.mm
+++ b/ios/chrome/app/application_delegate/app_state.mm
@@ -6,12 +6,12 @@
#import <utility>
+#import "base/apple/foundation_util.h"
#import "base/critical_closure.h"
#import "base/functional/bind.h"
#import "base/functional/callback.h"
#import "base/ios/crb_protocol_observers.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/notreached.h"
@@ -506,7 +506,7 @@
}
SceneDelegate* sceneDelegate =
- base::mac::ObjCCastStrict<SceneDelegate>(scene.delegate);
+ base::apple::ObjCCastStrict<SceneDelegate>(scene.delegate);
[sceneStates addObject:sceneDelegate.sceneState];
}
return sceneStates;
@@ -635,9 +635,9 @@
- (void)sceneWillConnect:(NSNotification*)notification {
UIWindowScene* scene =
- base::mac::ObjCCastStrict<UIWindowScene>(notification.object);
+ base::apple::ObjCCastStrict<UIWindowScene>(notification.object);
SceneDelegate* sceneDelegate =
- base::mac::ObjCCastStrict<SceneDelegate>(scene.delegate);
+ base::apple::ObjCCastStrict<SceneDelegate>(scene.delegate);
// Under some iOS 15 betas, Chrome gets scene connection events for some
// system scene connections. To handle this, early return if the connecting
diff --git a/ios/chrome/app/application_delegate/app_state_unittest.mm b/ios/chrome/app/application_delegate/app_state_unittest.mm
index 0586959..b64773f 100644
--- a/ios/chrome/app/application_delegate/app_state_unittest.mm
+++ b/ios/chrome/app/application_delegate/app_state_unittest.mm
@@ -6,10 +6,10 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/ios/block_types.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/test/task_environment.h"
#import "ios/chrome/app/app_startup_parameters.h"
#import "ios/chrome/app/application_delegate/app_state+private.h"
diff --git a/ios/chrome/app/application_delegate/user_activity_handler.mm b/ios/chrome/app/application_delegate/user_activity_handler.mm
index 727903ee..3c86dcc 100644
--- a/ios/chrome/app/application_delegate/user_activity_handler.mm
+++ b/ios/chrome/app/application_delegate/user_activity_handler.mm
@@ -8,8 +8,8 @@
#import <Intents/Intents.h>
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/ios/block_types.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics_action.h"
@@ -129,7 +129,7 @@
[userActivity.activityType
isEqualToString:NSUserActivityTypeBrowsingWeb]) {
// App was launched by iOS as a result of Handoff.
- NSString* originString = base::mac::ObjCCast<NSString>(
+ NSString* originString = base::apple::ObjCCast<NSString>(
userActivity.userInfo[handoff::kOriginKey]);
handoff::Origin origin = handoff::OriginFromString(originString);
UMA_HISTOGRAM_ENUMERATION("IOS.Handoff.Origin", origin,
@@ -205,7 +205,7 @@
}
SearchInChromeIntent* intent =
- base::mac::ObjCCastStrict<SearchInChromeIntent>(
+ base::apple::ObjCCastStrict<SearchInChromeIntent>(
userActivity.interaction.intent);
if (!intent) {
@@ -233,8 +233,9 @@
base::UmaHistogramEnumeration(kAppLaunchSource,
AppLaunchSource::SIRI_SHORTCUT);
base::RecordAction(UserMetricsAction("IOSLaunchedByOpenInChromeIntent"));
- OpenInChromeIntent* intent = base::mac::ObjCCastStrict<OpenInChromeIntent>(
- userActivity.interaction.intent);
+ OpenInChromeIntent* intent =
+ base::apple::ObjCCastStrict<OpenInChromeIntent>(
+ userActivity.interaction.intent);
if (!intent.url) {
return NO;
@@ -245,7 +246,7 @@
if ([intent.url isKindOfClass:[NSURL class]]) {
// Old intent version where `url` is of type NSURL rather than an array.
GURL webpageGURL(
- net::GURLWithNSURL(base::mac::ObjCCastStrict<NSURL>(intent.url)));
+ net::GURLWithNSURL(base::apple::ObjCCastStrict<NSURL>(intent.url)));
if (!webpageGURL.is_valid())
return NO;
URLs.push_back(webpageGURL);
@@ -276,7 +277,7 @@
AppLaunchSource::SIRI_SHORTCUT);
base::RecordAction(UserMetricsAction("IOSLaunchedByOpenInIncognitoIntent"));
OpenInChromeIncognitoIntent* intent =
- base::mac::ObjCCastStrict<OpenInChromeIncognitoIntent>(
+ base::apple::ObjCCastStrict<OpenInChromeIncognitoIntent>(
userActivity.interaction.intent);
if (!intent.url || intent.url.count == 0) {
diff --git a/ios/chrome/app/application_storage_metrics.mm b/ios/chrome/app/application_storage_metrics.mm
index a6c6664..7c840656 100644
--- a/ios/chrome/app/application_storage_metrics.mm
+++ b/ios/chrome/app/application_storage_metrics.mm
@@ -6,10 +6,10 @@
#import <Foundation/Foundation.h>
+#import "base/apple/foundation_util.h"
#import "base/files/file_enumerator.h"
#import "base/files/file_path.h"
#import "base/files/file_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/task/sequenced_task_runner.h"
#import "base/task/thread_pool.h"
@@ -48,7 +48,7 @@
// Logs the "Documents" directory size. Accepts a task runner as a parameter in
// order to keep it in scope throughout the execution.
void LogDocumentsDirectorySize(scoped_refptr<base::SequencedTaskRunner>) {
- base::FilePath documents_path = base::mac::GetUserDocumentPath();
+ base::FilePath documents_path = base::apple::GetUserDocumentPath();
int total_size_bytes = CalculateTotalSize(documents_path);
UMA_HISTOGRAM_MEMORY_MEDIUM_MB("IOS.SandboxMetrics.DocumentsSize2",
total_size_bytes / 1024 / 1024);
@@ -57,7 +57,7 @@
// Logs the "Library" directory size. Accepts a task runner as a parameter in
// order to keep it in scope throughout the execution.
void LogLibraryDirectorySize(scoped_refptr<base::SequencedTaskRunner>) {
- base::FilePath library_path = base::mac::GetUserLibraryPath();
+ base::FilePath library_path = base::apple::GetUserLibraryPath();
int total_size_bytes = CalculateTotalSize(library_path);
UMA_HISTOGRAM_MEMORY_MEDIUM_MB("IOS.SandboxMetrics.LibrarySize",
total_size_bytes / 1024 / 1024);
diff --git a/ios/chrome/app/dump_documents_statistics.mm b/ios/chrome/app/dump_documents_statistics.mm
index 0f487af..22882ea 100644
--- a/ios/chrome/app/dump_documents_statistics.mm
+++ b/ios/chrome/app/dump_documents_statistics.mm
@@ -5,12 +5,12 @@
#import "ios/chrome/app/dump_documents_statistics.h"
#import "base/apple/backup_util.h"
+#import "base/apple/foundation_util.h"
#import "base/files/file.h"
#import "base/files/file_enumerator.h"
#import "base/files/file_path.h"
#import "base/files/file_util.h"
#import "base/json/json_writer.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/stringprintf.h"
#import "base/strings/sys_string_conversions.h"
#import "base/task/thread_pool.h"
@@ -103,9 +103,9 @@
// Dumps statistics in JSON format for the user's entire Document directory.
void DumpSandboxFileStatistics() {
- base::FilePath documents_path = base::mac::GetUserDocumentPath();
+ base::FilePath documents_path = base::apple::GetUserDocumentPath();
base::FilePath file_stats_directory =
- base::mac::GetUserDocumentPath().Append("sandboxFileStats");
+ base::apple::GetUserDocumentPath().Append("sandboxFileStats");
// Go up one directory from documents to include all surrounding directories.
base::FilePath root = documents_path.DirName();
diff --git a/ios/chrome/app/main_application_delegate.mm b/ios/chrome/app/main_application_delegate.mm
index 382cafb..dbb9aff 100644
--- a/ios/chrome/app/main_application_delegate.mm
+++ b/ios/chrome/app/main_application_delegate.mm
@@ -6,8 +6,8 @@
#import <UserNotifications/UserNotifications.h>
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/user_metrics.h"
#import "base/strings/sys_string_conversions.h"
@@ -286,9 +286,9 @@
- (void)sceneWillConnect:(NSNotification*)notification {
UIWindowScene* scene =
- base::mac::ObjCCastStrict<UIWindowScene>(notification.object);
+ base::apple::ObjCCastStrict<UIWindowScene>(notification.object);
SceneDelegate* sceneDelegate =
- base::mac::ObjCCastStrict<SceneDelegate>(scene.delegate);
+ base::apple::ObjCCastStrict<SceneDelegate>(scene.delegate);
// Under some iOS 15 betas, Chrome gets scene connection events for some
// system scene connections. To handle this, early return if the connecting
@@ -391,13 +391,13 @@
#pragma mark - Testing methods
+ (AppState*)sharedAppState {
- return base::mac::ObjCCast<MainApplicationDelegate>(
+ return base::apple::ObjCCast<MainApplicationDelegate>(
[[UIApplication sharedApplication] delegate])
.appState;
}
+ (MainController*)sharedMainController {
- return base::mac::ObjCCast<MainApplicationDelegate>(
+ return base::apple::ObjCCast<MainApplicationDelegate>(
[[UIApplication sharedApplication] delegate])
.mainController;
}
diff --git a/ios/chrome/app/main_controller.mm b/ios/chrome/app/main_controller.mm
index ac1c2d6..2de4f6502 100644
--- a/ios/chrome/app/main_controller.mm
+++ b/ios/chrome/app/main_controller.mm
@@ -7,10 +7,10 @@
#import <memory>
#import "base/apple/bundle_locations.h"
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
#import "base/functional/callback.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/path_service.h"
@@ -428,7 +428,7 @@
DCHECK(self.appState.initStage > InitStageSafeMode);
NSBundle* baseBundle = base::apple::OuterBundle();
- base::mac::SetBaseBundleID(
+ base::apple::SetBaseBundleID(
base::SysNSStringToUTF8([baseBundle bundleIdentifier]).c_str());
// Register default values for experimental settings (Application Preferences)
@@ -1243,7 +1243,7 @@
}
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
- NSDate* lastLogged = base::mac::ObjCCast<NSDate>(
+ NSDate* lastLogged = base::apple::ObjCCast<NSDate>(
[defaults objectForKey:kLastApplicationStorageMetricsLogTime]);
if (lastLogged && [[NSDate date] timeIntervalSinceDate:lastLogged] <
kMinimumTimeBetweenDocumentsSizeLogging) {
diff --git a/ios/chrome/app/memory_monitor.mm b/ios/chrome/app/memory_monitor.mm
index 3ecacc1..92201e9 100644
--- a/ios/chrome/app/memory_monitor.mm
+++ b/ios/chrome/app/memory_monitor.mm
@@ -7,11 +7,11 @@
#import <Foundation/NSPathUtilities.h>
#import <dispatch/dispatch.h>
+#import "base/apple/foundation_util.h"
#import "base/files/file_path.h"
#import "base/files/file_util.h"
#import "base/functional/bind.h"
#import "base/location.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/strings/sys_string_conversions.h"
diff --git a/ios/chrome/app/spotlight/actions_spotlight_manager.mm b/ios/chrome/app/spotlight/actions_spotlight_manager.mm
index 8d7d349..09d5ac56 100644
--- a/ios/chrome/app/spotlight/actions_spotlight_manager.mm
+++ b/ios/chrome/app/spotlight/actions_spotlight_manager.mm
@@ -6,7 +6,7 @@
#import <CoreSpotlight/CoreSpotlight.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/app/app_startup_parameters.h"
diff --git a/ios/chrome/app/spotlight/bookmarks_spotlight_manager.mm b/ios/chrome/app/spotlight/bookmarks_spotlight_manager.mm
index 26307723..f8d2f14 100644
--- a/ios/chrome/app/spotlight/bookmarks_spotlight_manager.mm
+++ b/ios/chrome/app/spotlight/bookmarks_spotlight_manager.mm
@@ -8,7 +8,7 @@
#import <CoreSpotlight/CoreSpotlight.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/strings/sys_string_conversions.h"
#import "base/time/time.h"
@@ -247,7 +247,7 @@
- (BOOL)shouldReindex {
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
- NSDate* date = base::mac::ObjCCast<NSDate>(
+ NSDate* date = base::apple::ObjCCast<NSDate>(
[userDefaults objectForKey:@(spotlight::kSpotlightLastIndexingDateKey)]);
if (!date) {
return YES;
@@ -257,7 +257,7 @@
if (timeSinceLastIndexing >= kDelayBetweenTwoIndexing) {
return YES;
}
- NSNumber* lastIndexedVersion = base::mac::ObjCCast<NSNumber>([userDefaults
+ NSNumber* lastIndexedVersion = base::apple::ObjCCast<NSNumber>([userDefaults
objectForKey:@(spotlight::kSpotlightLastIndexingVersionKey)]);
if (!lastIndexedVersion) {
return YES;
diff --git a/ios/chrome/app/spotlight/open_tabs_spotlight_manager.mm b/ios/chrome/app/spotlight/open_tabs_spotlight_manager.mm
index 7162b38..c70fc352 100644
--- a/ios/chrome/app/spotlight/open_tabs_spotlight_manager.mm
+++ b/ios/chrome/app/spotlight/open_tabs_spotlight_manager.mm
@@ -7,7 +7,7 @@
#import <CoreSpotlight/CoreSpotlight.h>
#import <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/strings/sys_string_conversions.h"
#import "base/timer/elapsed_timer.h"
diff --git a/ios/chrome/app/spotlight/reading_list_spotlight_manager.mm b/ios/chrome/app/spotlight/reading_list_spotlight_manager.mm
index facde23..aac9f7d 100644
--- a/ios/chrome/app/spotlight/reading_list_spotlight_manager.mm
+++ b/ios/chrome/app/spotlight/reading_list_spotlight_manager.mm
@@ -7,7 +7,7 @@
#import <CoreSpotlight/CoreSpotlight.h>
#import <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/strings/sys_string_conversions.h"
#import "base/timer/elapsed_timer.h"
diff --git a/ios/chrome/app/startup/chrome_app_startup_parameters.mm b/ios/chrome/app/startup/chrome_app_startup_parameters.mm
index cb0d8d31..b4d2c378 100644
--- a/ios/chrome/app/startup/chrome_app_startup_parameters.mm
+++ b/ios/chrome/app/startup/chrome_app_startup_parameters.mm
@@ -5,7 +5,7 @@
#import "ios/chrome/app/startup/chrome_app_startup_parameters.h"
#import "base/apple/bundle_locations.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
@@ -407,7 +407,7 @@
NSString* commandDictionaryPreference =
base::SysUTF8ToNSString(app_group::kChromeAppGroupCommandPreference);
- NSDictionary* commandDictionary = base::mac::ObjCCast<NSDictionary>(
+ NSDictionary* commandDictionary = base::apple::ObjCCast<NSDictionary>(
[sharedDefaults objectForKey:commandDictionaryPreference]);
[sharedDefaults removeObjectForKey:commandDictionaryPreference];
@@ -422,32 +422,32 @@
NSString* commandCallerPreference =
base::SysUTF8ToNSString(app_group::kChromeAppGroupCommandAppPreference);
- NSString* commandCaller = base::mac::ObjCCast<NSString>(
+ NSString* commandCaller = base::apple::ObjCCast<NSString>(
[commandDictionary objectForKey:commandCallerPreference]);
NSString* commandPreference = base::SysUTF8ToNSString(
app_group::kChromeAppGroupCommandCommandPreference);
- NSString* command = base::mac::ObjCCast<NSString>(
+ NSString* command = base::apple::ObjCCast<NSString>(
[commandDictionary objectForKey:commandPreference]);
NSString* commandTimePreference =
base::SysUTF8ToNSString(app_group::kChromeAppGroupCommandTimePreference);
- id commandTime = base::mac::ObjCCast<NSDate>(
+ id commandTime = base::apple::ObjCCast<NSDate>(
[commandDictionary objectForKey:commandTimePreference]);
NSString* commandTextPreference =
base::SysUTF8ToNSString(app_group::kChromeAppGroupCommandTextPreference);
- NSString* externalText = base::mac::ObjCCast<NSString>(
+ NSString* externalText = base::apple::ObjCCast<NSString>(
[commandDictionary objectForKey:commandTextPreference]);
NSString* commandDataPreference =
base::SysUTF8ToNSString(app_group::kChromeAppGroupCommandDataPreference);
- NSData* externalData = base::mac::ObjCCast<NSData>(
+ NSData* externalData = base::apple::ObjCCast<NSData>(
[commandDictionary objectForKey:commandDataPreference]);
NSString* commandIndexPreference =
base::SysUTF8ToNSString(app_group::kChromeAppGroupCommandIndexPreference);
- NSNumber* index = base::mac::ObjCCast<NSNumber>(
+ NSNumber* index = base::apple::ObjCCast<NSNumber>(
[commandDictionary objectForKey:commandIndexPreference]);
if (!commandCaller || !command || !commandTimePreference) {
diff --git a/ios/chrome/app/variations_app_state_agent.mm b/ios/chrome/app/variations_app_state_agent.mm
index dfa0c86..1d7340a 100644
--- a/ios/chrome/app/variations_app_state_agent.mm
+++ b/ios/chrome/app/variations_app_state_agent.mm
@@ -5,7 +5,7 @@
#import "ios/chrome/app/variations_app_state_agent.h"
#import "ios/chrome/app/variations_app_state_agent+testing.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/field_trial.h"
#import "base/metrics/histogram_functions.h"
#import "base/rand_util.h"
diff --git a/ios/chrome/browser/autofill/autofill_controller_unittest.mm b/ios/chrome/browser/autofill/autofill_controller_unittest.mm
index cf92d2fd..e4f4b954 100644
--- a/ios/chrome/browser/autofill/autofill_controller_unittest.mm
+++ b/ios/chrome/browser/autofill/autofill_controller_unittest.mm
@@ -7,8 +7,8 @@
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/memory/ptr_util.h"
#import "base/strings/utf_string_conversions.h"
#import "base/task/thread_pool/thread_pool_instance.h"
diff --git a/ios/chrome/browser/autofill/automation/automation_action.mm b/ios/chrome/browser/autofill/automation/automation_action.mm
index 6332b3a..a138b0f 100644
--- a/ios/chrome/browser/autofill/automation/automation_action.mm
+++ b/ios/chrome/browser/autofill/automation/automation_action.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/autofill/automation/automation_action.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "base/test/ios/wait_util.h"
diff --git a/ios/chrome/browser/autofill/form_input_accessory_view_handler.mm b/ios/chrome/browser/autofill/form_input_accessory_view_handler.mm
index ffa7456..5d40d0f 100644
--- a/ios/chrome/browser/autofill/form_input_accessory_view_handler.mm
+++ b/ios/chrome/browser/autofill/form_input_accessory_view_handler.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/notreached.h"
#import "base/strings/sys_string_conversions.h"
diff --git a/ios/chrome/browser/autofill/form_input_accessory_view_handler_unittest.mm b/ios/chrome/browser/autofill/form_input_accessory_view_handler_unittest.mm
index 0371920..e06f5c1 100644
--- a/ios/chrome/browser/autofill/form_input_accessory_view_handler_unittest.mm
+++ b/ios/chrome/browser/autofill/form_input_accessory_view_handler_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/autofill/form_input_accessory_view_handler.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h"
#import "ios/web/public/test/web_task_environment.h"
#import "ios/web/public/web_state.h"
diff --git a/ios/chrome/browser/autofill/form_input_egtest.mm b/ios/chrome/browser/autofill/form_input_egtest.mm
index 13a7d7e3..34234f9 100644
--- a/ios/chrome/browser/autofill/form_input_egtest.mm
+++ b/ios/chrome/browser/autofill/form_input_egtest.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "ios/chrome/grit/ios_strings.h"
diff --git a/ios/chrome/browser/autofill/form_structure_browsertest.mm b/ios/chrome/browser/autofill/form_structure_browsertest.mm
index 31f6ecf..94fe5ce 100644
--- a/ios/chrome/browser/autofill/form_structure_browsertest.mm
+++ b/ios/chrome/browser/autofill/form_structure_browsertest.mm
@@ -5,10 +5,10 @@
#import <WebKit/WebKit.h>
#import <vector>
+#import "base/apple/foundation_util.h"
#import "base/files/file_enumerator.h"
#import "base/files/file_path.h"
#import "base/files/file_util.h"
-#import "base/mac/foundation_util.h"
#import "base/memory/ptr_util.h"
#import "base/path_service.h"
#import "base/strings/string_util.h"
@@ -38,8 +38,8 @@
#import "ios/chrome/browser/infobars/infobar_manager_impl.h"
#import "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h"
#import "ios/chrome/browser/passwords/password_controller.h"
-#import "ios/chrome/browser/shared/model/paths/paths.h"
#import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h"
+#import "ios/chrome/browser/shared/model/paths/paths.h"
#import "ios/chrome/browser/sync/ios_user_event_service_factory.h"
#import "ios/chrome/browser/ui/autofill/chrome_autofill_client_ios.h"
#import "ios/chrome/browser/web/chrome_web_client.h"
diff --git a/ios/chrome/browser/autofill/form_suggestion_controller.mm b/ios/chrome/browser/autofill/form_suggestion_controller.mm
index 26a71256..9c81678 100644
--- a/ios/chrome/browser/autofill/form_suggestion_controller.mm
+++ b/ios/chrome/browser/autofill/form_suggestion_controller.mm
@@ -6,7 +6,7 @@
#import <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
diff --git a/ios/chrome/browser/autofill/form_suggestion_controller_unittest.mm b/ios/chrome/browser/autofill/form_suggestion_controller_unittest.mm
index 92a46919..3024302 100644
--- a/ios/chrome/browser/autofill/form_suggestion_controller_unittest.mm
+++ b/ios/chrome/browser/autofill/form_suggestion_controller_unittest.mm
@@ -7,7 +7,7 @@
#import <utility>
#import <vector>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/path_service.h"
#import "base/test/scoped_feature_list.h"
#import "components/autofill/core/browser/ui/popup_types.h"
diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_removal_controller.mm b/ios/chrome/browser/browser_state/chrome_browser_state_removal_controller.mm
index 893017e..8326218 100644
--- a/ios/chrome/browser/browser_state/chrome_browser_state_removal_controller.mm
+++ b/ios/chrome/browser/browser_state/chrome_browser_state_removal_controller.mm
@@ -6,20 +6,20 @@
#import <Foundation/Foundation.h>
+#import "base/apple/foundation_util.h"
#import "base/files/file_path.h"
#import "base/files/file_util.h"
#import "base/functional/bind.h"
#import "base/location.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/task/thread_pool.h"
#import "components/prefs/pref_service.h"
#import "google_apis/gaia/gaia_auth_util.h"
#import "ios/chrome/browser/browser_state/constants.h"
-#import "ios/chrome/browser/shared/model/paths/paths_internal.h"
#import "ios/chrome/browser/shared/model/application_context/application_context.h"
#import "ios/chrome/browser/shared/model/browser_state/browser_state_info_cache.h"
#import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state_manager.h"
+#import "ios/chrome/browser/shared/model/paths/paths_internal.h"
#import "ios/chrome/browser/shared/model/prefs/pref_names.h"
#import "ios/chrome/browser/signin/chrome_account_manager_service.h"
#import "ios/chrome/browser/signin/chrome_account_manager_service_factory.h"
diff --git a/ios/chrome/browser/browsing_data/sessions_storage_util.mm b/ios/chrome/browser/browsing_data/sessions_storage_util.mm
index 0130373f..b257699 100644
--- a/ios/chrome/browser/browsing_data/sessions_storage_util.mm
+++ b/ios/chrome/browser/browsing_data/sessions_storage_util.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/browsing_data/sessions_storage_util.h"
+#import "base/apple/foundation_util.h"
#import "base/files/file_path.h"
-#import "base/mac/foundation_util.h"
#import "base/path_service.h"
#import "ios/chrome/browser/shared/model/paths/paths.h"
@@ -15,7 +15,7 @@
NSString* GetDiscardedSessionsFilePath() {
base::FilePath directory_path;
base::PathService::Get(ios::DIR_USER_DATA, &directory_path);
- return base::mac::FilePathToNSString(
+ return base::apple::FilePathToNSString(
directory_path.Append(FILE_PATH_LITERAL("DiscardedSessions")));
}
diff --git a/ios/chrome/browser/browsing_data/system_snapshots_cleaner.mm b/ios/chrome/browser/browsing_data/system_snapshots_cleaner.mm
index fdec8de..888affb 100644
--- a/ios/chrome/browser/browsing_data/system_snapshots_cleaner.mm
+++ b/ios/chrome/browser/browsing_data/system_snapshots_cleaner.mm
@@ -6,10 +6,10 @@
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/files/file_util.h"
#import "base/functional/bind.h"
#import "base/location.h"
-#import "base/mac/foundation_util.h"
#import "base/path_service.h"
#import "base/strings/stringprintf.h"
#import "base/task/thread_pool.h"
@@ -47,8 +47,8 @@
base::PathService::Get(base::DIR_CACHE, &snapshots_dir);
// Snapshots are located in a path with the bundle ID used twice.
snapshots_dir = snapshots_dir.Append("Snapshots")
- .Append(base::mac::BaseBundleID())
- .Append(base::mac::BaseBundleID());
+ .Append(base::apple::BaseBundleID())
+ .Append(base::apple::BaseBundleID());
const char* retina_suffix = "";
CGFloat scale = [UIScreen mainScreen].scale;
if (scale == 2) {
diff --git a/ios/chrome/browser/browsing_data/system_snapshots_cleaner_unittest.mm b/ios/chrome/browser/browsing_data/system_snapshots_cleaner_unittest.mm
index c286163..7ab987c5 100644
--- a/ios/chrome/browser/browsing_data/system_snapshots_cleaner_unittest.mm
+++ b/ios/chrome/browser/browsing_data/system_snapshots_cleaner_unittest.mm
@@ -7,7 +7,7 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/path_service.h"
#import "base/strings/sys_string_conversions.h"
#import "testing/gtest/include/gtest/gtest.h"
@@ -44,7 +44,7 @@
if (scale > 1) {
scaleModifier = [NSString stringWithFormat:@"@%.0fx", scale];
}
- NSString* path = base::SysUTF8ToNSString(base::mac::BaseBundleID());
+ NSString* path = base::SysUTF8ToNSString(base::apple::BaseBundleID());
NSString* filename = @"UIApplicationAutomaticSnapshotDefault-LandscapeRight";
NSString* regex = [NSString
stringWithFormat:@".*/%@/%@%@.png$", path, filename, scaleModifier];
diff --git a/ios/chrome/browser/credential_provider/credential_provider_util.mm b/ios/chrome/browser/credential_provider/credential_provider_util.mm
index f1ba29f..c16aad42 100644
--- a/ios/chrome/browser/credential_provider/credential_provider_util.mm
+++ b/ios/chrome/browser/credential_provider/credential_provider_util.mm
@@ -6,7 +6,7 @@
#import <CommonCrypto/CommonDigest.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "base/task/thread_pool.h"
@@ -153,7 +153,7 @@
// Gets the last sync date for favicons in the app group storage.
base::Time GetFaviconsLastSyncDate() {
NSDate* last_sync_date =
- base::mac::ObjCCast<NSDate>([[NSUserDefaults standardUserDefaults]
+ base::apple::ObjCCast<NSDate>([[NSUserDefaults standardUserDefaults]
objectForKey:kFaviconsLastSyncDatePrefKey]);
// If no value stored in the NSUserDefaults, consider that the last sync
// happened forever ago.
diff --git a/ios/chrome/browser/default_browser/utils.mm b/ios/chrome/browser/default_browser/utils.mm
index b55dde6f..8004559 100644
--- a/ios/chrome/browser/default_browser/utils.mm
+++ b/ios/chrome/browser/default_browser/utils.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/default_browser/utils.h"
+#import "base/apple/foundation_util.h"
#import "base/command_line.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/field_trial_params.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/user_metrics.h"
@@ -204,7 +204,7 @@
}
DCHECK(storage);
- return base::mac::ObjCCast<T>(storage[key]);
+ return base::apple::ObjCCast<T>(storage[key]);
}
// Helper function to update storage with `dict`. If a key in `dict` maps
@@ -264,7 +264,7 @@
const base::Time now = base::Time::Now();
for (NSObject* object : dates) {
- NSDate* date = base::mac::ObjCCast<NSDate>(object);
+ NSDate* date = base::apple::ObjCCast<NSDate>(object);
if (!date) {
continue;
}
@@ -292,7 +292,7 @@
const base::Time now = base::Time::Now();
for (NSObject* object : dates) {
- NSDate* date = base::mac::ObjCCast<NSDate>(object);
+ NSDate* date = base::apple::ObjCCast<NSDate>(object);
if (!date) {
continue;
}
diff --git a/ios/chrome/browser/download/ar_quick_look_tab_helper.mm b/ios/chrome/browser/download/ar_quick_look_tab_helper.mm
index 70c0730..320809c 100644
--- a/ios/chrome/browser/download/ar_quick_look_tab_helper.mm
+++ b/ios/chrome/browser/download/ar_quick_look_tab_helper.mm
@@ -7,10 +7,10 @@
#import <memory>
#import <string>
+#import "base/apple/foundation_util.h"
#import "base/files/file_path.h"
#import "base/files/file_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/strings/escape.h"
#import "base/task/thread_pool.h"
@@ -196,7 +196,7 @@
}
NSURL* file_url =
- base::mac::FilePathToNSURL(download_task_->GetResponsePath());
+ base::apple::FilePathToNSURL(download_task_->GetResponsePath());
[delegate_ presentUSDZFileWithURL:file_url
canonicalURL:canonical_url
webState:web_state_
diff --git a/ios/chrome/browser/download/download_directory_util.mm b/ios/chrome/browser/download/download_directory_util.mm
index ae639518..d480803 100644
--- a/ios/chrome/browser/download/download_directory_util.mm
+++ b/ios/chrome/browser/download/download_directory_util.mm
@@ -4,11 +4,11 @@
#import "ios/chrome/browser/download/download_directory_util.h"
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
#import "base/files/file_path.h"
#import "base/files/file_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "base/task/task_traits.h"
#import "base/task/thread_pool.h"
#import "ios/web/common/features.h"
@@ -34,7 +34,7 @@
void GetDownloadsDirectory(base::FilePath* directory_path) {
*directory_path =
- base::mac::NSStringToFilePath([NSSearchPathForDirectoriesInDomains(
+ base::apple::NSStringToFilePath([NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory, NSAllDomainsMask, YES) firstObject]);
}
diff --git a/ios/chrome/browser/drag_and_drop/table_view_url_drag_drop_handler.mm b/ios/chrome/browser/drag_and_drop/table_view_url_drag_drop_handler.mm
index 525558b..75cd4fe 100644
--- a/ios/chrome/browser/drag_and_drop/table_view_url_drag_drop_handler.mm
+++ b/ios/chrome/browser/drag_and_drop/table_view_url_drag_drop_handler.mm
@@ -6,8 +6,8 @@
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/drag_and_drop/drag_item_util.h"
#import "net/base/mac/url_conversions.h"
#import "url/gurl.h"
@@ -40,7 +40,7 @@
dragSessionWillBegin:(id<UIDragSession>)session {
DCHECK_EQ(1U, session.items.count);
UIDragItem* item = session.items.firstObject;
- URLInfo* info = base::mac::ObjCCastStrict<URLInfo>(item.localObject);
+ URLInfo* info = base::apple::ObjCCastStrict<URLInfo>(item.localObject);
session.items.firstObject.previewProvider = ^{
return [UIDragPreview previewForURL:net::NSURLWithGURL(info.URL)
title:info.title];
diff --git a/ios/chrome/browser/drag_and_drop/url_drag_drop_handler.mm b/ios/chrome/browser/drag_and_drop/url_drag_drop_handler.mm
index 3ddaead..37cd981 100644
--- a/ios/chrome/browser/drag_and_drop/url_drag_drop_handler.mm
+++ b/ios/chrome/browser/drag_and_drop/url_drag_drop_handler.mm
@@ -6,8 +6,8 @@
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/drag_and_drop/drag_item_util.h"
#import "net/base/mac/url_conversions.h"
#import "url/gurl.h"
@@ -62,7 +62,7 @@
sessionWillBegin:(id<UIDragSession>)session {
DCHECK_EQ(1U, session.items.count);
UIDragItem* item = session.items.firstObject;
- URLInfo* info = base::mac::ObjCCastStrict<URLInfo>(item.localObject);
+ URLInfo* info = base::apple::ObjCCastStrict<URLInfo>(item.localObject);
session.items.firstObject.previewProvider = ^{
return [UIDragPreview previewForURL:net::NSURLWithGURL(info.URL)
title:info.title];
diff --git a/ios/chrome/browser/favicon/favicon_loader.mm b/ios/chrome/browser/favicon/favicon_loader.mm
index a055c30..7728f24 100644
--- a/ios/chrome/browser/favicon/favicon_loader.mm
+++ b/ios/chrome/browser/favicon/favicon_loader.mm
@@ -6,8 +6,8 @@
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/favicon/core/fallback_url_util.h"
#import "components/favicon/core/large_icon_service.h"
diff --git a/ios/chrome/browser/find_in_page/java_script_find_in_page_controller.mm b/ios/chrome/browser/find_in_page/java_script_find_in_page_controller.mm
index 172967e..e024b736 100644
--- a/ios/chrome/browser/find_in_page/java_script_find_in_page_controller.mm
+++ b/ios/chrome/browser/find_in_page/java_script_find_in_page_controller.mm
@@ -9,8 +9,8 @@
#import <cmath>
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "components/ukm/ios/ukm_url_recorder.h"
#import "ios/chrome/browser/find_in_page/constants.h"
diff --git a/ios/chrome/browser/find_in_page/java_script_find_in_page_controller_unittest.mm b/ios/chrome/browser/find_in_page/java_script_find_in_page_controller_unittest.mm
index 6b05b9c..c2570d70 100644
--- a/ios/chrome/browser/find_in_page/java_script_find_in_page_controller_unittest.mm
+++ b/ios/chrome/browser/find_in_page/java_script_find_in_page_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/find_in_page/java_script_find_in_page_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/ios/wait_util.h"
#import "components/ukm/ios/ukm_url_recorder.h"
#import "components/ukm/test_ukm_recorder.h"
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm
index cc47812..29435cc 100644
--- a/ios/chrome/browser/flags/about_flags.mm
+++ b/ios/chrome/browser/flags/about_flags.mm
@@ -11,12 +11,12 @@
#import <stddef.h>
#import <stdint.h>
+#import "base/apple/foundation_util.h"
#import "base/base_switches.h"
#import "base/check_op.h"
#import "base/debug/debugging_buildflags.h"
#import "base/functional/bind.h"
#import "base/functional/callback_helpers.h"
-#import "base/mac/foundation_util.h"
#import "base/no_destructor.h"
#import "base/strings/stringprintf.h"
#import "base/strings/sys_string_conversions.h"
diff --git a/ios/chrome/browser/metrics/ios_feed_activity_metrics_provider.mm b/ios/chrome/browser/metrics/ios_feed_activity_metrics_provider.mm
index 5daddbf..9dcef7f 100644
--- a/ios/chrome/browser/metrics/ios_feed_activity_metrics_provider.mm
+++ b/ios/chrome/browser/metrics/ios_feed_activity_metrics_provider.mm
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#import "ios/chrome/browser/metrics/ios_feed_activity_metrics_provider.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_functions.h"
IOSFeedActivityMetricsProvider::IOSFeedActivityMetricsProvider() {}
diff --git a/ios/chrome/browser/metrics/window_configuration_recorder.mm b/ios/chrome/browser/metrics/window_configuration_recorder.mm
index 2446dba..6daeff4 100644
--- a/ios/chrome/browser/metrics/window_configuration_recorder.mm
+++ b/ios/chrome/browser/metrics/window_configuration_recorder.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/metrics/window_configuration_recorder.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/timer/timer.h"
@@ -36,7 +36,7 @@
if (scene.activationState != UISceneActivationStateForegroundActive)
continue;
- UIWindowScene* windowScene = base::mac::ObjCCast<UIWindowScene>(scene);
+ UIWindowScene* windowScene = base::apple::ObjCCast<UIWindowScene>(scene);
for (UIWindow* window in windowScene.windows) {
// Skip other windows (like keyboard) that keep showing up.
if (![window isKindOfClass:NSClassFromString(@"ChromeOverlayWindow")])
diff --git a/ios/chrome/browser/passwords/password_controller.mm b/ios/chrome/browser/passwords/password_controller.mm
index 4b6f30b..7311d35 100644
--- a/ios/chrome/browser/passwords/password_controller.mm
+++ b/ios/chrome/browser/passwords/password_controller.mm
@@ -13,8 +13,8 @@
#import <utility>
#import <vector>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
diff --git a/ios/chrome/browser/policy/browser_dm_token_storage_ios.mm b/ios/chrome/browser/policy/browser_dm_token_storage_ios.mm
index 87e7ac1..bdd7eb0 100644
--- a/ios/chrome/browser/policy/browser_dm_token_storage_ios.mm
+++ b/ios/chrome/browser/policy/browser_dm_token_storage_ios.mm
@@ -7,12 +7,12 @@
#import <Foundation/Foundation.h>
#import "base/apple/backup_util.h"
+#import "base/apple/foundation_util.h"
#import "base/base64url.h"
#import "base/files/file_util.h"
#import "base/files/important_file_writer.h"
#import "base/hash/sha1.h"
#import "base/ios/device_util.h"
-#import "base/mac/foundation_util.h"
#import "base/path_service.h"
#import "base/strings/string_util.h"
#import "base/strings/sys_string_conversions.h"
@@ -90,7 +90,7 @@
NSDictionary* raw_policies = [[NSUserDefaults standardUserDefaults]
dictionaryForKey:kPolicyLoaderIOSConfigurationKey];
NSString* token =
- base::mac::ObjCCast<NSString>(raw_policies[base::SysUTF8ToNSString(
+ base::apple::ObjCCast<NSString>(raw_policies[base::SysUTF8ToNSString(
key::kCloudManagementEnrollmentToken)]);
if (token) {
diff --git a/ios/chrome/browser/policy/policy_watcher_browser_agent.mm b/ios/chrome/browser/policy/policy_watcher_browser_agent.mm
index cc04793..c0bde32e 100644
--- a/ios/chrome/browser/policy/policy_watcher_browser_agent.mm
+++ b/ios/chrome/browser/policy/policy_watcher_browser_agent.mm
@@ -7,7 +7,7 @@
#import <Foundation/Foundation.h>
#import "base/apple/backup_util.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/path_service.h"
#import "base/run_loop.h"
@@ -159,7 +159,7 @@
// TODO(crbug.com/1303652): If multiple profiles are supported on iOS, update
// this logic to work with multiple profiles having possibly-possibly
// conflicting preference values.
- base::FilePath storage_dir = base::mac::GetUserLibraryPath();
+ base::FilePath storage_dir = base::apple::GetUserLibraryPath();
if (backup_allowed) {
base::ThreadPool::PostTask(
FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
diff --git a/ios/chrome/browser/policy/policy_watcher_browser_agent_unittest.mm b/ios/chrome/browser/policy/policy_watcher_browser_agent_unittest.mm
index e647007..6f6b8d61 100644
--- a/ios/chrome/browser/policy/policy_watcher_browser_agent_unittest.mm
+++ b/ios/chrome/browser/policy/policy_watcher_browser_agent_unittest.mm
@@ -5,7 +5,7 @@
#import "ios/chrome/browser/policy/policy_watcher_browser_agent.h"
#import "base/apple/backup_util.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/path_service.h"
#import "base/test/ios/wait_util.h"
#import "build/build_config.h"
@@ -461,7 +461,7 @@
TEST_F(PolicyWatcherBrowserAgentTest, BackupPreventionChanged) {
id mockHandler = OCMProtocolMock(@protocol(PolicyChangeCommands));
agent_->Initialize(mockHandler);
- base::FilePath storage_dir = base::mac::GetUserLibraryPath();
+ base::FilePath storage_dir = base::apple::GetUserLibraryPath();
// Ensure that backups are allowed initially.
ASSERT_TRUE(base::apple::ClearBackupExclusion(storage_dir));
@@ -482,7 +482,7 @@
// Tests that disabling the backup-allowed preference marks the app container
// as excluded from backup at startup.
TEST_F(PolicyWatcherBrowserAgentTest, BackupDisallowedAtColdStart) {
- base::FilePath storage_dir = base::mac::GetUserLibraryPath();
+ base::FilePath storage_dir = base::apple::GetUserLibraryPath();
// Ensure that backups are allowed initially.
ASSERT_TRUE(base::apple::ClearBackupExclusion(storage_dir));
@@ -500,7 +500,7 @@
// Tests that enabling the backup-allowed preference marks the app container
// as no longer excluded from backup at startup.
TEST_F(PolicyWatcherBrowserAgentTest, BackupAllowedAtColdStart) {
- base::FilePath storage_dir = base::mac::GetUserLibraryPath();
+ base::FilePath storage_dir = base::apple::GetUserLibraryPath();
// Ensure that backups are disallowed initially.
ASSERT_TRUE(base::apple::SetBackupExclusion(storage_dir));
diff --git a/ios/chrome/browser/policy/reporting/browser_report_generator_ios.mm b/ios/chrome/browser/policy/reporting/browser_report_generator_ios.mm
index b06ed5b..ebbf56a 100644
--- a/ios/chrome/browser/policy/reporting/browser_report_generator_ios.mm
+++ b/ios/chrome/browser/policy/reporting/browser_report_generator_ios.mm
@@ -5,7 +5,7 @@
#import "ios/chrome/browser/policy/reporting/browser_report_generator_ios.h"
#import "base/apple/bundle_locations.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/policy/proto/device_management_backend.pb.h"
#import "ios/chrome/browser/shared/model/application_context/application_context.h"
diff --git a/ios/chrome/browser/providers/keyboard/chromium_keyboard.mm b/ios/chrome/browser/providers/keyboard/chromium_keyboard.mm
index 213722c..138f12c2 100644
--- a/ios/chrome/browser/providers/keyboard/chromium_keyboard.mm
+++ b/ios/chrome/browser/providers/keyboard/chromium_keyboard.mm
@@ -4,7 +4,7 @@
#import "ios/public/provider/chrome/browser/keyboard/keyboard_api.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
namespace ios {
namespace provider {
@@ -13,7 +13,7 @@
UIWindow* lastWindow = nil;
for (UIScene* scene in UIApplication.sharedApplication.connectedScenes) {
UIWindowScene* windowScene =
- base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ base::apple::ObjCCastStrict<UIWindowScene>(scene);
UIWindow* window = [windowScene.windows lastObject];
if (window) {
lastWindow = window;
diff --git a/ios/chrome/browser/reading_list/reading_list_distiller_page.mm b/ios/chrome/browser/reading_list/reading_list_distiller_page.mm
index 8cadfe1..25c8818 100644
--- a/ios/chrome/browser/reading_list/reading_list_distiller_page.mm
+++ b/ios/chrome/browser/reading_list/reading_list_distiller_page.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/reading_list/reading_list_distiller_page.h"
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/string_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
diff --git a/ios/chrome/browser/safe_mode/safe_mode_crashing_modules_config.mm b/ios/chrome/browser/safe_mode/safe_mode_crashing_modules_config.mm
index d1bf2ceb..438ff202 100644
--- a/ios/chrome/browser/safe_mode/safe_mode_crashing_modules_config.mm
+++ b/ios/chrome/browser/safe_mode/safe_mode_crashing_modules_config.mm
@@ -5,7 +5,7 @@
#import "ios/chrome/browser/safe_mode/safe_mode_crashing_modules_config.h"
#import "base/apple/bundle_locations.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
namespace {
@@ -36,11 +36,11 @@
}
- (NSString*)startupCrashModuleFriendlyName:(NSString*)modulePath {
- NSDictionary* modules = base::mac::ObjCCastStrict<NSDictionary>(
+ NSDictionary* modules = base::apple::ObjCCastStrict<NSDictionary>(
[_configuration objectForKey:kStartupCrashModulesKey]);
NSDictionary* module =
- base::mac::ObjCCastStrict<NSDictionary>(modules[modulePath]);
- return base::mac::ObjCCast<NSString>(module[kModuleFriendlyNameKey]);
+ base::apple::ObjCCastStrict<NSDictionary>(modules[modulePath]);
+ return base::apple::ObjCCast<NSString>(module[kModuleFriendlyNameKey]);
}
@end
diff --git a/ios/chrome/browser/sessions/session_ios.mm b/ios/chrome/browser/sessions/session_ios.mm
index 405219cb..19fc191 100644
--- a/ios/chrome/browser/sessions/session_ios.mm
+++ b/ios/chrome/browser/sessions/session_ios.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/sessions/session_ios.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/sessions/session_window_ios.h"
namespace {
@@ -36,7 +36,7 @@
- (instancetype)initWithCoder:(NSCoder*)aDecoder {
NSArray<SessionWindowIOS*>* sessionWindows =
- base::mac::ObjCCast<NSArray<SessionWindowIOS*>>(
+ base::apple::ObjCCast<NSArray<SessionWindowIOS*>>(
[aDecoder decodeObjectForKey:kSessionWindowsKey]);
return [self initWithWindows:(sessionWindows ? sessionWindows : @[])];
diff --git a/ios/chrome/browser/sessions/session_service_ios.mm b/ios/chrome/browser/sessions/session_service_ios.mm
index 8683f19..da66114c 100644
--- a/ios/chrome/browser/sessions/session_service_ios.mm
+++ b/ios/chrome/browser/sessions/session_service_ios.mm
@@ -6,13 +6,13 @@
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/files/file_path.h"
#import "base/format_macros.h"
#import "base/functional/bind.h"
#import "base/functional/callback_helpers.h"
#import "base/location.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/memory/ref_counted.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
@@ -161,17 +161,17 @@
// object as the root object (pre-M-59).
if ([rootObject isKindOfClass:[SessionWindowIOS class]]) {
return [[SessionIOS alloc] initWithWindows:@[
- base::mac::ObjCCastStrict<SessionWindowIOS>(rootObject)
+ base::apple::ObjCCastStrict<SessionWindowIOS>(rootObject)
]];
}
- return base::mac::ObjCCastStrict<SessionIOS>(rootObject);
+ return base::apple::ObjCCastStrict<SessionIOS>(rootObject);
}
- (void)deleteAllSessionFilesInDirectory:(const base::FilePath&)directory
completion:(base::OnceClosure)callback {
NSString* sessionsDirectory =
- base::mac::FilePathToNSString(directory.Append(kSessions));
+ base::apple::FilePathToNSString(directory.Append(kSessions));
NSArray<NSString*>* allSessionIDs = [[NSFileManager defaultManager]
contentsOfDirectoryAtPath:sessionsDirectory
error:nil];
@@ -196,7 +196,7 @@
+ (NSString*)sessionPathForSessionID:(NSString*)sessionID
directory:(const base::FilePath&)directory {
DCHECK(sessionID.length != 0);
- return base::mac::FilePathToNSString(
+ return base::apple::FilePathToNSString(
directory.Append(kSessions)
.Append(base::SysNSStringToUTF8(sessionID))
.Append(kSessionFileName));
diff --git a/ios/chrome/browser/sessions/session_service_ios_unittest.mm b/ios/chrome/browser/sessions/session_service_ios_unittest.mm
index 26b869f..c8366926 100644
--- a/ios/chrome/browser/sessions/session_service_ios_unittest.mm
+++ b/ios/chrome/browser/sessions/session_service_ios_unittest.mm
@@ -6,10 +6,10 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/files/file_path.h"
#import "base/files/file_util.h"
#import "base/files/scoped_temp_dir.h"
-#import "base/mac/foundation_util.h"
#import "base/path_service.h"
#import "base/run_loop.h"
#import "base/task/sequenced_task_runner.h"
@@ -97,7 +97,7 @@
if (!base::PathExists(session_path))
return nil;
- return base::mac::FilePathToNSString(session_path);
+ return base::apple::FilePathToNSString(session_path);
}
SessionServiceIOS* session_service() { return session_service_; }
@@ -105,7 +105,7 @@
const base::FilePath& directory() const { return directory_; }
NSString* directory_as_nsstring() const {
- return base::mac::FilePathToNSString(directory());
+ return base::apple::FilePathToNSString(directory());
}
private:
diff --git a/ios/chrome/browser/sessions/session_window_ios.mm b/ios/chrome/browser/sessions/session_window_ios.mm
index 2a0f6606..8774be1d 100644
--- a/ios/chrome/browser/sessions/session_window_ios.mm
+++ b/ios/chrome/browser/sessions/session_window_ios.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/sessions/session_window_ios.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/format_macros.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/sessions/NSCoder+Compatibility.h"
@@ -55,7 +55,7 @@
- (instancetype)initWithCoder:(NSCoder*)aDecoder {
NSUInteger selectedIndex = [aDecoder cr_decodeIndexForKey:kSelectedIndexKey];
NSArray<CRWSessionStorage*>* sessions =
- base::mac::ObjCCast<NSArray<CRWSessionStorage*>>(
+ base::apple::ObjCCast<NSArray<CRWSessionStorage*>>(
[aDecoder decodeObjectForKey:kSessionsKey]);
if (!sessions) {
diff --git a/ios/chrome/browser/share_extension/share_extension_item_receiver.mm b/ios/chrome/browser/share_extension/share_extension_item_receiver.mm
index bea971dd..2614d88 100644
--- a/ios/chrome/browser/share_extension/share_extension_item_receiver.mm
+++ b/ios/chrome/browser/share_extension/share_extension_item_receiver.mm
@@ -6,9 +6,9 @@
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/ios/block_types.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics_action.h"
#import "base/strings/sys_string_conversions.h"
@@ -204,7 +204,7 @@
unarchiver.requiresSecureCoding = NO;
id entryID = [unarchiver decodeObjectForKey:NSKeyedArchiveRootObjectKey];
- NSDictionary* entry = base::mac::ObjCCast<NSDictionary>(entryID);
+ NSDictionary* entry = base::apple::ObjCCast<NSDictionary>(entryID);
if (!entry) {
if (completion) {
completion();
@@ -212,7 +212,7 @@
return NO;
}
- NSNumber* cancelled = base::mac::ObjCCast<NSNumber>(
+ NSNumber* cancelled = base::apple::ObjCCast<NSNumber>(
[entry objectForKey:app_group::kShareItemCancel]);
if (!cancelled) {
if (completion) {
@@ -231,11 +231,11 @@
NSURL* entryURL = [entry objectForKey:app_group::kShareItemURL];
GURL entryGURL = net::GURLWithNSURL(entryURL);
NSString* entryTitle = [entry objectForKey:app_group::kShareItemTitle];
- NSDate* entryDate = base::mac::ObjCCast<NSDate>(
+ NSDate* entryDate = base::apple::ObjCCast<NSDate>(
[entry objectForKey:app_group::kShareItemDate]);
- NSNumber* entryType = base::mac::ObjCCast<NSNumber>(
+ NSNumber* entryType = base::apple::ObjCCast<NSNumber>(
[entry objectForKey:app_group::kShareItemType]);
- NSString* entrySource = base::mac::ObjCCast<NSString>(
+ NSString* entrySource = base::apple::ObjCCast<NSString>(
[entry objectForKey:app_group::kShareItemSource]);
if (!entryGURL.is_valid() || !entrySource || !entryDate || !entryType ||
diff --git a/ios/chrome/browser/shared/coordinator/alert/action_sheet_coordinator_unittest.mm b/ios/chrome/browser/shared/coordinator/alert/action_sheet_coordinator_unittest.mm
index d2314fe..89f1e3e 100644
--- a/ios/chrome/browser/shared/coordinator/alert/action_sheet_coordinator_unittest.mm
+++ b/ios/chrome/browser/shared/coordinator/alert/action_sheet_coordinator_unittest.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/task_environment.h"
#import "ios/chrome/browser/shared/model/browser/test/test_browser.h"
#import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h"
@@ -45,7 +45,7 @@
UIAlertController* GetAlertController() {
EXPECT_TRUE([base_view_controller_.presentedViewController
isKindOfClass:[UIAlertController class]]);
- return base::mac::ObjCCastStrict<UIAlertController>(
+ return base::apple::ObjCCastStrict<UIAlertController>(
base_view_controller_.presentedViewController);
}
diff --git a/ios/chrome/browser/shared/coordinator/alert/alert_coordinator_unittest.mm b/ios/chrome/browser/shared/coordinator/alert/alert_coordinator_unittest.mm
index 8d566f53..82b6b96 100644
--- a/ios/chrome/browser/shared/coordinator/alert/alert_coordinator_unittest.mm
+++ b/ios/chrome/browser/shared/coordinator/alert/alert_coordinator_unittest.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/task_environment.h"
#import "ios/chrome/browser/shared/model/browser/test/test_browser.h"
#import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h"
@@ -83,7 +83,7 @@
ASSERT_TRUE([view_controller.presentedViewController
isKindOfClass:[UIAlertController class]]);
UIAlertController* alert_controller =
- base::mac::ObjCCastStrict<UIAlertController>(
+ base::apple::ObjCCastStrict<UIAlertController>(
view_controller.presentedViewController);
EXPECT_EQ(1LU, alert_controller.actions.count);
}
@@ -124,7 +124,7 @@
ASSERT_TRUE([view_controller.presentedViewController
isKindOfClass:[UIAlertController class]]);
UIAlertController* alert_controller =
- base::mac::ObjCCastStrict<UIAlertController>(
+ base::apple::ObjCCastStrict<UIAlertController>(
view_controller.presentedViewController);
// Test the results.
@@ -189,7 +189,7 @@
ASSERT_TRUE([view_controller.presentedViewController
isKindOfClass:[UIAlertController class]]);
UIAlertController* alert_controller =
- base::mac::ObjCCastStrict<UIAlertController>(
+ base::apple::ObjCCastStrict<UIAlertController>(
view_controller.presentedViewController);
// Test the results.
@@ -297,7 +297,7 @@
ASSERT_TRUE([view_controller.presentedViewController
isKindOfClass:[UIAlertController class]]);
UIAlertController* alert_controller =
- base::mac::ObjCCastStrict<UIAlertController>(
+ base::apple::ObjCCastStrict<UIAlertController>(
view_controller.presentedViewController);
// Test the results.
diff --git a/ios/chrome/browser/shared/coordinator/alert/repost_form_coordinator_unittest.mm b/ios/chrome/browser/shared/coordinator/alert/repost_form_coordinator_unittest.mm
index 55bb490..fdac790 100644
--- a/ios/chrome/browser/shared/coordinator/alert/repost_form_coordinator_unittest.mm
+++ b/ios/chrome/browser/shared/coordinator/alert/repost_form_coordinator_unittest.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/ios/wait_util.h"
#import "base/test/task_environment.h"
#import "base/test/test_timeouts.h"
@@ -45,7 +45,7 @@
}
UIAlertController* GetAlertController() const {
- return base::mac::ObjCCastStrict<UIAlertController>(
+ return base::apple::ObjCCastStrict<UIAlertController>(
view_controller_.presentedViewController);
}
diff --git a/ios/chrome/browser/shared/coordinator/scene/scene_delegate.mm b/ios/chrome/browser/shared/coordinator/scene/scene_delegate.mm
index 30319e3..b2ab483 100644
--- a/ios/chrome/browser/shared/coordinator/scene/scene_delegate.mm
+++ b/ios/chrome/browser/shared/coordinator/scene/scene_delegate.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/shared/coordinator/scene/scene_delegate.h"
+#import "base/apple/foundation_util.h"
#import "base/files/file_path.h"
-#import "base/mac/foundation_util.h"
#import "base/path_service.h"
#import "base/strings/sys_string_conversions.h"
#import "components/breadcrumbs/core/breadcrumb_persistent_storage_util.h"
@@ -49,7 +49,7 @@
- (SceneState*)sceneState {
if (!_sceneState) {
MainApplicationDelegate* appDelegate =
- base::mac::ObjCCastStrict<MainApplicationDelegate>(
+ base::apple::ObjCCastStrict<MainApplicationDelegate>(
UIApplication.sharedApplication.delegate);
_sceneState = [[SceneState alloc] initWithAppState:appDelegate.appState];
_sceneController = [[SceneController alloc] initWithSceneState:_sceneState];
@@ -93,7 +93,7 @@
- (void)scene:(UIScene*)scene
willConnectToSession:(UISceneSession*)session
options:(UISceneConnectionOptions*)connectionOptions {
- self.sceneState.scene = base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ self.sceneState.scene = base::apple::ObjCCastStrict<UIWindowScene>(scene);
self.sceneState.currentOrigin = [self originFromSession:session
options:connectionOptions];
self.sceneState.activationLevel = SceneActivationLevelBackground;
diff --git a/ios/chrome/browser/shared/coordinator/scene/scene_state.mm b/ios/chrome/browser/shared/coordinator/scene/scene_state.mm
index 194bf40..fcc0b15 100644
--- a/ios/chrome/browser/shared/coordinator/scene/scene_state.mm
+++ b/ios/chrome/browser/shared/coordinator/scene/scene_state.mm
@@ -4,10 +4,10 @@
#import "ios/chrome/browser/shared/coordinator/scene/scene_state.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/crb_protocol_observers.h"
#import "base/ios/ios_util.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/app/application_delegate/app_state.h"
@@ -176,7 +176,7 @@
return YES;
case ContentVisibility::kUnknown: {
- const BOOL incognitoContentVisible = [base::mac::ObjCCast<NSNumber>(
+ const BOOL incognitoContentVisible = [base::apple::ObjCCast<NSNumber>(
[self sessionObjectForKey:kIncognitoCurrentKey]) boolValue];
_contentVisibility =
diff --git a/ios/chrome/browser/shared/coordinator/scene/test/fake_scene_state.mm b/ios/chrome/browser/shared/coordinator/scene/test/fake_scene_state.mm
index 42bda29e..cd49c6e 100644
--- a/ios/chrome/browser/shared/coordinator/scene/test/fake_scene_state.mm
+++ b/ios/chrome/browser/shared/coordinator/scene/test/fake_scene_state.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/coordinator/scene/test/fake_scene_state.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/coordinator/scene/test/stub_browser_provider.h"
#import "ios/chrome/browser/shared/coordinator/scene/test/stub_browser_provider_interface.h"
#import "ios/chrome/browser/shared/model/browser/browser.h"
@@ -42,18 +42,18 @@
self.browserProviderInterface = [[StubBrowserProviderInterface alloc] init];
_browser = std::make_unique<TestBrowser>(browserState);
- base::mac::ObjCCastStrict<StubBrowserProvider>(
+ base::apple::ObjCCastStrict<StubBrowserProvider>(
self.browserProviderInterface.mainBrowserProvider)
.browser = _browser.get();
_inactive_browser = std::make_unique<TestBrowser>(browserState);
- base::mac::ObjCCastStrict<StubBrowserProvider>(
+ base::apple::ObjCCastStrict<StubBrowserProvider>(
self.browserProviderInterface.mainBrowserProvider)
.inactiveBrowser = _inactive_browser.get();
_incognito_browser = std::make_unique<TestBrowser>(
browserState->GetOffTheRecordChromeBrowserState());
- base::mac::ObjCCastStrict<StubBrowserProvider>(
+ base::apple::ObjCCastStrict<StubBrowserProvider>(
self.browserProviderInterface.incognitoBrowserProvider)
.browser = _incognito_browser.get();
}
diff --git a/ios/chrome/browser/shared/model/url/url_util.mm b/ios/chrome/browser/shared/model/url/url_util.mm
index a83aa3a..5330bef 100644
--- a/ios/chrome/browser/shared/model/url/url_util.mm
+++ b/ios/chrome/browser/shared/model/url/url_util.mm
@@ -7,8 +7,8 @@
#import <UIKit/UIKit.h>
#import "base/apple/bundle_locations.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/string_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/content_settings/core/browser/host_content_settings_map.h"
@@ -95,7 +95,7 @@
for (NSDictionary* urlType in urlTypes) {
DCHECK([urlType isKindOfClass:[NSDictionary class]]);
NSArray* schemesForType =
- base::mac::ObjCCastStrict<NSArray>(urlType[@"CFBundleURLSchemes"]);
+ base::apple::ObjCCastStrict<NSArray>(urlType[@"CFBundleURLSchemes"]);
if (schemesForType.count) {
[schemes addObjectsFromArray:schemesForType];
}
diff --git a/ios/chrome/browser/shared/ui/list_model/list_model_unittest.mm b/ios/chrome/browser/shared/ui/list_model/list_model_unittest.mm
index 691edcd..67403bf 100644
--- a/ios/chrome/browser/shared/ui/list_model/list_model_unittest.mm
+++ b/ios/chrome/browser/shared/ui/list_model/list_model_unittest.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/shared/ui/list_model/list_model.h"
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/functional/callback.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/string_piece.h"
#import "ios/chrome/browser/shared/ui/list_model/list_item.h"
#import "testing/gtest/include/gtest/gtest.h"
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_activity_indicator_header_footer_item.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_activity_indicator_header_footer_item.mm
index e5f0de1..9c6fa35 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_activity_indicator_header_footer_item.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_activity_indicator_header_footer_item.mm
@@ -6,7 +6,7 @@
#import <MaterialComponents/MaterialActivityIndicator.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
@@ -28,7 +28,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureHeaderFooterView:headerFooter withStyler:styler];
TableViewActivityIndicatorHeaderFooterView* header =
- base::mac::ObjCCastStrict<TableViewActivityIndicatorHeaderFooterView>(
+ base::apple::ObjCCastStrict<TableViewActivityIndicatorHeaderFooterView>(
headerFooter);
header.titleLabel.text = self.text;
header.subtitleLabel.text = self.subtitleText;
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_detail_icon_item_unittest.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_detail_icon_item_unittest.mm
index 4270640..9d31e43 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_detail_icon_item_unittest.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_detail_icon_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_detail_icon_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/symbols/chrome_icon.h"
#import "ios/chrome/browser/shared/ui/symbols/symbols.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
@@ -19,7 +19,7 @@
// Returns the UIImageView containing the icon within the cell.
UIImageView* GetImageView(TableViewDetailIconCell* cell) {
- return base::mac::ObjCCastStrict<UIImageView>(
+ return base::apple::ObjCCastStrict<UIImageView>(
cell.contentView.subviews[0].subviews[0]);
}
@@ -50,7 +50,7 @@
ASSERT_TRUE([cell isMemberOfClass:[TableViewDetailIconCell class]]);
TableViewDetailIconCell* detail_cell =
- base::mac::ObjCCastStrict<TableViewDetailIconCell>(cell);
+ base::apple::ObjCCastStrict<TableViewDetailIconCell>(cell);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
[item configureCell:cell withStyler:styler];
@@ -84,7 +84,7 @@
ASSERT_TRUE([cell isMemberOfClass:[TableViewDetailIconCell class]]);
TableViewDetailIconCell* detail_cell =
- base::mac::ObjCCastStrict<TableViewDetailIconCell>(cell);
+ base::apple::ObjCCastStrict<TableViewDetailIconCell>(cell);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
[item configureCell:cell withStyler:styler];
@@ -124,7 +124,7 @@
ASSERT_TRUE([cell isMemberOfClass:[TableViewDetailIconCell class]]);
TableViewDetailIconCell* detail_cell =
- base::mac::ObjCCastStrict<TableViewDetailIconCell>(cell);
+ base::apple::ObjCCastStrict<TableViewDetailIconCell>(cell);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
[item configureCell:cell withStyler:styler];
@@ -163,7 +163,7 @@
ASSERT_TRUE([cell isMemberOfClass:[TableViewDetailIconCell class]]);
TableViewDetailIconCell* detail_cell =
- base::mac::ObjCCastStrict<TableViewDetailIconCell>(cell);
+ base::apple::ObjCCastStrict<TableViewDetailIconCell>(cell);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
[item configureCell:cell withStyler:styler];
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_detail_text_item_unittest.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_detail_text_item_unittest.mm
index b79d0343..2a898a8 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_detail_text_item_unittest.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_detail_text_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_detail_text_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
@@ -36,7 +36,7 @@
ASSERT_TRUE([cell isMemberOfClass:[TableViewDetailTextCell class]]);
TableViewDetailTextCell* detailCell =
- base::mac::ObjCCastStrict<TableViewDetailTextCell>(cell);
+ base::apple::ObjCCastStrict<TableViewDetailTextCell>(cell);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
styler.cellTitleColor = UIColor.redColor;
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_disclosure_header_footer_item.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_disclosure_header_footer_item.mm
index cc25b69..bdc9b37 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_disclosure_header_footer_item.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_disclosure_header_footer_item.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_disclosure_header_footer_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/numerics/math_constants.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/shared/ui/util/rtl_geometry.h"
@@ -35,7 +35,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureHeaderFooterView:headerFooter withStyler:styler];
TableViewDisclosureHeaderFooterView* header =
- base::mac::ObjCCastStrict<TableViewDisclosureHeaderFooterView>(
+ base::apple::ObjCCastStrict<TableViewDisclosureHeaderFooterView>(
headerFooter);
header.titleLabel.text = self.text;
header.subtitleLabel.text = self.subtitleText;
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_illustrated_item.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_illustrated_item.mm
index caa91dc..229f87a 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_illustrated_item.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_illustrated_item.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_illustrated_item.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/common/button_configuration_util.h"
@@ -43,7 +43,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:tableCell withStyler:styler];
TableViewIllustratedCell* cell =
- base::mac::ObjCCastStrict<TableViewIllustratedCell>(tableCell);
+ base::apple::ObjCCastStrict<TableViewIllustratedCell>(tableCell);
if ([self.accessibilityIdentifier length]) {
cell.accessibilityIdentifier = self.accessibilityIdentifier;
}
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_image_item.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_image_item.mm
index 00ea632..0884234 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_image_item.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_image_item.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_image_item.h"
+#import "base/apple/foundation_util.h"
#import "base/i18n/rtl.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
@@ -30,7 +30,7 @@
[super configureCell:tableCell withStyler:styler];
TableViewImageCell* cell =
- base::mac::ObjCCastStrict<TableViewImageCell>(tableCell);
+ base::apple::ObjCCastStrict<TableViewImageCell>(tableCell);
if (self.image) {
cell.imageView.hidden = NO;
cell.imageView.image = self.image;
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_image_item_unittest.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_image_item_unittest.mm
index fe2cc0c..a23ff3d4 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_image_item_unittest.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_image_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_image_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
@@ -29,7 +29,7 @@
ASSERT_TRUE([cell isMemberOfClass:[TableViewImageCell class]]);
TableViewImageCell* imageCell =
- base::mac::ObjCCastStrict<TableViewImageCell>(cell);
+ base::apple::ObjCCastStrict<TableViewImageCell>(cell);
EXPECT_FALSE(imageCell.textLabel.text);
EXPECT_FALSE(imageCell.detailTextLabel.text);
EXPECT_FALSE(imageCell.imageView.image);
@@ -51,7 +51,7 @@
ASSERT_TRUE([cell isMemberOfClass:[TableViewImageCell class]]);
TableViewImageCell* imageCell =
- base::mac::ObjCCastStrict<TableViewImageCell>(cell);
+ base::apple::ObjCCastStrict<TableViewImageCell>(cell);
EXPECT_FALSE(item.image);
[item configureCell:cell withStyler:[[ChromeTableViewStyler alloc] init]];
EXPECT_FALSE(item.image);
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_button_item.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_button_item.mm
index d5a2d07..51afbdd 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_button_item.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_button_item.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_button_item.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
@@ -56,7 +56,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:tableCell withStyler:styler];
TableViewTextButtonCell* cell =
- base::mac::ObjCCastStrict<TableViewTextButtonCell>(tableCell);
+ base::apple::ObjCCastStrict<TableViewTextButtonCell>(tableCell);
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
cell.textLabel.text = self.text;
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_button_item_unittest.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_button_item_unittest.mm
index 0a8c565..271772b6 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_button_item_unittest.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_button_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_button_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
@@ -32,7 +32,7 @@
ASSERT_TRUE([cell isMemberOfClass:[TableViewTextButtonCell class]]);
TableViewTextButtonCell* textButtonCell =
- base::mac::ObjCCastStrict<TableViewTextButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextButtonCell>(cell);
EXPECT_FALSE(textButtonCell.textLabel.text);
EXPECT_FALSE(textButtonCell.button.titleLabel.text);
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_header_footer_item_unittest.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_header_footer_item_unittest.mm
index cac93c4..f63505f 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_header_footer_item_unittest.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_header_footer_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_header_footer_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
@@ -28,7 +28,7 @@
[headerFooter isMemberOfClass:[TableViewTextHeaderFooterView class]]);
TableViewTextHeaderFooterView* textHeaderFooter =
- base::mac::ObjCCastStrict<TableViewTextHeaderFooterView>(headerFooter);
+ base::apple::ObjCCastStrict<TableViewTextHeaderFooterView>(headerFooter);
EXPECT_FALSE(textHeaderFooter.textLabel.text);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_item.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_item.mm
index 9033f3b..6be2a60 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_item.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_item.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
@@ -29,7 +29,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:tableCell withStyler:styler];
TableViewTextCell* cell =
- base::mac::ObjCCastStrict<TableViewTextCell>(tableCell);
+ base::apple::ObjCCastStrict<TableViewTextCell>(tableCell);
cell.isAccessibilityElement = YES;
if (self.masked) {
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_item_unittest.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_item_unittest.mm
index 585cc3a1..80d0fbf 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_item_unittest.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
@@ -28,7 +28,7 @@
ASSERT_TRUE([cell isMemberOfClass:[TableViewTextCell class]]);
TableViewTextCell* textCell =
- base::mac::ObjCCastStrict<TableViewTextCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextCell>(cell);
EXPECT_FALSE(textCell.textLabel.text);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
@@ -49,7 +49,7 @@
ASSERT_TRUE([cell isMemberOfClass:[TableViewTextCell class]]);
TableViewTextCell* textCell =
- base::mac::ObjCCastStrict<TableViewTextCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextCell>(cell);
EXPECT_FALSE(textCell.textLabel.text);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_link_item.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_link_item.mm
index b6079ce0..9c51d3a 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_link_item.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_text_link_item.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_link_item.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ns_range.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/net/crurl.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
@@ -30,7 +30,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:tableCell withStyler:styler];
TableViewTextLinkCell* cell =
- base::mac::ObjCCastStrict<TableViewTextLinkCell>(tableCell);
+ base::apple::ObjCCastStrict<TableViewTextLinkCell>(tableCell);
cell.textView.text = self.text;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_url_item.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_url_item.mm
index bfebc72..b69ace2 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_url_item.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_url_item.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_url_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/url_formatter/elide_url.h"
#import "ios/chrome/browser/net/crurl.h"
@@ -41,7 +41,7 @@
[super configureCell:tableCell withStyler:styler];
TableViewURLCell* cell =
- base::mac::ObjCCastStrict<TableViewURLCell>(tableCell);
+ base::apple::ObjCCastStrict<TableViewURLCell>(tableCell);
cell.titleLabel.text = [self titleLabelText];
cell.URLLabel.text = [self URLLabelText];
cell.thirdRowLabel.text = self.thirdRowText;
diff --git a/ios/chrome/browser/shared/ui/table_view/cells/table_view_url_item_unittest.mm b/ios/chrome/browser/shared/ui/table_view/cells/table_view_url_item_unittest.mm
index 694fee6..7d44244 100644
--- a/ios/chrome/browser/shared/ui/table_view/cells/table_view_url_item_unittest.mm
+++ b/ios/chrome/browser/shared/ui/table_view/cells/table_view_url_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_url_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/url_formatter/elide_url.h"
#import "ios/chrome/browser/net/crurl.h"
@@ -35,7 +35,8 @@
id cell = [[[item cellClass] alloc] init];
ASSERT_TRUE([cell isMemberOfClass:[TableViewURLCell class]]);
- TableViewURLCell* URLCell = base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ TableViewURLCell* URLCell =
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
EXPECT_FALSE(URLCell.titleLabel.text);
EXPECT_FALSE(URLCell.URLLabel.text);
EXPECT_FALSE(URLCell.metadataLabel.text);
@@ -60,7 +61,8 @@
id cell = [[[item cellClass] alloc] init];
ASSERT_TRUE([cell isMemberOfClass:[TableViewURLCell class]]);
- TableViewURLCell* URLCell = base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ TableViewURLCell* URLCell =
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
[item configureCell:URLCell withStyler:styler];
EXPECT_TRUE(URLCell.metadataLabel.hidden);
@@ -75,7 +77,8 @@
id cell = [[[item cellClass] alloc] init];
ASSERT_TRUE([cell isMemberOfClass:[TableViewURLCell class]]);
- TableViewURLCell* URLCell = base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ TableViewURLCell* URLCell =
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
[item configureCell:URLCell withStyler:styler];
EXPECT_FALSE(URLCell.metadataLabel.hidden);
@@ -108,7 +111,7 @@
[item configureCell:cell withStyler:styler];
ASSERT_TRUE([cell isMemberOfClass:[TableViewURLCell class]]);
EXPECT_NSEQ(kExpectedURLLabelText,
- base::mac::ObjCCast<TableViewURLCell>(cell).URLLabel.text);
+ base::apple::ObjCCast<TableViewURLCell>(cell).URLLabel.text);
}
// Tests that when there is no title, the URL is used as the title and the
@@ -125,7 +128,7 @@
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
[item configureCell:cell withStyler:styler];
ASSERT_TRUE([cell isMemberOfClass:[TableViewURLCell class]]);
- TableViewURLCell* url_cell = base::mac::ObjCCast<TableViewURLCell>(cell);
+ TableViewURLCell* url_cell = base::apple::ObjCCast<TableViewURLCell>(cell);
EXPECT_NSEQ(
base::SysUTF16ToNSString(
url_formatter::
@@ -151,9 +154,9 @@
[item configureCell:cell withStyler:styler];
ASSERT_TRUE([cell isMemberOfClass:[TableViewURLCell class]]);
EXPECT_NSEQ(kThirdRowText,
- base::mac::ObjCCast<TableViewURLCell>(cell).thirdRowLabel.text);
+ base::apple::ObjCCast<TableViewURLCell>(cell).thirdRowLabel.text);
EXPECT_FALSE(
- base::mac::ObjCCast<TableViewURLCell>(cell).thirdRowLabel.hidden);
+ base::apple::ObjCCast<TableViewURLCell>(cell).thirdRowLabel.hidden);
}
// Tests that the third row text is not shown when the second row is not shown.
@@ -169,7 +172,8 @@
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
[item configureCell:cell withStyler:styler];
ASSERT_TRUE([cell isMemberOfClass:[TableViewURLCell class]]);
- EXPECT_TRUE(base::mac::ObjCCast<TableViewURLCell>(cell).thirdRowLabel.hidden);
+ EXPECT_TRUE(
+ base::apple::ObjCCast<TableViewURLCell>(cell).thirdRowLabel.hidden);
}
// Tests that the third row text is shown in chosen color.
@@ -191,7 +195,7 @@
ASSERT_TRUE([cell isMemberOfClass:[TableViewURLCell class]]);
EXPECT_NSEQ(
kExpectedColor,
- base::mac::ObjCCast<TableViewURLCell>(cell).thirdRowLabel.textColor);
+ base::apple::ObjCCast<TableViewURLCell>(cell).thirdRowLabel.textColor);
}
// Tests that the third row text is included in the accessibility label.
@@ -214,7 +218,7 @@
[item configureCell:cell withStyler:styler];
ASSERT_TRUE([cell isMemberOfClass:[TableViewURLCell class]]);
- UITableViewCell* tableViewCell = base::mac::ObjCCast<UITableViewCell>(cell);
+ UITableViewCell* tableViewCell = base::apple::ObjCCast<UITableViewCell>(cell);
tableViewCell.accessibilityLabel = nil;
EXPECT_NSEQ(kExpectedAccessibilityText, tableViewCell.accessibilityLabel);
}
diff --git a/ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller.mm b/ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller.mm
index 823334a7..9ab6c67 100644
--- a/ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller.mm
+++ b/ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_cell.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_header_footer_item.h"
@@ -232,7 +232,7 @@
// `cell` may be nil if the row is not currently on screen.
if (cell) {
TableViewCell* tableViewCell =
- base::mac::ObjCCastStrict<TableViewCell>(cell);
+ base::apple::ObjCCastStrict<TableViewCell>(cell);
[item configureCell:tableViewCell withStyler:self.styler];
}
}
@@ -267,7 +267,8 @@
UITableViewCell* cell =
[self.tableView dequeueReusableCellWithIdentifier:reuseIdentifier
forIndexPath:indexPath];
- TableViewCell* tableViewCell = base::mac::ObjCCastStrict<TableViewCell>(cell);
+ TableViewCell* tableViewCell =
+ base::apple::ObjCCastStrict<TableViewCell>(cell);
[item configureCell:tableViewCell withStyler:self.styler];
if (base::FeatureList::IsEnabled(kBlockSimultaneousCellSelectionKillSwitch)) {
diff --git a/ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.mm b/ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.mm
index c1770530..a18cd9b 100644
--- a/ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.mm
+++ b/ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_info_button_item.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_button_item.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_item.h"
@@ -206,7 +206,7 @@
NSString* expected_title,
int section,
int item) {
- id info_button_item = base::mac::ObjCCastStrict<TableViewInfoButtonItem>(
+ id info_button_item = base::apple::ObjCCastStrict<TableViewInfoButtonItem>(
GetTableViewItem(section, item));
EXPECT_TRUE([info_button_item respondsToSelector:@selector(text)]);
EXPECT_NSEQ(expected_title, [info_button_item text]);
diff --git a/ios/chrome/browser/shared/ui/table_view/table_view_navigation_controller.mm b/ios/chrome/browser/shared/ui/table_view/table_view_navigation_controller.mm
index 28c7a53..aa6d30c 100644
--- a/ios/chrome/browser/shared/ui/table_view/table_view_navigation_controller.mm
+++ b/ios/chrome/browser/shared/ui/table_view/table_view_navigation_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/ui/table_view/table_view_navigation_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
diff --git a/ios/chrome/browser/shared/ui/util/layout_guide_center_unittest.mm b/ios/chrome/browser/shared/ui/util/layout_guide_center_unittest.mm
index c1d9f40..c119a16 100644
--- a/ios/chrome/browser/shared/ui/util/layout_guide_center_unittest.mm
+++ b/ios/chrome/browser/shared/ui/util/layout_guide_center_unittest.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/ios/wait_util.h"
#import "testing/gtest/include/gtest/gtest.h"
#import "testing/platform_test.h"
@@ -102,7 +102,7 @@
UIView* view = [[UIView alloc] init];
[view addLayoutGuide:layout_guide];
// Set up windows in the same scene.
- UIWindowScene* scene = base::mac::ObjCCastStrict<UIWindowScene>(
+ UIWindowScene* scene = base::apple::ObjCCastStrict<UIWindowScene>(
[UIApplication.sharedApplication.connectedScenes anyObject]);
UIWindow* reference_window = [[UIWindow alloc] init];
reference_window.windowScene = scene;
diff --git a/ios/chrome/browser/shared/ui/util/named_guide.mm b/ios/chrome/browser/shared/ui/util/named_guide.mm
index 3090e77..dd52076 100644
--- a/ios/chrome/browser/shared/ui/util/named_guide.mm
+++ b/ios/chrome/browser/shared/ui/util/named_guide.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/shared/ui/util/named_guide.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/common/ui/util/constraints_ui_util.h"
namespace {
@@ -149,7 +149,7 @@
+ (instancetype)guideWithName:(GuideName*)name view:(UIView*)view {
while (view) {
for (UILayoutGuide* guide in view.layoutGuides) {
- NamedGuide* namedGuide = base::mac::ObjCCast<NamedGuide>(guide);
+ NamedGuide* namedGuide = base::apple::ObjCCast<NamedGuide>(guide);
if ([namedGuide.name isEqualToString:name]) {
return namedGuide;
}
@@ -173,7 +173,7 @@
context:(void*)context {
DCHECK([key isEqualToString:kActiveKeyPath]);
DCHECK([self.constraints containsObject:object]);
- DCHECK(!base::mac::ObjCCastStrict<NSLayoutConstraint>(object).active);
+ DCHECK(!base::apple::ObjCCastStrict<NSLayoutConstraint>(object).active);
[self checkForInactiveConstraints];
}
diff --git a/ios/chrome/browser/shared/ui/util/terms_util.mm b/ios/chrome/browser/shared/ui/util/terms_util.mm
index c179d6b..fd2dc74 100644
--- a/ios/chrome/browser/shared/ui/util/terms_util.mm
+++ b/ios/chrome/browser/shared/ui/util/terms_util.mm
@@ -5,7 +5,7 @@
#import "ios/chrome/browser/shared/ui/util/terms_util.h"
#import "base/apple/bundle_locations.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/model/application_context/application_context.h"
#import "ios/chrome/browser/shared/model/url/chrome_url_constants.h"
diff --git a/ios/chrome/browser/shared/ui/util/terms_util_unittest.mm b/ios/chrome/browser/shared/ui/util/terms_util_unittest.mm
index e9100502..08b04f52 100644
--- a/ios/chrome/browser/shared/ui/util/terms_util_unittest.mm
+++ b/ios/chrome/browser/shared/ui/util/terms_util_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/ui/util/terms_util.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "testing/gtest/include/gtest/gtest.h"
#import "testing/platform_test.h"
diff --git a/ios/chrome/browser/shared/ui/util/uikit_ui_util.mm b/ios/chrome/browser/shared/ui/util/uikit_ui_util.mm
index 33581d2..d992f51 100644
--- a/ios/chrome/browser/shared/ui/util/uikit_ui_util.mm
+++ b/ios/chrome/browser/shared/ui/util/uikit_ui_util.mm
@@ -12,10 +12,10 @@
#import <stdint.h>
#import <cmath>
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/check_op.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "base/numerics/math_constants.h"
#import "ios/chrome/browser/shared/public/features/features.h"
diff --git a/ios/chrome/browser/signin/chrome_account_manager_service_observer_bridge.mm b/ios/chrome/browser/signin/chrome_account_manager_service_observer_bridge.mm
index a17ef35..cbe5960 100644
--- a/ios/chrome/browser/signin/chrome_account_manager_service_observer_bridge.mm
+++ b/ios/chrome/browser/signin/chrome_account_manager_service_observer_bridge.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/signin/chrome_account_manager_service_observer_bridge.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/signin/chrome_account_manager_service.h"
ChromeAccountManagerServiceObserverBridge::
diff --git a/ios/chrome/browser/signin/fake_refresh_access_token_error.mm b/ios/chrome/browser/signin/fake_refresh_access_token_error.mm
index 82c5ef75..6d4fd4b 100644
--- a/ios/chrome/browser/signin/fake_refresh_access_token_error.mm
+++ b/ios/chrome/browser/signin/fake_refresh_access_token_error.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/signin/fake_refresh_access_token_error.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
@implementation FakeRefreshAccessTokenError
diff --git a/ios/chrome/browser/signin/fake_system_identity.mm b/ios/chrome/browser/signin/fake_system_identity.mm
index 04ee760..3a57629 100644
--- a/ios/chrome/browser/signin/fake_system_identity.mm
+++ b/ios/chrome/browser/signin/fake_system_identity.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/signin/fake_system_identity.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
namespace {
@@ -126,7 +126,7 @@
return YES;
}
- FakeSystemIdentity* other = base::mac::ObjCCast<FakeSystemIdentity>(object);
+ FakeSystemIdentity* other = base::apple::ObjCCast<FakeSystemIdentity>(object);
if (!other) {
return NO;
}
diff --git a/ios/chrome/browser/signin/gaia_auth_fetcher_ios.mm b/ios/chrome/browser/signin/gaia_auth_fetcher_ios.mm
index df95276..3c010d37 100644
--- a/ios/chrome/browser/signin/gaia_auth_fetcher_ios.mm
+++ b/ios/chrome/browser/signin/gaia_auth_fetcher_ios.mm
@@ -6,8 +6,8 @@
#import <WebKit/WebKit.h>
+#import "base/apple/foundation_util.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/signin/gaia_auth_fetcher_ios_ns_url_session_bridge.h"
#import "ios/web/public/browser_state.h"
#import "services/network/public/cpp/shared_url_loader_factory.h"
diff --git a/ios/chrome/browser/signin/gaia_auth_fetcher_ios_ns_url_session_bridge.mm b/ios/chrome/browser/signin/gaia_auth_fetcher_ios_ns_url_session_bridge.mm
index cb6fa462..2b04ea4 100644
--- a/ios/chrome/browser/signin/gaia_auth_fetcher_ios_ns_url_session_bridge.mm
+++ b/ios/chrome/browser/signin/gaia_auth_fetcher_ios_ns_url_session_bridge.mm
@@ -6,9 +6,9 @@
#import <Foundation/Foundation.h>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/functional/callback_helpers.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/signin/core/browser/chrome_connected_header_helper.h"
#import "ios/net/cookies/system_cookie_util.h"
@@ -76,7 +76,7 @@
if (!self.bridge)
return;
NSHTTPURLResponse* responseWithHeaders =
- base::mac::ObjCCastStrict<NSHTTPURLResponse>(response);
+ base::apple::ObjCCastStrict<NSHTTPURLResponse>(response);
if (error) {
VLOG(1) << "Fetch failed: "
<< base::SysNSStringToUTF8(error.localizedDescription);
diff --git a/ios/chrome/browser/snapshots/snapshot_cache.mm b/ios/chrome/browser/snapshots/snapshot_cache.mm
index 8aa16a6..23dc9370 100644
--- a/ios/chrome/browser/snapshots/snapshot_cache.mm
+++ b/ios/chrome/browser/snapshots/snapshot_cache.mm
@@ -10,6 +10,7 @@
#import <set>
#import "base/apple/backup_util.h"
+#import "base/apple/foundation_util.h"
#import "base/base_paths.h"
#import "base/containers/contains.h"
#import "base/files/file_enumerator.h"
@@ -18,7 +19,6 @@
#import "base/functional/bind.h"
#import "base/ios/crb_protocol_observers.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/path_service.h"
#import "base/sequence_checker.h"
@@ -148,7 +148,7 @@
// are fixed.
base::FilePath file_path =
ImagePath(snapshot_id, image_type, image_scale, cache_directory);
- NSString* path = base::mac::FilePathToNSString(file_path);
+ NSString* path = base::apple::FilePathToNSString(file_path);
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::WILL_BLOCK);
return [UIImage imageWithData:[NSData dataWithContentsOfFile:path]
@@ -173,7 +173,7 @@
}
}
- NSString* path = base::mac::FilePathToNSString(file_path);
+ NSString* path = base::apple::FilePathToNSString(file_path);
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::WILL_BLOCK);
NSData* data = UIImageJPEGRepresentation(image, kJPEGImageQuality);
diff --git a/ios/chrome/browser/tabs/features.mm b/ios/chrome/browser/tabs/features.mm
index 9010288..09ec894c 100644
--- a/ios/chrome/browser/tabs/features.mm
+++ b/ios/chrome/browser/tabs/features.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/tabs/features.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/field_trial_params.h"
#import "ui/base/device_form_factor.h"
diff --git a/ios/chrome/browser/ui/app_store_rating/app_store_rating_scene_agent.mm b/ios/chrome/browser/ui/app_store_rating/app_store_rating_scene_agent.mm
index c36a2b5..44d54d7 100644
--- a/ios/chrome/browser/ui/app_store_rating/app_store_rating_scene_agent.mm
+++ b/ios/chrome/browser/ui/app_store_rating/app_store_rating_scene_agent.mm
@@ -6,7 +6,7 @@
#import <Foundation/Foundation.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/time/time.h"
#import "components/password_manager/core/browser/password_manager_util.h"
@@ -96,8 +96,8 @@
#pragma mark - Getters
- (BOOL)isDaysInPastWeekRequirementMet {
- NSArray* activeDaysInPastWeek =
- base::mac::ObjCCastStrict<NSArray>([[NSUserDefaults standardUserDefaults]
+ NSArray* activeDaysInPastWeek = base::apple::ObjCCastStrict<NSArray>(
+ [[NSUserDefaults standardUserDefaults]
objectForKey:kAppStoreRatingActiveDaysInPastWeekKey]);
const NSUInteger appStoreRatingTotalDaysOnChromeRequirement =
(GetChannel() == version_info::Channel::DEV ||
@@ -149,8 +149,8 @@
// Returns an array of user's active days in the past week, not including the
// current session.
- (std::vector<base::Time>)activeDaysInPastWeek {
- NSArray* storedActiveDaysInPastWeek =
- base::mac::ObjCCastStrict<NSArray>([[NSUserDefaults standardUserDefaults]
+ NSArray* storedActiveDaysInPastWeek = base::apple::ObjCCastStrict<NSArray>(
+ [[NSUserDefaults standardUserDefaults]
objectForKey:kAppStoreRatingActiveDaysInPastWeekKey]);
std::vector<base::Time> activeDaysInPastWeek;
@@ -218,7 +218,7 @@
// 365 days.
- (BOOL)promoShownOver365DaysAgo {
NSDate* lastShown =
- base::mac::ObjCCastStrict<NSDate>([[NSUserDefaults standardUserDefaults]
+ base::apple::ObjCCastStrict<NSDate>([[NSUserDefaults standardUserDefaults]
objectForKey:kAppStoreRatingLastShownPromoDayKey]);
if (!lastShown) {
return YES;
diff --git a/ios/chrome/browser/ui/appearance/appearance_customization.mm b/ios/chrome/browser/ui/appearance/appearance_customization.mm
index b43b795..169e7d3 100644
--- a/ios/chrome/browser/ui/appearance/appearance_customization.mm
+++ b/ios/chrome/browser/ui/appearance/appearance_customization.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/appearance/appearance_customization.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/table_view_navigation_controller.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
@@ -13,7 +13,7 @@
UIColor* const blueColor = [UIColor colorNamed:kBlueColor];
for (UIScene* scene in UIApplication.sharedApplication.connectedScenes) {
UIWindowScene* windowScene =
- base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ base::apple::ObjCCastStrict<UIWindowScene>(scene);
for (UIWindow* window in windowScene.windows) {
window.tintColor = blueColor;
}
diff --git a/ios/chrome/browser/ui/authentication/cells/signin_promo_view.mm b/ios/chrome/browser/ui/authentication/cells/signin_promo_view.mm
index b8d84ac..b7f85a46 100644
--- a/ios/chrome/browser/ui/authentication/cells/signin_promo_view.mm
+++ b/ios/chrome/browser/ui/authentication/cells/signin_promo_view.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/authentication/cells/signin_promo_view.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "build/branding_buildflags.h"
#import "components/signin/public/base/signin_metrics.h"
diff --git a/ios/chrome/browser/ui/authentication/cells/table_view_account_item.mm b/ios/chrome/browser/ui/authentication/cells/table_view_account_item.mm
index b7e12b4..5e11576 100644
--- a/ios/chrome/browser/ui/authentication/cells/table_view_account_item.mm
+++ b/ios/chrome/browser/ui/authentication/cells/table_view_account_item.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/authentication/cells/table_view_account_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/symbols/symbols.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
#import "ios/chrome/browser/ui/settings/cells/settings_cells_constants.h"
@@ -57,14 +57,14 @@
if (self.mode != TableViewAccountModeDisabled) {
cell.contentView.alpha = 1;
UIImageView* accessoryImage =
- base::mac::ObjCCastStrict<UIImageView>(cell.accessoryView);
+ base::apple::ObjCCastStrict<UIImageView>(cell.accessoryView);
accessoryImage.tintColor =
[accessoryImage.tintColor colorWithAlphaComponent:1];
} else {
cell.userInteractionEnabled = NO;
cell.contentView.alpha = 0.5;
UIImageView* accessoryImage =
- base::mac::ObjCCastStrict<UIImageView>(cell.accessoryView);
+ base::apple::ObjCCastStrict<UIImageView>(cell.accessoryView);
accessoryImage.tintColor =
[accessoryImage.tintColor colorWithAlphaComponent:0.5];
}
@@ -238,7 +238,7 @@
self.userInteractionEnabled = YES;
self.contentView.alpha = 1;
UIImageView* accessoryImage =
- base::mac::ObjCCastStrict<UIImageView>(self.accessoryView);
+ base::apple::ObjCCastStrict<UIImageView>(self.accessoryView);
accessoryImage.tintColor =
[accessoryImage.tintColor colorWithAlphaComponent:1];
}
diff --git a/ios/chrome/browser/ui/authentication/cells/table_view_central_account_item.mm b/ios/chrome/browser/ui/authentication/cells/table_view_central_account_item.mm
index 9947420..03b7455 100644
--- a/ios/chrome/browser/ui/authentication/cells/table_view_central_account_item.mm
+++ b/ios/chrome/browser/ui/authentication/cells/table_view_central_account_item.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/authentication/cells/table_view_central_account_item.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/ui/symbols/symbols.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
diff --git a/ios/chrome/browser/ui/authentication/cells/table_view_signin_promo_item.mm b/ios/chrome/browser/ui/authentication/cells/table_view_signin_promo_item.mm
index 9bdc342..56e3e40c 100644
--- a/ios/chrome/browser/ui/authentication/cells/table_view_signin_promo_item.mm
+++ b/ios/chrome/browser/ui/authentication/cells/table_view_signin_promo_item.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/authentication/cells/table_view_signin_promo_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/ui/authentication/cells/signin_promo_view.h"
#import "ios/chrome/browser/ui/authentication/cells/signin_promo_view_configurator.h"
@@ -31,7 +31,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:tableCell withStyler:styler];
TableViewSigninPromoCell* cell =
- base::mac::ObjCCastStrict<TableViewSigninPromoCell>(tableCell);
+ base::apple::ObjCCastStrict<TableViewSigninPromoCell>(tableCell);
cell.signinPromoView.delegate = self.delegate;
cell.signinPromoView.textLabel.text = self.text;
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
diff --git a/ios/chrome/browser/ui/authentication/signed_in_accounts/signed_in_accounts_table_view_controller.mm b/ios/chrome/browser/ui/authentication/signed_in_accounts/signed_in_accounts_table_view_controller.mm
index 230137a..5ca2c6f7 100644
--- a/ios/chrome/browser/ui/authentication/signed_in_accounts/signed_in_accounts_table_view_controller.mm
+++ b/ios/chrome/browser/ui/authentication/signed_in_accounts/signed_in_accounts_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/authentication/signed_in_accounts/signed_in_accounts_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/memory/raw_ptr.h"
#import "components/signin/public/identity_manager/identity_manager.h"
#import "ios/chrome/browser/signin/chrome_account_manager_service.h"
@@ -107,7 +107,7 @@
- (void)identityUpdated:(id<SystemIdentity>)identity {
TableViewIdentityItem* item =
- base::mac::ObjCCastStrict<TableViewIdentityItem>(
+ base::apple::ObjCCastStrict<TableViewIdentityItem>(
[_identityMap objectForKey:identity.gaiaID]);
[self updateAccountItem:item withIdentity:identity];
[self reconfigureCellsForItems:@[ item ]];
diff --git a/ios/chrome/browser/ui/authentication/signin/add_account_signin/add_account_signin_manager_unittest.mm b/ios/chrome/browser/ui/authentication/signin/add_account_signin/add_account_signin_manager_unittest.mm
index 0cf7ff68..1fa7d013 100644
--- a/ios/chrome/browser/ui/authentication/signin/add_account_signin/add_account_signin_manager_unittest.mm
+++ b/ios/chrome/browser/ui/authentication/signin/add_account_signin/add_account_signin_manager_unittest.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "base/test/task_environment.h"
@@ -44,7 +44,7 @@
identityWithEmail:[NSString stringWithUTF8String:kTestEmail]
gaiaID:[NSString stringWithUTF8String:kTestGaiaID]
name:@"Foo"];
- return base::mac::ObjCCastStrict<FakeSystemIdentityInteractionManager>(
+ return base::apple::ObjCCastStrict<FakeSystemIdentityInteractionManager>(
fake_system_identity_manager()->CreateInteractionManager());
}
diff --git a/ios/chrome/browser/ui/authentication/signin/advanced_settings_signin/advanced_settings_signin_coordinator.mm b/ios/chrome/browser/ui/authentication/signin/advanced_settings_signin/advanced_settings_signin_coordinator.mm
index 1af14107..5ca697e 100644
--- a/ios/chrome/browser/ui/authentication/signin/advanced_settings_signin/advanced_settings_signin_coordinator.mm
+++ b/ios/chrome/browser/ui/authentication/signin/advanced_settings_signin/advanced_settings_signin_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/authentication/signin/advanced_settings_signin/advanced_settings_signin_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/notreached.h"
#import "components/signin/public/identity_manager/identity_manager.h"
diff --git a/ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_account_chooser/consistency_account_chooser_table_view_controller.mm b/ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_account_chooser/consistency_account_chooser_table_view_controller.mm
index 8ef9bd6..c726a72 100644
--- a/ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_account_chooser/consistency_account_chooser_table_view_controller.mm
+++ b/ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_account_chooser/consistency_account_chooser_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/authentication/signin/consistency_promo_signin/consistency_account_chooser/consistency_account_chooser_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "ios/chrome/browser/net/crurl.h"
#import "ios/chrome/browser/shared/model/url/chrome_url_constants.h"
@@ -74,7 +74,7 @@
switch ((ItemType)item.type) {
case IdentityItemType: {
TableViewIdentityItem* identityItem =
- base::mac::ObjCCastStrict<TableViewIdentityItem>(item);
+ base::apple::ObjCCastStrict<TableViewIdentityItem>(item);
DCHECK(identityItem);
[self.actionDelegate
consistencyAccountChooserTableViewController:self
@@ -162,7 +162,7 @@
switch (sectionIdentifier) {
case IdentitySectionIdentifier: {
TableViewLinkHeaderFooterView* linkView =
- base::mac::ObjCCast<TableViewLinkHeaderFooterView>(view);
+ base::apple::ObjCCast<TableViewLinkHeaderFooterView>(view);
linkView.delegate = self;
} break;
case AddAccountSectionIdentifier:
@@ -203,7 +203,7 @@
NSIndexPath* path = [NSIndexPath indexPathForItem:itemIndex
inSection:section];
TableViewIdentityItem* item =
- base::mac::ObjCCastStrict<TableViewIdentityItem>(
+ base::apple::ObjCCastStrict<TableViewIdentityItem>(
[model itemAtIndexPath:path]);
if ([item.gaiaID isEqualToString:configurator.gaiaID]) {
[configurator configureIdentityChooser:item];
diff --git a/ios/chrome/browser/ui/authentication/signin/two_screens_signin/two_screens_signin_coordinator_unittest.mm b/ios/chrome/browser/ui/authentication/signin/two_screens_signin/two_screens_signin_coordinator_unittest.mm
index 1686b8c..0934c83 100644
--- a/ios/chrome/browser/ui/authentication/signin/two_screens_signin/two_screens_signin_coordinator_unittest.mm
+++ b/ios/chrome/browser/ui/authentication/signin/two_screens_signin/two_screens_signin_coordinator_unittest.mm
@@ -6,8 +6,8 @@
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/ios/block_types.h"
-#import "base/mac/foundation_util.h"
#import "base/test/ios/wait_util.h"
#import "base/test/metrics/user_action_tester.h"
#import "ios/chrome/browser/shared/model/application_context/application_context.h"
@@ -67,7 +67,7 @@
// Returns the presented navigation controller's topViewController.
UIViewController* TopViewController() {
UIViewController* presented = PresentedViewController();
- return base::mac::ObjCCast<UINavigationController>(presented)
+ return base::apple::ObjCCast<UINavigationController>(presented)
.topViewController;
}
diff --git a/ios/chrome/browser/ui/authentication/signin_earl_grey_app_interface.mm b/ios/chrome/browser/ui/authentication/signin_earl_grey_app_interface.mm
index 05cbf5c..54a435e 100644
--- a/ios/chrome/browser/ui/authentication/signin_earl_grey_app_interface.mm
+++ b/ios/chrome/browser/ui/authentication/signin_earl_grey_app_interface.mm
@@ -7,8 +7,8 @@
#import <map>
#import <string>
+#import "base/apple/foundation_util.h"
#import "base/functional/callback_helpers.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/sys_string_conversions.h"
#import "components/bookmarks/browser/bookmark_model.h"
diff --git a/ios/chrome/browser/ui/authentication/signin_earl_grey_ui_test_util.mm b/ios/chrome/browser/ui/authentication/signin_earl_grey_ui_test_util.mm
index d7da4d43..60d15c1 100644
--- a/ios/chrome/browser/ui/authentication/signin_earl_grey_ui_test_util.mm
+++ b/ios/chrome/browser/ui/authentication/signin_earl_grey_ui_test_util.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui_test_util.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/ios/wait_util.h"
#import "ios/chrome/browser/shared/ui/table_view/table_view_navigation_controller_constants.h"
#import "ios/chrome/browser/signin/fake_system_identity.h"
diff --git a/ios/chrome/browser/ui/authentication/signout_action_sheet_coordinator_unittest.mm b/ios/chrome/browser/ui/authentication/signout_action_sheet_coordinator_unittest.mm
index 9878a22..cbd15fc 100644
--- a/ios/chrome/browser/ui/authentication/signout_action_sheet_coordinator_unittest.mm
+++ b/ios/chrome/browser/ui/authentication/signout_action_sheet_coordinator_unittest.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/task_environment.h"
#import "components/prefs/pref_service.h"
#import "components/signin/public/base/signin_metrics.h"
diff --git a/ios/chrome/browser/ui/authentication/unified_consent/identity_chooser/identity_chooser_coordinator_unittest.mm b/ios/chrome/browser/ui/authentication/unified_consent/identity_chooser/identity_chooser_coordinator_unittest.mm
index e92e915d..c3bfcf6 100644
--- a/ios/chrome/browser/ui/authentication/unified_consent/identity_chooser/identity_chooser_coordinator_unittest.mm
+++ b/ios/chrome/browser/ui/authentication/unified_consent/identity_chooser/identity_chooser_coordinator_unittest.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/task_environment.h"
#import "ios/chrome/browser/shared/model/application_context/application_context.h"
#import "ios/chrome/browser/shared/model/browser/test/test_browser.h"
@@ -76,7 +76,7 @@
EXPECT_TRUE([view_controller_.presentedViewController
isKindOfClass:[IdentityChooserViewController class]]);
IdentityChooserViewController* presented_view_controller =
- base::mac::ObjCCastStrict<IdentityChooserViewController>(
+ base::apple::ObjCCastStrict<IdentityChooserViewController>(
view_controller_.presentedViewController);
// User selects a valid account.
@@ -92,7 +92,7 @@
EXPECT_TRUE([view_controller_.presentedViewController
isKindOfClass:[IdentityChooserViewController class]]);
IdentityChooserViewController* presented_view_controller =
- base::mac::ObjCCastStrict<IdentityChooserViewController>(
+ base::apple::ObjCCastStrict<IdentityChooserViewController>(
view_controller_.presentedViewController);
// User selects an account that has been invalidated.
diff --git a/ios/chrome/browser/ui/authentication/unified_consent/identity_chooser/identity_chooser_view_controller.mm b/ios/chrome/browser/ui/authentication/unified_consent/identity_chooser/identity_chooser_view_controller.mm
index 640d446..5dd2f197 100644
--- a/ios/chrome/browser/ui/authentication/unified_consent/identity_chooser/identity_chooser_view_controller.mm
+++ b/ios/chrome/browser/ui/authentication/unified_consent/identity_chooser/identity_chooser_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/authentication/unified_consent/identity_chooser/identity_chooser_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/shared/ui/list_model/list_item+Controller.h"
@@ -64,7 +64,7 @@
switch ((ItemType)item.type) {
case IdentityItemType: {
TableViewIdentityItem* tableViewIdentityItem =
- base::mac::ObjCCastStrict<TableViewIdentityItem>(item);
+ base::apple::ObjCCastStrict<TableViewIdentityItem>(item);
DCHECK(tableViewIdentityItem);
[self.presentationDelegate
identityChooserViewController:self
@@ -123,7 +123,7 @@
if (item.type != IdentityItemType)
continue;
TableViewIdentityItem* identityItem =
- base::mac::ObjCCastStrict<TableViewIdentityItem>(item);
+ base::apple::ObjCCastStrict<TableViewIdentityItem>(item);
if ([identityItem.gaiaID isEqualToString:gaiaID])
return identityItem;
}
diff --git a/ios/chrome/browser/ui/authentication/unified_consent/unified_consent_view_controller_unittest.mm b/ios/chrome/browser/ui/authentication/unified_consent/unified_consent_view_controller_unittest.mm
index de4ebb6..0053805 100644
--- a/ios/chrome/browser/ui/authentication/unified_consent/unified_consent_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/authentication/unified_consent/unified_consent_view_controller_unittest.mm
@@ -6,7 +6,7 @@
#import <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/common/string_util.h"
#import "testing/platform_test.h"
#import "ui/base/l10n/l10n_util_mac.h"
@@ -52,13 +52,13 @@
// Returns the first UITextView in the unified consent UI hierarchy.
UITextView* GetSyncSettingsView(UIView* view) {
UIScrollView* scroll_view =
- base::mac::ObjCCast<UIScrollView>([[view subviews] firstObject]);
+ base::apple::ObjCCast<UIScrollView>([[view subviews] firstObject]);
UIView* container =
- base::mac::ObjCCast<UIView>([[scroll_view subviews] firstObject]);
+ base::apple::ObjCCast<UIView>([[scroll_view subviews] firstObject]);
for (UIView* subview in [container subviews]) {
if ([subview isKindOfClass:[UITextView class]]) {
- return base::mac::ObjCCast<UITextView>(subview);
+ return base::apple::ObjCCast<UITextView>(subview);
}
}
return nil;
diff --git a/ios/chrome/browser/ui/autofill/autofill_country_selection_table_view_controller.mm b/ios/chrome/browser/ui/autofill/autofill_country_selection_table_view_controller.mm
index eda817a..756b4c5 100644
--- a/ios/chrome/browser/ui/autofill/autofill_country_selection_table_view_controller.mm
+++ b/ios/chrome/browser/ui/autofill/autofill_country_selection_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/autofill/autofill_country_selection_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/shared/ui/table_view/table_view_navigation_controller_constants.h"
@@ -157,14 +157,14 @@
return;
}
- CountryItem* item = base::mac::ObjCCastStrict<CountryItem>(
+ CountryItem* item = base::apple::ObjCCastStrict<CountryItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
[self.delegate didSelectCountry:item];
}
- (void)tableView:(UITableView*)tableView
performPrimaryActionForRowAtIndexPath:(NSIndexPath*)indexPath {
- CountryItem* item = base::mac::ObjCCastStrict<CountryItem>(
+ CountryItem* item = base::apple::ObjCCastStrict<CountryItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
[self.delegate didSelectCountry:item];
}
diff --git a/ios/chrome/browser/ui/autofill/autofill_profile_edit_table_view_controller.mm b/ios/chrome/browser/ui/autofill/autofill_profile_edit_table_view_controller.mm
index 8fe9110..79fcf046 100644
--- a/ios/chrome/browser/ui/autofill/autofill_profile_edit_table_view_controller.mm
+++ b/ios/chrome/browser/ui/autofill/autofill_profile_edit_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/autofill/autofill_profile_edit_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/autofill/core/browser/data_model/autofill_profile.h"
#import "components/autofill/core/browser/field_types.h"
@@ -153,7 +153,7 @@
continue;
}
- AutofillEditItem* item = base::mac::ObjCCastStrict<AutofillEditItem>(
+ AutofillEditItem* item = base::apple::ObjCCastStrict<AutofillEditItem>(
[model itemAtIndexPath:path]);
[self.delegate updateProfileMetadataWithValue:item.textFieldValue
forAutofillUIType:item.autofillUIType];
@@ -211,7 +211,7 @@
if (itemType == AutofillProfileDetailsItemTypeSaveButton) {
TableViewTextButtonCell* tableViewTextButtonCell =
- base::mac::ObjCCastStrict<TableViewTextButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextButtonCell>(cell);
[tableViewTextButtonCell.button addTarget:self
action:@selector(didTapSaveButton)
forControlEvents:UIControlEventTouchUpInside];
@@ -220,14 +220,14 @@
if (itemType == AutofillProfileDetailsItemTypeCountry) {
TableViewMultiDetailTextCell* multiDetailTextCell =
- base::mac::ObjCCastStrict<TableViewMultiDetailTextCell>(cell);
+ base::apple::ObjCCastStrict<TableViewMultiDetailTextCell>(cell);
multiDetailTextCell.accessibilityIdentifier =
multiDetailTextCell.textLabel.text;
return multiDetailTextCell;
}
TableViewTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(cell);
textFieldCell.accessibilityIdentifier = textFieldCell.textLabel.text;
textFieldCell.textField.delegate = delegate;
return textFieldCell;
@@ -245,7 +245,7 @@
UITableViewCell* cell =
[self.controller.tableView cellForRowAtIndexPath:indexPath];
TableViewTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(cell);
[textFieldCell.textField becomeFirstResponder];
}
}
@@ -739,7 +739,7 @@
footerForSectionWithIdentifier:
AutofillProfileDetailsSectionIdentifierErrorFooter];
TableViewAttributedStringHeaderFooterItem* attributedFooterItem =
- base::mac::ObjCCastStrict<TableViewAttributedStringHeaderFooterItem>(
+ base::apple::ObjCCastStrict<TableViewAttributedStringHeaderFooterItem>(
currentFooter);
NSAttributedString* newFooter = [self errorAndFooterMessage];
return ![attributedFooterItem.attributedString
@@ -824,14 +824,14 @@
AutofillProfileDetailsSectionIdentifierFields]) {
if (item.type == AutofillProfileDetailsItemTypeCountry) {
TableViewMultiDetailTextItem* multiDetailTextItem =
- base::mac::ObjCCastStrict<TableViewMultiDetailTextItem>(item);
+ base::apple::ObjCCastStrict<TableViewMultiDetailTextItem>(item);
multiDetailTextItem.trailingDetailText = self.homeAddressCountry;
} else if ([self isItemTypeTextEditCell:item.type]) {
// No requirement checks for local profiles.
if (self.accountProfile || self.migrationPrompt ||
self.moveToAccountFromSettings) {
TableViewTextEditItem* tableViewTextEditItem =
- base::mac::ObjCCastStrict<TableViewTextEditItem>(item);
+ base::apple::ObjCCastStrict<TableViewTextEditItem>(item);
[self computeErrorIfRequiredTextField:tableViewTextEditItem];
}
}
diff --git a/ios/chrome/browser/ui/autofill/branding/branding_view_controller.mm b/ios/chrome/browser/ui/autofill/branding/branding_view_controller.mm
index f4a67bf..5debc99 100644
--- a/ios/chrome/browser/ui/autofill/branding/branding_view_controller.mm
+++ b/ios/chrome/browser/ui/autofill/branding/branding_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/autofill/branding/branding_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "base/task/sequenced_task_runner.h"
#import "base/time/time.h"
diff --git a/ios/chrome/browser/ui/autofill/card_expiration_date_fix_flow_view_bridge.mm b/ios/chrome/browser/ui/autofill/card_expiration_date_fix_flow_view_bridge.mm
index e51d443..6cc4976 100644
--- a/ios/chrome/browser/ui/autofill/card_expiration_date_fix_flow_view_bridge.mm
+++ b/ios/chrome/browser/ui/autofill/card_expiration_date_fix_flow_view_bridge.mm
@@ -5,7 +5,7 @@
#import <memory>
#import <string>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/values.h"
#import "components/strings/grit/components_strings.h"
diff --git a/ios/chrome/browser/ui/autofill/card_name_fix_flow_view_bridge.mm b/ios/chrome/browser/ui/autofill/card_name_fix_flow_view_bridge.mm
index f0867fc..6ba0bc7a2 100644
--- a/ios/chrome/browser/ui/autofill/card_name_fix_flow_view_bridge.mm
+++ b/ios/chrome/browser/ui/autofill/card_name_fix_flow_view_bridge.mm
@@ -5,7 +5,7 @@
#import <memory>
#import <string>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/values.h"
#import "components/strings/grit/components_strings.h"
diff --git a/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_controller.mm b/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_controller.mm
index 9b00438..c55970b 100644
--- a/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_controller.mm
+++ b/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/autofill/card_unmask_prompt_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/autofill/core/browser/ui/payments/card_unmask_prompt_controller.h"
#import "components/strings/grit/components_strings.h"
@@ -561,7 +561,7 @@
// When we're about to display the CVC form or expiration date form for
// the first time focus the textField on the right cell.
TableViewTextEditCell* rowCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(cell);
ItemType rowItemType = static_cast<ItemType>(
[self.tableViewModel itemTypeForIndexPath:indexPath]);
@@ -587,7 +587,7 @@
// Update Card link.
if (sectionIdentifier == SectionIdentifierInputs) {
TableViewLinkHeaderFooterView* footerView =
- base::mac::ObjCCast<TableViewLinkHeaderFooterView>(view);
+ base::apple::ObjCCast<TableViewLinkHeaderFooterView>(view);
footerView.delegate = self;
}
@@ -604,7 +604,7 @@
if (rowItemType == ItemTypeCVCInput) {
TableViewTextEditCell* rowCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(cell);
rowCell.textField.delegate = self;
// Hide the icon from Voice Over.
rowCell.identifyingIconButton.isAccessibilityElement = NO;
diff --git a/ios/chrome/browser/ui/autofill/cells/cvc_header_item.mm b/ios/chrome/browser/ui/autofill/cells/cvc_header_item.mm
index 6c58a14..46dd47a 100644
--- a/ios/chrome/browser/ui/autofill/cells/cvc_header_item.mm
+++ b/ios/chrome/browser/ui/autofill/cells/cvc_header_item.mm
@@ -4,7 +4,7 @@
#import "cvc_header_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "build/branding_buildflags.h"
#import "components/grit/components_scaled_resources.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
diff --git a/ios/chrome/browser/ui/autofill/cells/cvc_header_item_unittest.mm b/ios/chrome/browser/ui/autofill/cells/cvc_header_item_unittest.mm
index a1bab78b..cdbb5c0 100644
--- a/ios/chrome/browser/ui/autofill/cells/cvc_header_item_unittest.mm
+++ b/ios/chrome/browser/ui/autofill/cells/cvc_header_item_unittest.mm
@@ -4,7 +4,7 @@
#import "cvc_header_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
@@ -25,7 +25,7 @@
id view = [[[header_item cellClass] alloc] init];
ASSERT_TRUE([view isMemberOfClass:[CVCHeaderView class]]);
- CVCHeaderView* header_view = base::mac::ObjCCastStrict<CVCHeaderView>(view);
+ CVCHeaderView* header_view = base::apple::ObjCCastStrict<CVCHeaderView>(view);
EXPECT_EQ(0U, header_view.instructionsLabel.text.length);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
diff --git a/ios/chrome/browser/ui/autofill/cells/expiration_date_edit_item_unittest.mm b/ios/chrome/browser/ui/autofill/cells/expiration_date_edit_item_unittest.mm
index 96a25597..67cfd9b 100644
--- a/ios/chrome/browser/ui/autofill/cells/expiration_date_edit_item_unittest.mm
+++ b/ios/chrome/browser/ui/autofill/cells/expiration_date_edit_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/autofill/cells/expiration_date_edit_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/ui/autofill/cells/expiration_date_edit_item_delegate.h"
#import "ios/chrome/browser/ui/autofill/expiration_date_picker.h"
@@ -31,7 +31,7 @@
ASSERT_TRUE([view isMemberOfClass:[ExpirationDateEditCell class]]);
ExpirationDateEditCell* cell =
- base::mac::ObjCCastStrict<ExpirationDateEditCell>(view);
+ base::apple::ObjCCastStrict<ExpirationDateEditCell>(view);
EXPECT_EQ(0U, cell.textLabel.text.length);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
@@ -50,7 +50,7 @@
id view = [[[item cellClass] alloc] init];
ExpirationDateEditCell* cell =
- base::mac::ObjCCastStrict<ExpirationDateEditCell>(view);
+ base::apple::ObjCCastStrict<ExpirationDateEditCell>(view);
NSString* month = @"10";
NSString* year = @"9999";
@@ -83,7 +83,7 @@
ASSERT_TRUE([view isMemberOfClass:[ExpirationDateEditCell class]]);
ExpirationDateEditCell* cell =
- base::mac::ObjCCastStrict<ExpirationDateEditCell>(view);
+ base::apple::ObjCCastStrict<ExpirationDateEditCell>(view);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
[item configureCell:cell withStyler:styler];
diff --git a/ios/chrome/browser/ui/autofill/cells/target_account_item.mm b/ios/chrome/browser/ui/autofill/cells/target_account_item.mm
index 890c8c65..90744d1 100644
--- a/ios/chrome/browser/ui/autofill/cells/target_account_item.mm
+++ b/ios/chrome/browser/ui/autofill/cells/target_account_item.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/autofill/cells/target_account_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "build/branding_buildflags.h"
#import "components/grit/components_scaled_resources.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_cell.h"
@@ -37,7 +37,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:cell withStyler:styler];
TargetAccountCell* accountCell =
- base::mac::ObjCCastStrict<TargetAccountCell>(cell);
+ base::apple::ObjCCastStrict<TargetAccountCell>(cell);
accountCell.avatarBadge.image = self.avatar;
accountCell.emailLabel.text = self.email;
}
diff --git a/ios/chrome/browser/ui/autofill/cells/target_account_item_unittest.mm b/ios/chrome/browser/ui/autofill/cells/target_account_item_unittest.mm
index 98816ea..323d4a7 100644
--- a/ios/chrome/browser/ui/autofill/cells/target_account_item_unittest.mm
+++ b/ios/chrome/browser/ui/autofill/cells/target_account_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/autofill/cells/target_account_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
@@ -27,7 +27,7 @@
ASSERT_TRUE([cell isMemberOfClass:[TargetAccountCell class]]);
TargetAccountCell* targetAccountCell =
- base::mac::ObjCCastStrict<TargetAccountCell>(cell);
+ base::apple::ObjCCastStrict<TargetAccountCell>(cell);
EXPECT_FALSE(targetAccountCell.emailLabel.text);
EXPECT_FALSE(targetAccountCell.avatarBadge.image);
diff --git a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_coordinator.mm b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_coordinator.mm
index 11cb613..dfef68a 100644
--- a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_coordinator.mm
+++ b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_coordinator.mm
@@ -6,9 +6,9 @@
#import <vector>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
diff --git a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.mm b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.mm
index e53b043..8dfc54a 100644
--- a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.mm
+++ b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/block_types.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/strings/sys_string_conversions.h"
#import "components/autofill/core/browser/personal_data_manager.h"
diff --git a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_view_controller.mm b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_view_controller.mm
index 49d74dd5..15c0c76 100644
--- a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_view_controller.mm
+++ b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
#import "base/strings/sys_string_conversions.h"
@@ -114,7 +114,7 @@
// The custom view that should be shown in the input accessory view.
- (FormInputAccessoryView*)formInputAccessoryView {
- return base::mac::ObjCCastStrict<FormInputAccessoryView>(self.view);
+ return base::apple::ObjCCastStrict<FormInputAccessoryView>(self.view);
}
#pragma mark - Public
diff --git a/ios/chrome/browser/ui/autofill/form_input_accessory/form_suggestion_view.mm b/ios/chrome/browser/ui/autofill/form_input_accessory/form_suggestion_view.mm
index 7c485c41..0735f2e 100644
--- a/ios/chrome/browser/ui/autofill/form_input_accessory/form_suggestion_view.mm
+++ b/ios/chrome/browser/ui/autofill/form_input_accessory/form_suggestion_view.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/autofill/form_input_accessory/form_suggestion_view.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/i18n/rtl.h"
-#import "base/mac/foundation_util.h"
#import "components/autofill/core/browser/ui/popup_item_ids.h"
#import "components/autofill/ios/browser/form_suggestion.h"
#import "ios/chrome/browser/autofill/form_suggestion_client.h"
diff --git a/ios/chrome/browser/ui/autofill/manual_fill/chip_button.mm b/ios/chrome/browser/ui/autofill/manual_fill/chip_button.mm
index da39915..060fb15 100644
--- a/ios/chrome/browser/ui/autofill/manual_fill/chip_button.mm
+++ b/ios/chrome/browser/ui/autofill/manual_fill/chip_button.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/chip_button.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/common/button_configuration_util.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
diff --git a/ios/chrome/browser/ui/autofill/manual_fill/fallback_view_controller_unittest.mm b/ios/chrome/browser/ui/autofill/manual_fill/fallback_view_controller_unittest.mm
index dadfdc0..d9dd08e 100644
--- a/ios/chrome/browser/ui/autofill/manual_fill/fallback_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/autofill/manual_fill/fallback_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/fallback_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.h"
namespace {
@@ -44,7 +44,7 @@
NSArray<TableViewItem*>* dataItems = @[ itemOne, itemTwo ];
FallbackViewController* fallbackViewController =
- base::mac::ObjCCastStrict<FallbackViewController>(controller());
+ base::apple::ObjCCastStrict<FallbackViewController>(controller());
TableViewItem* itemThree =
[[TableViewItem alloc] initWithType:ItemTypeSampleThree];
@@ -64,15 +64,15 @@
EXPECT_EQ(NumberOfItemsInSection(2), 1);
EXPECT_EQ(
- base::mac::ObjCCastStrict<TableViewItem>(GetTableViewItem(0, 0)).type,
+ base::apple::ObjCCastStrict<TableViewItem>(GetTableViewItem(0, 0)).type,
ItemTypeSampleFour);
EXPECT_EQ(
- base::mac::ObjCCastStrict<TableViewItem>(GetTableViewItem(1, 0)).type,
+ base::apple::ObjCCastStrict<TableViewItem>(GetTableViewItem(1, 0)).type,
ItemTypeSampleOne);
EXPECT_EQ(
- base::mac::ObjCCastStrict<TableViewItem>(GetTableViewItem(1, 1)).type,
+ base::apple::ObjCCastStrict<TableViewItem>(GetTableViewItem(1, 1)).type,
ItemTypeSampleTwo);
EXPECT_EQ(
- base::mac::ObjCCastStrict<TableViewItem>(GetTableViewItem(2, 0)).type,
+ base::apple::ObjCCastStrict<TableViewItem>(GetTableViewItem(2, 0)).type,
ItemTypeSampleThree);
}
diff --git a/ios/chrome/browser/ui/autofill/manual_fill/full_card_requester_unittest.mm b/ios/chrome/browser/ui/autofill/manual_fill/full_card_requester_unittest.mm
index 4aaf4527..43e211a4 100644
--- a/ios/chrome/browser/ui/autofill/manual_fill/full_card_requester_unittest.mm
+++ b/ios/chrome/browser/ui/autofill/manual_fill/full_card_requester_unittest.mm
@@ -6,7 +6,7 @@
#import <string>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/ios/wait_util.h"
#import "base/test/scoped_feature_list.h"
#import "base/time/time.h"
@@ -173,7 +173,7 @@
EXPECT_TRUE([base_view_controller.presentedViewController
isMemberOfClass:[UINavigationController class]]);
UINavigationController* navigation_controller =
- base::mac::ObjCCast<UINavigationController>(
+ base::apple::ObjCCast<UINavigationController>(
base_view_controller.presentedViewController);
EXPECT_TRUE([navigation_controller.topViewController
diff --git a/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_injection_handler.mm b/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_injection_handler.mm
index 418f5da7..0b62b859 100644
--- a/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_injection_handler.mm
+++ b/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_injection_handler.mm
@@ -8,9 +8,9 @@
#import <string>
#import <vector>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/json/string_escape.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/strings/sys_string_conversions.h"
#import "base/values.h"
diff --git a/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_coordinator.mm b/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_coordinator.mm
index 90f6ff8..6fab5cf9 100644
--- a/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_coordinator.mm
+++ b/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "components/keyed_service/core/service_access_type.h"
#import "components/password_manager/core/browser/password_store_interface.h"
#import "ios/chrome/browser/favicon/favicon_loader.h"
diff --git a/ios/chrome/browser/ui/autofill/manual_fill/password_view_controller.mm b/ios/chrome/browser/ui/autofill/manual_fill/password_view_controller.mm
index 308252d..40b86e4 100644
--- a/ios/chrome/browser/ui/autofill/manual_fill/password_view_controller.mm
+++ b/ios/chrome/browser/ui/autofill/manual_fill/password_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/password_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/strings/sys_string_conversions.h"
#import "components/google/core/common/google_util.h"
@@ -119,7 +119,7 @@
case ManualFallbackItemTypeHeader: {
TableViewTextLinkCell* linkCell =
- base::mac::ObjCCastStrict<TableViewTextLinkCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextLinkCell>(cell);
linkCell.delegate = self;
break;
}
@@ -183,13 +183,13 @@
DCHECK(cell);
ManualFillCredentialItem* passwordItem =
- base::mac::ObjCCastStrict<ManualFillCredentialItem>(item);
+ base::apple::ObjCCastStrict<ManualFillCredentialItem>(item);
if (passwordItem.isConnectedToPreviousItem) {
return;
}
ManualFillPasswordCell* passwordCell =
- base::mac::ObjCCastStrict<ManualFillPasswordCell>(cell);
+ base::apple::ObjCCastStrict<ManualFillPasswordCell>(cell);
NSString* itemIdentifier = passwordItem.uniqueIdentifier;
CrURL* crurl = [[CrURL alloc] initWithGURL:passwordItem.faviconURL];
diff --git a/ios/chrome/browser/ui/badges/badge_mediator.mm b/ios/chrome/browser/ui/badges/badge_mediator.mm
index e8fbc85..7e66fbc 100644
--- a/ios/chrome/browser/ui/badges/badge_mediator.mm
+++ b/ios/chrome/browser/ui/badges/badge_mediator.mm
@@ -6,7 +6,7 @@
#import <map>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "ios/chrome/browser/infobars/badge_state.h"
#import "ios/chrome/browser/infobars/infobar_badge_tab_helper.h"
@@ -245,7 +245,7 @@
}
- (void)passwordsBadgeButtonTapped:(id)sender {
- BadgeButton* badgeButton = base::mac::ObjCCastStrict<BadgeButton>(sender);
+ BadgeButton* badgeButton = base::apple::ObjCCastStrict<BadgeButton>(sender);
DCHECK(badgeButton.badgeType == kBadgeTypePasswordSave ||
badgeButton.badgeType == kBadgeTypePasswordUpdate);
@@ -253,28 +253,28 @@
}
- (void)saveAddressProfileBadgeButtonTapped:(id)sender {
- BadgeButton* badgeButton = base::mac::ObjCCastStrict<BadgeButton>(sender);
+ BadgeButton* badgeButton = base::apple::ObjCCastStrict<BadgeButton>(sender);
DCHECK_EQ(badgeButton.badgeType, kBadgeTypeSaveAddressProfile);
[self handleTappedBadgeButton:badgeButton];
}
- (void)saveCardBadgeButtonTapped:(id)sender {
- BadgeButton* badgeButton = base::mac::ObjCCastStrict<BadgeButton>(sender);
+ BadgeButton* badgeButton = base::apple::ObjCCastStrict<BadgeButton>(sender);
DCHECK_EQ(badgeButton.badgeType, kBadgeTypeSaveCard);
[self handleTappedBadgeButton:badgeButton];
}
- (void)translateBadgeButtonTapped:(id)sender {
- BadgeButton* badgeButton = base::mac::ObjCCastStrict<BadgeButton>(sender);
+ BadgeButton* badgeButton = base::apple::ObjCCastStrict<BadgeButton>(sender);
DCHECK_EQ(badgeButton.badgeType, kBadgeTypeTranslate);
[self handleTappedBadgeButton:badgeButton];
}
- (void)permissionsBadgeButtonTapped:(id)sender {
- BadgeButton* badgeButton = base::mac::ObjCCastStrict<BadgeButton>(sender);
+ BadgeButton* badgeButton = base::apple::ObjCCastStrict<BadgeButton>(sender);
DCHECK_EQ(InfobarTypeForBadgeType(badgeButton.badgeType),
InfobarType::kInfobarTypePermissions);
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_earl_grey_ui.mm b/ios/chrome/browser/ui/bookmarks/bookmark_earl_grey_ui.mm
index 81bad44f..1794250 100644
--- a/ios/chrome/browser/ui/bookmarks/bookmark_earl_grey_ui.mm
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_earl_grey_ui.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey_ui.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/test/ios/wait_util.h"
#import "build/build_config.h"
#import "components/strings/grit/components_strings.h"
diff --git a/ios/chrome/browser/ui/bookmarks/bookmarks_coordinator.mm b/ios/chrome/browser/ui/bookmarks/bookmarks_coordinator.mm
index 3ad9e30..857a534 100644
--- a/ios/chrome/browser/ui/bookmarks/bookmarks_coordinator.mm
+++ b/ios/chrome/browser/ui/bookmarks/bookmarks_coordinator.mm
@@ -8,8 +8,8 @@
#import <MaterialComponents/MaterialSnackbar.h>
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/notreached.h"
@@ -373,7 +373,7 @@
for (UIViewController* controller in self.bookmarkNavigationController
.viewControllers) {
BookmarksHomeViewController* bookmarksHomeViewController =
- base::mac::ObjCCastStrict<BookmarksHomeViewController>(controller);
+ base::apple::ObjCCastStrict<BookmarksHomeViewController>(controller);
[bookmarksHomeViewController shutdown];
}
// TODO(crbug.com/940856): Make sure navigaton
@@ -748,7 +748,7 @@
for (UIViewController* controller in self.bookmarkNavigationController
.viewControllers) {
BookmarksHomeViewController* bookmarksHomeViewController =
- base::mac::ObjCCastStrict<BookmarksHomeViewController>(controller);
+ base::apple::ObjCCastStrict<BookmarksHomeViewController>(controller);
[bookmarksHomeViewController willDismissBySwipeDown];
}
}
@@ -775,7 +775,7 @@
toViewController:(UIViewController*)toVC {
if (operation == UINavigationControllerOperationPop) {
BookmarksHomeViewController* poppedHome =
- base::mac::ObjCCastStrict<BookmarksHomeViewController>(fromVC);
+ base::apple::ObjCCastStrict<BookmarksHomeViewController>(fromVC);
// `shutdown` must wait for the next run of the main loop, so that
// methods such as `textFieldDidEndEditing` have time to be run.
dispatch_async(dispatch_get_main_queue(), ^{
diff --git a/ios/chrome/browser/ui/bookmarks/cells/bookmark_home_node_item.mm b/ios/chrome/browser/ui/bookmarks/cells/bookmark_home_node_item.mm
index b82d250..aa5163b 100644
--- a/ios/chrome/browser/ui/bookmarks/cells/bookmark_home_node_item.mm
+++ b/ios/chrome/browser/ui/bookmarks/cells/bookmark_home_node_item.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/bookmarks/cells/bookmark_home_node_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/bookmarks/browser/bookmark_node.h"
#import "components/url_formatter/elide_url.h"
@@ -35,7 +35,7 @@
[super configureCell:cell withStyler:styler];
if (_bookmarkNode->is_folder()) {
TableViewBookmarksFolderCell* bookmarkCell =
- base::mac::ObjCCastStrict<TableViewBookmarksFolderCell>(cell);
+ base::apple::ObjCCastStrict<TableViewBookmarksFolderCell>(cell);
bookmarkCell.folderTitleTextField.text =
bookmark_utils_ios::TitleForBookmarkNode(_bookmarkNode);
bookmarkCell.folderImageView.image =
@@ -48,7 +48,7 @@
bookmarkCell.cloudSlashedView.hidden = !self.shouldDisplayCloudSlashIcon;
} else {
TableViewURLCell* urlCell =
- base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
urlCell.titleLabel.text =
bookmark_utils_ios::TitleForBookmarkNode(_bookmarkNode);
urlCell.URLLabel.text = base::SysUTF16ToNSString(
diff --git a/ios/chrome/browser/ui/bookmarks/cells/bookmark_parent_folder_item.mm b/ios/chrome/browser/ui/bookmarks/cells/bookmark_parent_folder_item.mm
index 0a4097d..94acbe9 100644
--- a/ios/chrome/browser/ui/bookmarks/cells/bookmark_parent_folder_item.mm
+++ b/ios/chrome/browser/ui/bookmarks/cells/bookmark_parent_folder_item.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/bookmarks/cells/bookmark_parent_folder_item.h"
+#import "base/apple/foundation_util.h"
#import "base/i18n/rtl.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/ui/symbols/chrome_icon.h"
#import "ios/chrome/browser/shared/ui/symbols/symbols.h"
@@ -38,7 +38,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:tableCell withStyler:styler];
BookmarkParentFolderCell* cell =
- base::mac::ObjCCastStrict<BookmarkParentFolderCell>(tableCell);
+ base::apple::ObjCCastStrict<BookmarkParentFolderCell>(tableCell);
cell.parentFolderNameLabel.text = self.title;
cell.cloudSlashedView.hidden = !self.shouldDisplayCloudSlashIcon;
}
diff --git a/ios/chrome/browser/ui/bookmarks/cells/bookmark_text_field_item.mm b/ios/chrome/browser/ui/bookmarks/cells/bookmark_text_field_item.mm
index f7a3ef6..c81cf4d 100644
--- a/ios/chrome/browser/ui/bookmarks/cells/bookmark_text_field_item.mm
+++ b/ios/chrome/browser/ui/bookmarks/cells/bookmark_text_field_item.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/bookmarks/cells/bookmark_text_field_item.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_ui_constants.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h"
@@ -35,7 +35,7 @@
[super configureCell:tableCell withStyler:styler];
BookmarkTextFieldCell* cell =
- base::mac::ObjCCastStrict<BookmarkTextFieldCell>(tableCell);
+ base::apple::ObjCCastStrict<BookmarkTextFieldCell>(tableCell);
cell.textField.text = self.text;
cell.titleLabel.text = self.placeholder;
cell.textField.placeholder = self.placeholder;
diff --git a/ios/chrome/browser/ui/bookmarks/cells/table_view_bookmarks_folder_item.mm b/ios/chrome/browser/ui/bookmarks/cells/table_view_bookmarks_folder_item.mm
index 9bf8684..9b19dbe 100644
--- a/ios/chrome/browser/ui/bookmarks/cells/table_view_bookmarks_folder_item.mm
+++ b/ios/chrome/browser/ui/bookmarks/cells/table_view_bookmarks_folder_item.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/bookmarks/cells/table_view_bookmarks_folder_item.h"
+#import "base/apple/foundation_util.h"
#import "base/i18n/rtl.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/ui/symbols/symbols.h"
#import "ios/chrome/browser/shared/ui/util/rtl_geometry.h"
@@ -47,7 +47,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:cell withStyler:styler];
TableViewBookmarksFolderCell* folderCell =
- base::mac::ObjCCastStrict<TableViewBookmarksFolderCell>(cell);
+ base::apple::ObjCCastStrict<TableViewBookmarksFolderCell>(cell);
switch (self.style) {
case BookmarksFolderStyleNewFolder: {
folderCell.folderTitleTextField.text =
diff --git a/ios/chrome/browser/ui/bookmarks/editor/bookmarks_editor_view_controller.mm b/ios/chrome/browser/ui/bookmarks/editor/bookmarks_editor_view_controller.mm
index da5a342..b74241d 100644
--- a/ios/chrome/browser/ui/bookmarks/editor/bookmarks_editor_view_controller.mm
+++ b/ios/chrome/browser/ui/bookmarks/editor/bookmarks_editor_view_controller.mm
@@ -7,11 +7,11 @@
#import <memory>
#import <set>
+#import "base/apple/foundation_util.h"
#import "base/apple/scoped_cftyperef.h"
#import "base/auto_reset.h"
#import "base/check_op.h"
#import "base/ios/block_types.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/strings/sys_string_conversions.h"
@@ -406,7 +406,7 @@
if (section ==
[self.tableViewModel sectionForSectionIdentifier:SectionIdentifierInfo]) {
UITableViewHeaderFooterView* headerFooterView =
- base::mac::ObjCCastStrict<UITableViewHeaderFooterView>(footerView);
+ base::apple::ObjCCastStrict<UITableViewHeaderFooterView>(footerView);
headerFooterView.textLabel.font =
[UIFont preferredFontForTextStyle:UIFontTextStyleCaption1];
headerFooterView.textLabel.textColor = [UIColor colorNamed:kRedColor];
diff --git a/ios/chrome/browser/ui/bookmarks/folder_chooser/bookmarks_folder_chooser_coordinator.mm b/ios/chrome/browser/ui/bookmarks/folder_chooser/bookmarks_folder_chooser_coordinator.mm
index 5fe11f92..8da55d7 100644
--- a/ios/chrome/browser/ui/bookmarks/folder_chooser/bookmarks_folder_chooser_coordinator.mm
+++ b/ios/chrome/browser/ui/bookmarks/folder_chooser/bookmarks_folder_chooser_coordinator.mm
@@ -6,9 +6,9 @@
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/bookmarks/browser/bookmark_model.h"
diff --git a/ios/chrome/browser/ui/bookmarks/folder_chooser/bookmarks_folder_chooser_egtest.mm b/ios/chrome/browser/ui/bookmarks/folder_chooser/bookmarks_folder_chooser_egtest.mm
index 378a97a..6f3afe56 100644
--- a/ios/chrome/browser/ui/bookmarks/folder_chooser/bookmarks_folder_chooser_egtest.mm
+++ b/ios/chrome/browser/ui/bookmarks/folder_chooser/bookmarks_folder_chooser_egtest.mm
@@ -5,9 +5,9 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
+#import "base/apple/foundation_util.h"
#import "base/i18n/message_formatter.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "components/bookmarks/common/bookmark_features.h"
diff --git a/ios/chrome/browser/ui/bookmarks/folder_editor/bookmarks_folder_editor_coordinator.mm b/ios/chrome/browser/ui/bookmarks/folder_editor/bookmarks_folder_editor_coordinator.mm
index 5b5acc9b..c290fa8d 100644
--- a/ios/chrome/browser/ui/bookmarks/folder_editor/bookmarks_folder_editor_coordinator.mm
+++ b/ios/chrome/browser/ui/bookmarks/folder_editor/bookmarks_folder_editor_coordinator.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/bookmarks/folder_editor/bookmarks_folder_editor_coordinator.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/bookmarks/browser/bookmark_node.h"
diff --git a/ios/chrome/browser/ui/bookmarks/folder_editor/bookmarks_folder_editor_view_controller.mm b/ios/chrome/browser/ui/bookmarks/folder_editor/bookmarks_folder_editor_view_controller.mm
index 53298fb..eef07178 100644
--- a/ios/chrome/browser/ui/bookmarks/folder_editor/bookmarks_folder_editor_view_controller.mm
+++ b/ios/chrome/browser/ui/bookmarks/folder_editor/bookmarks_folder_editor_view_controller.mm
@@ -6,10 +6,10 @@
#import <memory>
#import <set>
+#import "base/apple/foundation_util.h"
#import "base/auto_reset.h"
#import "base/check_op.h"
#import "base/i18n/rtl.h"
-#import "base/mac/foundation_util.h"
#import "base/memory/weak_ptr.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
diff --git a/ios/chrome/browser/ui/bookmarks/home/bookmarks_home_mediator.mm b/ios/chrome/browser/ui/bookmarks/home/bookmarks_home_mediator.mm
index a595091..4fdf08ab 100644
--- a/ios/chrome/browser/ui/bookmarks/home/bookmarks_home_mediator.mm
+++ b/ios/chrome/browser/ui/bookmarks/home/bookmarks_home_mediator.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/bookmarks/home/bookmarks_home_mediator.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/bookmarks/browser/bookmark_model.h"
#import "components/bookmarks/browser/bookmark_utils.h"
@@ -577,7 +577,7 @@
for (TableViewItem* item in items) {
if (item.type == BookmarksHomeItemTypeBookmark) {
BookmarksHomeNodeItem* nodeItem =
- base::mac::ObjCCastStrict<BookmarksHomeNodeItem>(item);
+ base::apple::ObjCCastStrict<BookmarksHomeNodeItem>(item);
if (nodeItem.bookmarkNode == bookmarkNode) {
return nodeItem;
}
diff --git a/ios/chrome/browser/ui/bookmarks/home/bookmarks_home_view_controller.mm b/ios/chrome/browser/ui/bookmarks/home/bookmarks_home_view_controller.mm
index 1d7a3a3..7897362 100644
--- a/ios/chrome/browser/ui/bookmarks/home/bookmarks_home_view_controller.mm
+++ b/ios/chrome/browser/ui/bookmarks/home/bookmarks_home_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/bookmarks/home/bookmarks_home_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/numerics/safe_conversions.h"
@@ -621,7 +621,7 @@
return;
}
TableViewURLCell* URLCell =
- base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
[URLCell.faviconView configureWithAttributes:attributes];
};
@@ -652,7 +652,7 @@
(SigninPromoViewConfigurator*)configurator
atIndexPath:(NSIndexPath*)indexPath {
TableViewSigninPromoItem* signinPromoItem =
- base::mac::ObjCCast<TableViewSigninPromoItem>(
+ base::apple::ObjCCast<TableViewSigninPromoItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
if (!signinPromoItem) {
return;
@@ -991,7 +991,7 @@
[weakSelf.navigationController setViewControllers:stack animated:YES];
for (UIViewController* controller in previousStack) {
BookmarksHomeViewController* bookmarksHomeViewController =
- base::mac::ObjCCastStrict<BookmarksHomeViewController>(controller);
+ base::apple::ObjCCastStrict<BookmarksHomeViewController>(controller);
[bookmarksHomeViewController shutdown];
}
};
@@ -1449,7 +1449,7 @@
itemsInSectionWithIdentifier:BookmarksHomeSectionIdentifierBookmarks];
for (TableViewItem* item in items) {
BookmarksHomeNodeItem* nodeItem =
- base::mac::ObjCCastStrict<BookmarksHomeNodeItem>(item);
+ base::apple::ObjCCastStrict<BookmarksHomeNodeItem>(item);
const BookmarkNode* node = nodeItem.bookmarkNode;
if (self.mediator.selectedNodesForEditMode.find(node) !=
self.mediator.selectedNodesForEditMode.end()) {
@@ -1539,7 +1539,7 @@
if (item.type == BookmarksHomeItemTypeBookmark) {
BookmarksHomeNodeItem* nodeItem =
- base::mac::ObjCCastStrict<BookmarksHomeNodeItem>(item);
+ base::apple::ObjCCastStrict<BookmarksHomeNodeItem>(item);
return nodeItem.bookmarkNode;
}
@@ -1873,7 +1873,7 @@
sectionIdentifier:BookmarksHomeSectionIdentifierBookmarks];
for (id path in paths) {
BookmarksHomeNodeItem* node =
- base::mac::ObjCCastStrict<BookmarksHomeNodeItem>(
+ base::apple::ObjCCastStrict<BookmarksHomeNodeItem>(
[self.tableViewModel itemAtIndexPath:path]);
if (node.bookmarkNode == _externalBookmark) {
[self.tableView selectRowAtIndexPath:path
@@ -2367,11 +2367,11 @@
if (item.type == BookmarksHomeItemTypeBookmark) {
BookmarksHomeNodeItem* nodeItem =
- base::mac::ObjCCastStrict<BookmarksHomeNodeItem>(item);
+ base::apple::ObjCCastStrict<BookmarksHomeNodeItem>(item);
if (nodeItem.bookmarkNode->is_folder() &&
nodeItem.bookmarkNode == self.mediator.editingFolderNode) {
TableViewBookmarksFolderCell* tableCell =
- base::mac::ObjCCastStrict<TableViewBookmarksFolderCell>(cell);
+ base::apple::ObjCCastStrict<TableViewBookmarksFolderCell>(cell);
// Delay starting edit, so that the cell is fully created. This is
// needed when scrolling away and then back into the editingCell,
// without the delay the cell will resign first responder before its
@@ -2416,7 +2416,7 @@
// nodes of type URL or Folder, but not the permanent ones. Only enable
// swipe-to-delete if editing bookmarks is allowed.
BookmarksHomeNodeItem* nodeItem =
- base::mac::ObjCCastStrict<BookmarksHomeNodeItem>(item);
+ base::apple::ObjCCastStrict<BookmarksHomeNodeItem>(item);
const BookmarkNode* node = nodeItem.bookmarkNode;
return [self isEditBookmarksEnabled] && [self isUrlOrFolder:node] &&
[self isNodeEditableByUser:node];
@@ -2433,7 +2433,7 @@
if (editingStyle == UITableViewCellEditingStyleDelete) {
BookmarksHomeNodeItem* nodeItem =
- base::mac::ObjCCastStrict<BookmarksHomeNodeItem>(item);
+ base::apple::ObjCCastStrict<BookmarksHomeNodeItem>(item);
const BookmarkNode* node = nodeItem.bookmarkNode;
std::set<const BookmarkNode*> nodes;
nodes.insert(node);
diff --git a/ios/chrome/browser/ui/bring_android_tabs/tab_list_from_android_table_view_item.mm b/ios/chrome/browser/ui/bring_android_tabs/tab_list_from_android_table_view_item.mm
index 64e9c176..19ddd7ba 100644
--- a/ios/chrome/browser/ui/bring_android_tabs/tab_list_from_android_table_view_item.mm
+++ b/ios/chrome/browser/ui/bring_android_tabs/tab_list_from_android_table_view_item.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/bring_android_tabs/tab_list_from_android_table_view_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/url_formatter/elide_url.h"
#import "ios/chrome/browser/net/crurl.h"
@@ -28,7 +28,7 @@
[super configureCell:tableCell withStyler:styler];
TabListFromAndroidTableViewCell* cell =
- base::mac::ObjCCastStrict<TabListFromAndroidTableViewCell>(tableCell);
+ base::apple::ObjCCastStrict<TabListFromAndroidTableViewCell>(tableCell);
cell.titleLabel.text = [self titleLabelText];
cell.URLLabel.text = [self URLLabelText];
cell.cellUniqueIdentifier = self.uniqueIdentifier;
diff --git a/ios/chrome/browser/ui/bring_android_tabs/tab_list_from_android_view_controller.mm b/ios/chrome/browser/ui/bring_android_tabs/tab_list_from_android_view_controller.mm
index 9880b86fe..cd323ce 100644
--- a/ios/chrome/browser/ui/bring_android_tabs/tab_list_from_android_view_controller.mm
+++ b/ios/chrome/browser/ui/bring_android_tabs/tab_list_from_android_view_controller.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/bring_android_tabs/tab_list_from_android_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/i18n/message_formatter.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/net/crurl.h"
#import "ios/chrome/browser/shared/ui/list_model/list_model.h"
@@ -131,9 +131,9 @@
CHECK(item);
CHECK(cell);
TabListFromAndroidTableViewItem* tabListItem =
- base::mac::ObjCCastStrict<TabListFromAndroidTableViewItem>(item);
+ base::apple::ObjCCastStrict<TabListFromAndroidTableViewItem>(item);
TabListFromAndroidTableViewCell* tabListCell =
- base::mac::ObjCCastStrict<TabListFromAndroidTableViewCell>(cell);
+ base::apple::ObjCCastStrict<TabListFromAndroidTableViewCell>(cell);
NSString* itemIdentifier = tabListItem.uniqueIdentifier;
[_faviconDataSource
diff --git a/ios/chrome/browser/ui/broadcaster/chrome_broadcaster.mm b/ios/chrome/browser/ui/broadcaster/chrome_broadcaster.mm
index fa082cf..00fa83ec 100644
--- a/ios/chrome/browser/ui/broadcaster/chrome_broadcaster.mm
+++ b/ios/chrome/browser/ui/broadcaster/chrome_broadcaster.mm
@@ -7,9 +7,9 @@
#import <objc/runtime.h>
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/ios/crb_protocol_observers.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
namespace {
@@ -268,9 +268,9 @@
// If strings or other non-value types are being broadcast, then this will
// need to change. Either value will be nil if they aren't actually NSValues.
NSValue* newValue =
- base::mac::ObjCCast<NSValue>(change[NSKeyValueChangeNewKey]);
+ base::apple::ObjCCast<NSValue>(change[NSKeyValueChangeNewKey]);
NSValue* oldValue =
- base::mac::ObjCCast<NSValue>(change[NSKeyValueChangeOldKey]);
+ base::apple::ObjCCast<NSValue>(change[NSKeyValueChangeOldKey]);
// If the value is unchanged -- if the old and new values are equal -- then
// return without notifying observers.
@@ -295,7 +295,7 @@
NSInvocation* invocation = self.observerInvocations[name];
// Attempt to cast `value` into an NSNumber; ObjCCast will instead return
// nil if this isn't possible.
- NSNumber* valueAsNumber = base::mac::ObjCCast<NSNumber>(value);
+ NSNumber* valueAsNumber = base::apple::ObjCCast<NSNumber>(value);
std::string type([invocation.methodSignature getArgumentTypeAtIndex:2]);
if (type == @encode(BOOL)) {
diff --git a/ios/chrome/browser/ui/browser_container/browser_container_coordinator_unittest.mm b/ios/chrome/browser/ui/browser_container/browser_container_coordinator_unittest.mm
index 3f5be0c..978d9bc 100644
--- a/ios/chrome/browser/ui/browser_container/browser_container_coordinator_unittest.mm
+++ b/ios/chrome/browser/ui/browser_container/browser_container_coordinator_unittest.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/task_environment.h"
#import "ios/chrome/browser/shared/model/browser/test/test_browser.h"
#import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h"
@@ -90,7 +90,7 @@
EXPECT_TRUE([coordinator.viewController.presentedViewController
isKindOfClass:[UIAlertController class]]);
UIAlertController* alert_controller =
- base::mac::ObjCCastStrict<UIAlertController>(
+ base::apple::ObjCCastStrict<UIAlertController>(
coordinator.viewController.presentedViewController);
ASSERT_EQ(2LU, alert_controller.actions.count);
diff --git a/ios/chrome/browser/ui/browser_container/edit_menu_app_interface.mm b/ios/chrome/browser/ui/browser_container/edit_menu_app_interface.mm
index 500fd771..273a232e 100644
--- a/ios/chrome/browser/ui/browser_container/edit_menu_app_interface.mm
+++ b/ios/chrome/browser/ui/browser_container/edit_menu_app_interface.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/browser_container/edit_menu_app_interface.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/app/chrome_test_util.h"
#import "ios/chrome/test/app/tab_test_util.h"
@@ -145,7 +145,7 @@
NSMutableArray* menuElements = [NSMutableArray array];
for (UIScene* scene in UIApplication.sharedApplication.connectedScenes) {
UIWindowScene* windowScene =
- base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ base::apple::ObjCCastStrict<UIWindowScene>(scene);
for (UIWindow* window in windowScene.windows) {
if ([window isKindOfClass:NSClassFromString(@"ChromeOverlayWindow")]) {
continue;
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
index 7247446..2c4137d 100644
--- a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
@@ -6,8 +6,8 @@
#import "ios/chrome/browser/ui/browser_view/browser_view_controller+private.h"
#import "base/apple/bundle_locations.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/task/sequenced_task_runner.h"
#import "components/signin/public/identity_manager/identity_manager.h"
@@ -1207,7 +1207,7 @@
if (firstRunLaunch &&
[viewControllerToPresent isKindOfClass:[UINavigationController class]]) {
UINavigationController* navController =
- base::mac::ObjCCastStrict<UINavigationController>(
+ base::apple::ObjCCastStrict<UINavigationController>(
viewControllerToPresent);
if ([navController.topViewController
isKindOfClass:[PromoStyleViewController class]]) {
@@ -1219,7 +1219,8 @@
owner:self
options:nil];
UIViewController* launchScreenController =
- base::mac::ObjCCastStrict<UIViewController>([topObjects lastObject]);
+ base::apple::ObjCCastStrict<UIViewController>(
+ [topObjects lastObject]);
// `launchScreenView` is loaded as an autoreleased object, and is retained
// by the `completion` block below.
UIView* launchScreenView = launchScreenController.view;
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller_unittest.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller_unittest.mm
index 101a3b56..91bafdf3 100644
--- a/ios/chrome/browser/ui/browser_view/browser_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/browser_view/browser_view_controller_unittest.mm
@@ -10,7 +10,7 @@
#import <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/scoped_feature_list.h"
#import "components/content_settings/core/browser/host_content_settings_map.h"
#import "components/open_from_clipboard/fake_clipboard_recent_content.h"
@@ -406,7 +406,7 @@
id OCMArgWithContentView(UIView* (^expected_view)()) {
return [OCMArg checkWithBlock:^(UIView* view) {
UIView* content_view =
- base::mac::ObjCCast<ForegroundTabAnimationView>(view).contentView;
+ base::apple::ObjCCast<ForegroundTabAnimationView>(view).contentView;
return content_view == expected_view();
}];
}
diff --git a/ios/chrome/browser/ui/bubble/bubble_unittest_util.mm b/ios/chrome/browser/ui/bubble/bubble_unittest_util.mm
index 82820ff..7d16bab 100644
--- a/ios/chrome/browser/ui/bubble/bubble_unittest_util.mm
+++ b/ios/chrome/browser/ui/bubble/bubble_unittest_util.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/bubble/bubble_unittest_util.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
UIView* GetViewOfClassWithIdentifier(Class uiClass,
NSString* accessibilityIdentifier,
@@ -19,22 +19,22 @@
}
UIButton* GetCloseButtonFromBubbleView(BubbleView* bubbleView) {
- return base::mac::ObjCCastStrict<UIButton>(GetViewOfClassWithIdentifier(
+ return base::apple::ObjCCastStrict<UIButton>(GetViewOfClassWithIdentifier(
[UIButton class], kBubbleViewCloseButtonIdentifier, bubbleView));
}
UILabel* GetTitleLabelFromBubbleView(BubbleView* bubbleView) {
- return base::mac::ObjCCastStrict<UILabel>(GetViewOfClassWithIdentifier(
+ return base::apple::ObjCCastStrict<UILabel>(GetViewOfClassWithIdentifier(
[UILabel class], kBubbleViewTitleLabelIdentifier, bubbleView));
}
UIImageView* GetImageViewFromBubbleView(BubbleView* bubbleView) {
- return base::mac::ObjCCastStrict<UIImageView>(GetViewOfClassWithIdentifier(
+ return base::apple::ObjCCastStrict<UIImageView>(GetViewOfClassWithIdentifier(
[UIImageView class], kBubbleViewImageViewIdentifier, bubbleView));
}
UIButton* GetSnoozeButtonFromBubbleView(BubbleView* bubbleView) {
- return base::mac::ObjCCastStrict<UIButton>(GetViewOfClassWithIdentifier(
+ return base::apple::ObjCCastStrict<UIButton>(GetViewOfClassWithIdentifier(
[UIButton class], kBubbleViewSnoozeButtonIdentifier, bubbleView));
}
diff --git a/ios/chrome/browser/ui/bubble/bubble_view_controller_presenter_unittest.mm b/ios/chrome/browser/ui/bubble/bubble_view_controller_presenter_unittest.mm
index 032db781..ca8e649 100644
--- a/ios/chrome/browser/ui/bubble/bubble_view_controller_presenter_unittest.mm
+++ b/ios/chrome/browser/ui/bubble/bubble_view_controller_presenter_unittest.mm
@@ -4,7 +4,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/ui/bubble/bubble_unittest_util.h"
#import "ios/chrome/browser/ui/bubble/bubble_view.h"
#import "ios/chrome/browser/ui/bubble/bubble_view_controller.h"
@@ -194,7 +194,7 @@
presentInViewController:parentViewController_
view:parentViewController_.view
anchorPoint:anchorPoint_];
- BubbleView* bubbleView = base::mac::ObjCCastStrict<BubbleView>(
+ BubbleView* bubbleView = base::apple::ObjCCastStrict<BubbleView>(
bubbleViewControllerPresenter_.bubbleViewController.view);
EXPECT_TRUE(bubbleView);
UIButton* closeButton = GetCloseButtonFromBubbleView(bubbleView);
@@ -214,7 +214,7 @@
presentInViewController:parentViewController_
view:parentViewController_.view
anchorPoint:anchorPoint_];
- BubbleView* bubbleView = base::mac::ObjCCastStrict<BubbleView>(
+ BubbleView* bubbleView = base::apple::ObjCCastStrict<BubbleView>(
bubbleViewControllerPresenter_.bubbleViewController.view);
EXPECT_TRUE(bubbleView);
UIButton* snoozeButton = GetSnoozeButtonFromBubbleView(bubbleView);
diff --git a/ios/chrome/browser/ui/bubble/bubble_view_controller_unittest.mm b/ios/chrome/browser/ui/bubble/bubble_view_controller_unittest.mm
index 916452e..1b707e2 100644
--- a/ios/chrome/browser/ui/bubble/bubble_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/bubble/bubble_view_controller_unittest.mm
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#import "ios/chrome/browser/ui/bubble/bubble_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/ui/bubble/bubble_unittest_util.h"
#import "ios/chrome/browser/ui/bubble/bubble_view.h"
#import "testing/gtest/include/gtest/gtest.h"
@@ -40,7 +40,7 @@
BOOL expectImage,
BOOL expectSnoozeButton) {
BubbleView* bubbleView =
- base::mac::ObjCCastStrict<BubbleView>(bubbleViewController.view);
+ base::apple::ObjCCastStrict<BubbleView>(bubbleViewController.view);
EXPECT_TRUE(bubbleView);
UIView* closeButton = GetCloseButtonFromBubbleView(bubbleView);
UIView* titleView = GetTitleLabelFromBubbleView(bubbleView);
diff --git a/ios/chrome/browser/ui/bubble/bubble_view_unittest.mm b/ios/chrome/browser/ui/bubble/bubble_view_unittest.mm
index 3334d8e..7cf7c8ad 100644
--- a/ios/chrome/browser/ui/bubble/bubble_view_unittest.mm
+++ b/ios/chrome/browser/ui/bubble/bubble_view_unittest.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/bubble/bubble_view.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/ui/bubble/bubble_unittest_util.h"
#import "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm
index a05cca2..179725d4 100644
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm
@@ -6,9 +6,9 @@
#import <vector>
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/strings/sys_string_conversions.h"
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm
index 6243ae4..292f299 100644
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm
@@ -5,9 +5,9 @@
#import <memory>
#import <vector>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "base/test/ios/wait_util.h"
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm
index 612a7861..0fd08a49a 100644
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm
@@ -7,9 +7,9 @@
#import <AuthenticationServices/AuthenticationServices.h>
#import <MaterialComponents/MaterialSnackbar.h>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/functional/callback.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
@@ -479,7 +479,7 @@
// tiles.
if ([item isKindOfClass:[ContentSuggestionsMostVisitedActionItem class]]) {
ContentSuggestionsMostVisitedActionItem* mostVisitedItem =
- base::mac::ObjCCastStrict<ContentSuggestionsMostVisitedActionItem>(
+ base::apple::ObjCCastStrict<ContentSuggestionsMostVisitedActionItem>(
item);
if (mostVisitedItem.disabled) {
return;
@@ -513,7 +513,7 @@
}
ContentSuggestionsMostVisitedItem* mostVisitedItem =
- base::mac::ObjCCastStrict<ContentSuggestionsMostVisitedItem>(item);
+ base::apple::ObjCCastStrict<ContentSuggestionsMostVisitedItem>(item);
[self logMostVisitedOpening:mostVisitedItem atIndex:mostVisitedIndex];
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_metrics_recorder.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_metrics_recorder.mm
index 8a5775b..d7c022a9 100644
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_metrics_recorder.mm
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_metrics_recorder.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_metrics_recorder.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
@@ -203,7 +203,7 @@
favicon_base::IconType icon_type = favicon_base::IconType::kInvalid;
if (attributes.faviconImage) {
FaviconAttributesWithPayload* favicon_attributes =
- base::mac::ObjCCastStrict<FaviconAttributesWithPayload>(attributes);
+ base::apple::ObjCCastStrict<FaviconAttributesWithPayload>(attributes);
icon_type = favicon_attributes.iconType;
}
return icon_type;
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
index 313f8695..9bab22e0 100644
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/segmentation_platform/public/features.h"
diff --git a/ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion_identifier.mm b/ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion_identifier.mm
index 9bce7023..fe8ccb4 100644
--- a/ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion_identifier.mm
+++ b/ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion_identifier.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion_identifier.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
@implementation ContentSuggestionIdentifier
@@ -23,7 +23,7 @@
}
ContentSuggestionIdentifier* other =
- base::mac::ObjCCastStrict<ContentSuggestionIdentifier>(object);
+ base::apple::ObjCCastStrict<ContentSuggestionIdentifier>(object);
return self.sectionInfo == other.sectionInfo &&
self.IDInSection == other.IDInSection;
diff --git a/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm b/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm
index 04e6c81b..c1d451e 100644
--- a/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm
+++ b/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/feed/core/v2/public/ios/pref_names.h"
#import "components/strings/grit/components_strings.h"
diff --git a/ios/chrome/browser/ui/content_suggestions/ntp_home_test_utils.mm b/ios/chrome/browser/ui/content_suggestions/ntp_home_test_utils.mm
index c6a3f689..f8ea4d6 100644
--- a/ios/chrome/browser/ui/content_suggestions/ntp_home_test_utils.mm
+++ b/ios/chrome/browser/ui/content_suggestions/ntp_home_test_utils.mm
@@ -6,8 +6,8 @@
#import <string>
+#import "base/apple/foundation_util.h"
#import "base/functional/callback.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/utf_string_conversions.h"
#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_constants.h"
#import "ios/chrome/browser/ui/content_suggestions/ntp_home_constant.h"
@@ -40,8 +40,9 @@
// Returns the SetUpListView, if present.
SetUpListView* GetSetUpListView() {
- return base::mac::ObjCCast<SetUpListView>(SubviewWithAccessibilityIdentifier(
- set_up_list::kAccessibilityID, GetAnyKeyWindow()));
+ return base::apple::ObjCCast<SetUpListView>(
+ SubviewWithAccessibilityIdentifier(set_up_list::kAccessibilityID,
+ GetAnyKeyWindow()));
}
} // namespace
@@ -49,13 +50,13 @@
namespace ntp_home {
UICollectionView* CollectionView() {
- return base::mac::ObjCCast<UICollectionView>(
+ return base::apple::ObjCCast<UICollectionView>(
SubviewWithAccessibilityIdentifier(kNTPCollectionViewIdentifier,
GetAnyKeyWindow()));
}
UICollectionView* ContentSuggestionsCollectionView() {
- return base::mac::ObjCCast<UICollectionView>(
+ return base::apple::ObjCCast<UICollectionView>(
SubviewWithAccessibilityIdentifier(
kContentSuggestionsCollectionIdentifier, GetAnyKeyWindow()));
}
@@ -66,13 +67,13 @@
}
UILabel* DiscoverHeaderLabel() {
- return base::mac::ObjCCast<UILabel>(SubviewWithAccessibilityIdentifier(
+ return base::apple::ObjCCast<UILabel>(SubviewWithAccessibilityIdentifier(
DiscoverHeaderTitleAccessibilityID(), GetAnyKeyWindow()));
}
SetUpListItemView* SetUpListItemViewWithAccessibilityId(
NSString* accessibility_id) {
- return base::mac::ObjCCast<SetUpListItemView>(
+ return base::apple::ObjCCast<SetUpListItemView>(
SubviewWithAccessibilityIdentifier(accessibility_id, GetSetUpListView()));
}
diff --git a/ios/chrome/browser/ui/context_menu/context_menu_egtest.mm b/ios/chrome/browser/ui/context_menu/context_menu_egtest.mm
index ae8a1174..22a572bd 100644
--- a/ios/chrome/browser/ui/context_menu/context_menu_egtest.mm
+++ b/ios/chrome/browser/ui/context_menu/context_menu_egtest.mm
@@ -5,8 +5,8 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "components/strings/grit/components_strings.h"
diff --git a/ios/chrome/browser/ui/download/download_manager_coordinator_unittest.mm b/ios/chrome/browser/ui/download/download_manager_coordinator_unittest.mm
index 923505b8..86eaba1 100644
--- a/ios/chrome/browser/ui/download/download_manager_coordinator_unittest.mm
+++ b/ios/chrome/browser/ui/download/download_manager_coordinator_unittest.mm
@@ -8,8 +8,8 @@
#import <StoreKit/StoreKit.h>
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/files/file_util.h"
-#import "base/mac/foundation_util.h"
#import "base/run_loop.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
@@ -455,7 +455,7 @@
[invocation getArgument:&object atIndex:2];
EXPECT_EQ([UIActivityViewController class], [object class]);
UIActivityViewController* open_in_controller =
- base::mac::ObjCCastStrict<UIActivityViewController>(object);
+ base::apple::ObjCCastStrict<UIActivityViewController>(object);
EXPECT_EQ(open_in_controller.excludedActivityTypes.count, 2.0);
});
diff --git a/ios/chrome/browser/ui/download/download_manager_mediator.mm b/ios/chrome/browser/ui/download/download_manager_mediator.mm
index 18434b07..84dc262 100644
--- a/ios/chrome/browser/ui/download/download_manager_mediator.mm
+++ b/ios/chrome/browser/ui/download/download_manager_mediator.mm
@@ -6,10 +6,10 @@
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/files/file_path.h"
#import "base/files/file_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "base/task/thread_pool.h"
#import "ios/chrome/browser/download/download_directory_util.h"
#import "ios/chrome/browser/download/external_app_util.h"
@@ -91,7 +91,7 @@
[consumer_ setProgress:GetDownloadManagerProgress()];
base::FilePath filename = task_->GenerateFileName();
- [consumer_ setFileName:base::mac::FilePathToNSString(filename)];
+ [consumer_ setFileName:base::apple::FilePathToNSString(filename)];
int a11y_announcement = GetDownloadManagerA11yAnnouncement();
if (a11y_announcement != -1) {
diff --git a/ios/chrome/browser/ui/download/download_manager_mediator_unittest.mm b/ios/chrome/browser/ui/download/download_manager_mediator_unittest.mm
index 4dfb61cc..e85cecd 100644
--- a/ios/chrome/browser/ui/download/download_manager_mediator_unittest.mm
+++ b/ios/chrome/browser/ui/download/download_manager_mediator_unittest.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/run_loop.h"
#import "base/test/ios/wait_util.h"
#import "ios/chrome/browser/download/download_directory_util.h"
@@ -153,7 +153,7 @@
EXPECT_EQ(kDownloadManagerStateSucceeded, consumer_.state);
EXPECT_FALSE(consumer_.installDriveButtonVisible);
EXPECT_EQ(base::FilePath(kTestSuggestedFileName),
- base::mac::NSStringToFilePath(consumer_.fileName));
+ base::apple::NSStringToFilePath(consumer_.fileName));
EXPECT_EQ(kTestTotalBytes, consumer_.countOfBytesExpectedToReceive);
EXPECT_EQ(kTestReceivedBytes, consumer_.countOfBytesReceived);
EXPECT_FLOAT_EQ(0.8f, consumer_.progress);
diff --git a/ios/chrome/browser/ui/download/radial_progress_view.mm b/ios/chrome/browser/ui/download/radial_progress_view.mm
index 56db63d..5d35d06 100644
--- a/ios/chrome/browser/ui/download/radial_progress_view.mm
+++ b/ios/chrome/browser/ui/download/radial_progress_view.mm
@@ -6,7 +6,7 @@
#import <QuartzCore/QuartzCore.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
@interface RadialProgressView ()
@@ -98,7 +98,7 @@
}
- (CAShapeLayer*)trackLayer {
- return base::mac::ObjCCastStrict<CAShapeLayer>(self.layer);
+ return base::apple::ObjCCastStrict<CAShapeLayer>(self.layer);
}
- (CAShapeLayer*)progressLayer {
diff --git a/ios/chrome/browser/ui/find_bar/find_bar_controller_ios.mm b/ios/chrome/browser/ui/find_bar/find_bar_controller_ios.mm
index ca1fb05..2a53a31 100644
--- a/ios/chrome/browser/ui/find_bar/find_bar_controller_ios.mm
+++ b/ios/chrome/browser/ui/find_bar/find_bar_controller_ios.mm
@@ -5,9 +5,9 @@
#import "ios/chrome/browser/ui/find_bar/find_bar_controller_ios.h"
#import "base/apple/bundle_locations.h"
+#import "base/apple/foundation_util.h"
#import "base/format_macros.h"
#import "base/i18n/rtl.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/find_in_page/constants.h"
diff --git a/ios/chrome/browser/ui/find_bar/find_bar_view_controller.mm b/ios/chrome/browser/ui/find_bar/find_bar_view_controller.mm
index 9808aba..0b8d345 100644
--- a/ios/chrome/browser/ui/find_bar/find_bar_view_controller.mm
+++ b/ios/chrome/browser/ui/find_bar/find_bar_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/find_bar/find_bar_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "ios/chrome/browser/ui/find_bar/find_bar_view.h"
@@ -37,7 +37,7 @@
#pragma mark - Property Getters
- (FindBarView*)findBarView {
- return base::mac::ObjCCastStrict<FindBarView>(self.view);
+ return base::apple::ObjCCastStrict<FindBarView>(self.view);
}
#pragma mark - UIResponder
diff --git a/ios/chrome/browser/ui/first_run/signin/signin_screen_coordinator.mm b/ios/chrome/browser/ui/first_run/signin/signin_screen_coordinator.mm
index d0b4dbd..4d7385d 100644
--- a/ios/chrome/browser/ui/first_run/signin/signin_screen_coordinator.mm
+++ b/ios/chrome/browser/ui/first_run/signin/signin_screen_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/first_run/signin/signin_screen_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/first_run/first_run_metrics.h"
#import "ios/chrome/browser/shared/model/application_context/application_context.h"
diff --git a/ios/chrome/browser/ui/first_run/uma/uma_coordinator.mm b/ios/chrome/browser/ui/first_run/uma/uma_coordinator.mm
index bd2ae349..8a4aa42 100644
--- a/ios/chrome/browser/ui/first_run/uma/uma_coordinator.mm
+++ b/ios/chrome/browser/ui/first_run/uma/uma_coordinator.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/first_run/uma/uma_coordinator.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/table_view_utils.h"
#import "ios/chrome/browser/ui/first_run/uma/uma_table_view_controller.h"
diff --git a/ios/chrome/browser/ui/first_run/uma/uma_table_view_controller.mm b/ios/chrome/browser/ui/first_run/uma/uma_table_view_controller.mm
index c975d42..5afa82d 100644
--- a/ios/chrome/browser/ui/first_run/uma/uma_table_view_controller.mm
+++ b/ios/chrome/browser/ui/first_run/uma/uma_table_view_controller.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/first_run/uma/uma_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "components/sync/base/features.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_attributed_string_header_footer_item.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_switch_cell.h"
@@ -95,7 +95,7 @@
NSIndexPath* indexPath = [model indexPathForItemType:sender.tag];
DCHECK(indexPath);
TableViewSwitchItem* switchItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(
[model itemAtIndexPath:indexPath]);
DCHECK(switchItem);
self.UMAReportingUserChoice = sender.isOn;
@@ -109,7 +109,7 @@
cellForRowAtIndexPath:indexPath];
if ([cell isKindOfClass:[TableViewSwitchCell class]]) {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(switchAction:)
forControlEvents:UIControlEventValueChanged];
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_web_view_resizer.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_web_view_resizer.mm
index e6d7a1284..4870d5bad 100644
--- a/ios/chrome/browser/ui/fullscreen/fullscreen_web_view_resizer.mm
+++ b/ios/chrome/browser/ui/fullscreen/fullscreen_web_view_resizer.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/fullscreen/fullscreen_web_view_resizer.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/model/url/chrome_url_constants.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
#import "ios/chrome/browser/ui/fullscreen/fullscreen_model.h"
@@ -166,9 +166,9 @@
if (!base::FeatureList::IsEnabled(web::features::kSmoothScrollingDefault)) {
NSValue* oldValue =
- base::mac::ObjCCast<NSValue>(change[NSKeyValueChangeOldKey]);
+ base::apple::ObjCCast<NSValue>(change[NSKeyValueChangeOldKey]);
NSValue* newValue =
- base::mac::ObjCCast<NSValue>(change[NSKeyValueChangeNewKey]);
+ base::apple::ObjCCast<NSValue>(change[NSKeyValueChangeNewKey]);
// If the value is unchanged -- if the old and new values are equal --
// then return without notifying observers.
if (oldValue && newValue && [newValue isEqualToValue:oldValue]) {
diff --git a/ios/chrome/browser/ui/history/history_clear_browsing_data_coordinator.mm b/ios/chrome/browser/ui/history/history_clear_browsing_data_coordinator.mm
index bb20397..b7c8422 100644
--- a/ios/chrome/browser/ui/history/history_clear_browsing_data_coordinator.mm
+++ b/ios/chrome/browser/ui/history/history_clear_browsing_data_coordinator.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/model/browser/browser.h"
#import "ios/chrome/browser/shared/ui/table_view/table_view_navigation_controller.h"
#import "ios/chrome/browser/ui/history/history_clear_browsing_data_coordinator_delegate.h"
diff --git a/ios/chrome/browser/ui/history/history_entry_inserter.mm b/ios/chrome/browser/ui/history/history_entry_inserter.mm
index c2d2680..056bcf5 100644
--- a/ios/chrome/browser/ui/history/history_entry_inserter.mm
+++ b/ios/chrome/browser/ui/history/history_entry_inserter.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/history/history_entry_inserter.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/time/time.h"
#import "ios/chrome/browser/shared/ui/list_model/list_model.h"
@@ -47,9 +47,9 @@
NSComparator objectComparator = ^(id obj1, id obj2) {
ListItem<HistoryEntryItemInterface>* firstObject =
- base::mac::ObjCCastStrict<ListItem<HistoryEntryItemInterface>>(obj1);
+ base::apple::ObjCCastStrict<ListItem<HistoryEntryItemInterface>>(obj1);
ListItem<HistoryEntryItemInterface>* secondObject =
- base::mac::ObjCCastStrict<ListItem<HistoryEntryItemInterface>>(obj2);
+ base::apple::ObjCCastStrict<ListItem<HistoryEntryItemInterface>>(obj2);
if ([firstObject isEqual:secondObject])
return NSOrderedSame;
diff --git a/ios/chrome/browser/ui/history/history_entry_inserter_unittest.mm b/ios/chrome/browser/ui/history/history_entry_inserter_unittest.mm
index 4cd056f2..e6247a6 100644
--- a/ios/chrome/browser/ui/history/history_entry_inserter_unittest.mm
+++ b/ios/chrome/browser/ui/history/history_entry_inserter_unittest.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/history/history_entry_inserter.h"
+#import "base/apple/foundation_util.h"
#import "base/i18n/time_formatting.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "base/time/time.h"
@@ -95,7 +95,7 @@
EXPECT_EQ(3, [model_ numberOfItemsInSection:1]);
NSArray<HistoryEntryItem*>* section_1 =
- base::mac::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
+ base::apple::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
[model_ itemsInSectionWithIdentifier:kSectionIdentifierEnumZero + 1]);
EXPECT_NSEQ(@"entry1", section_1[0].text);
EXPECT_NSEQ(@"entry2", section_1[1].text);
@@ -129,7 +129,7 @@
EXPECT_EQ(0, [model_ numberOfItemsInSection:0]);
EXPECT_EQ(1, [model_ numberOfItemsInSection:1]);
NSArray<HistoryEntryItem*>* section_1 =
- base::mac::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
+ base::apple::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
[model_ itemsInSectionWithIdentifier:day2_identifier]);
EXPECT_NSEQ(@"day2_entry2", section_1[0].text);
EXPECT_OCMOCK_VERIFY(mock_delegate);
@@ -145,11 +145,11 @@
EXPECT_EQ(0, [model_ numberOfItemsInSection:0]);
EXPECT_EQ(1, [model_ numberOfItemsInSection:1]);
EXPECT_EQ(1, [model_ numberOfItemsInSection:2]);
- section_1 = base::mac::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
+ section_1 = base::apple::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
[model_ itemsInSectionWithIdentifier:day1_identifier]);
EXPECT_NSEQ(@"day1", section_1[0].text);
NSArray<HistoryEntryItem*>* section_2 =
- base::mac::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
+ base::apple::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
[model_ itemsInSectionWithIdentifier:day2_identifier]);
EXPECT_NSEQ(@"day2_entry2", section_2[0].text);
EXPECT_OCMOCK_VERIFY(mock_delegate);
@@ -166,14 +166,14 @@
EXPECT_EQ(1, [model_ numberOfItemsInSection:1]);
EXPECT_EQ(1, [model_ numberOfItemsInSection:2]);
EXPECT_EQ(1, [model_ numberOfItemsInSection:3]);
- section_1 = base::mac::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
+ section_1 = base::apple::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
[model_ itemsInSectionWithIdentifier:day1_identifier]);
EXPECT_NSEQ(@"day1", section_1[0].text);
- section_2 = base::mac::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
+ section_2 = base::apple::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
[model_ itemsInSectionWithIdentifier:day2_identifier]);
EXPECT_NSEQ(@"day2_entry2", section_2[0].text);
NSArray<HistoryEntryItem*>* section_3 =
- base::mac::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
+ base::apple::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
[model_ itemsInSectionWithIdentifier:day3_identifier]);
EXPECT_NSEQ(@"day3", section_3[0].text);
EXPECT_OCMOCK_VERIFY(mock_delegate);
@@ -187,14 +187,14 @@
EXPECT_EQ(1, [model_ numberOfItemsInSection:1]);
EXPECT_EQ(2, [model_ numberOfItemsInSection:2]);
EXPECT_EQ(1, [model_ numberOfItemsInSection:3]);
- section_1 = base::mac::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
+ section_1 = base::apple::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
[model_ itemsInSectionWithIdentifier:day1_identifier]);
EXPECT_NSEQ(@"day1", section_1[0].text);
- section_2 = base::mac::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
+ section_2 = base::apple::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
[model_ itemsInSectionWithIdentifier:day2_identifier]);
EXPECT_NSEQ(@"day2_entry1", section_2[0].text);
EXPECT_NSEQ(@"day2_entry2", section_2[1].text);
- section_3 = base::mac::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
+ section_3 = base::apple::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
[model_ itemsInSectionWithIdentifier:day3_identifier]);
EXPECT_NSEQ(@"day3", section_3[0].text);
EXPECT_OCMOCK_VERIFY(mock_delegate);
@@ -220,7 +220,7 @@
EXPECT_EQ(1, [model_ numberOfItemsInSection:1]);
NSArray<HistoryEntryItem*>* section_1 =
- base::mac::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
+ base::apple::ObjCCastStrict<NSArray<HistoryEntryItem*>>(
[model_ itemsInSectionWithIdentifier:kSectionIdentifierEnumZero + 1]);
EXPECT_NSEQ(@"entry", section_1[0].text);
EXPECT_OCMOCK_VERIFY(mock_delegate);
diff --git a/ios/chrome/browser/ui/history/history_entry_item.mm b/ios/chrome/browser/ui/history/history_entry_item.mm
index c951f60..79e3164 100644
--- a/ios/chrome/browser/ui/history/history_entry_item.mm
+++ b/ios/chrome/browser/ui/history/history_entry_item.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/history/history_entry_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/history/core/browser/browsing_history_service.h"
#import "components/strings/grit/components_strings.h"
@@ -47,7 +47,7 @@
[super configureCell:tableCell withStyler:styler];
TableViewURLCell* cell =
- base::mac::ObjCCastStrict<TableViewURLCell>(tableCell);
+ base::apple::ObjCCastStrict<TableViewURLCell>(tableCell);
cell.cellUniqueIdentifier = self.uniqueIdentifier;
cell.titleLabel.text = self.text;
cell.URLLabel.text = self.detailText;
diff --git a/ios/chrome/browser/ui/history/history_table_view_controller.mm b/ios/chrome/browser/ui/history/history_table_view_controller.mm
index b8458196..ff2b595 100644
--- a/ios/chrome/browser/ui/history/history_table_view_controller.mm
+++ b/ios/chrome/browser/ui/history/history_table_view_controller.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/history/history_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/i18n/time_formatting.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/strings/sys_string_conversions.h"
@@ -515,7 +515,7 @@
// Delete items from Browser History.
std::vector<BrowsingHistoryService::HistoryEntry> entries;
for (NSIndexPath* indexPath in toDeleteIndexPaths) {
- HistoryEntryItem* object = base::mac::ObjCCastStrict<HistoryEntryItem>(
+ HistoryEntryItem* object = base::apple::ObjCCastStrict<HistoryEntryItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
BrowsingHistoryService::HistoryEntry entry;
entry.url = object.URL;
@@ -580,7 +580,7 @@
base::UserMetricsAction("HistoryPage_EntryLinkClick"));
}
HistoryEntryItem* historyItem =
- base::mac::ObjCCastStrict<HistoryEntryItem>(item);
+ base::apple::ObjCCastStrict<HistoryEntryItem>(item);
[self openURL:historyItem.URL];
}
}
@@ -613,7 +613,7 @@
return nil;
}
- HistoryEntryItem* entry = base::mac::ObjCCastStrict<HistoryEntryItem>(
+ HistoryEntryItem* entry = base::apple::ObjCCastStrict<HistoryEntryItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
UIView* cell = [self.tableView cellForRowAtIndexPath:indexPath];
return [self.menuProvider contextMenuConfigurationForItem:entry
@@ -631,7 +631,7 @@
case kEntriesStatusSectionIdentifier: {
// Might be a different type of header.
TableViewLinkHeaderFooterView* linkView =
- base::mac::ObjCCast<TableViewLinkHeaderFooterView>(view);
+ base::apple::ObjCCast<TableViewLinkHeaderFooterView>(view);
linkView.delegate = self;
} break;
default:
@@ -648,9 +648,9 @@
cellToReturn.userInteractionEnabled = !(item.type == ItemTypeEntriesStatus);
if (item.type == ItemTypeHistoryEntry) {
HistoryEntryItem* URLItem =
- base::mac::ObjCCastStrict<HistoryEntryItem>(item);
+ base::apple::ObjCCastStrict<HistoryEntryItem>(item);
TableViewURLCell* URLCell =
- base::mac::ObjCCastStrict<TableViewURLCell>(cellToReturn);
+ base::apple::ObjCCastStrict<TableViewURLCell>(cellToReturn);
CrURL* crurl = [[CrURL alloc] initWithGURL:URLItem.URL];
[self.imageDataSource
faviconForPageURL:crurl
@@ -724,7 +724,7 @@
switch (item.type) {
case ItemTypeHistoryEntry: {
HistoryEntryItem* URLItem =
- base::mac::ObjCCastStrict<HistoryEntryItem>(item);
+ base::apple::ObjCCastStrict<HistoryEntryItem>(item);
return [[URLInfo alloc] initWithURL:URLItem.URL title:URLItem.text];
}
case ItemTypeEntriesStatus:
@@ -896,7 +896,7 @@
[self.tableViewModel itemsInSectionWithIdentifier:sectionIdentifier];
for (id item in items) {
HistoryEntryItem* historyItem =
- base::mac::ObjCCastStrict<HistoryEntryItem>(item);
+ base::apple::ObjCCastStrict<HistoryEntryItem>(item);
if (![entries containsObject:historyItem]) {
NSIndexPath* indexPath =
[self.tableViewModel indexPathForItem:historyItem];
@@ -1035,7 +1035,7 @@
isEqual:[NSIndexPath indexPathForItem:0 inSection:0]])
return;
- HistoryEntryItem* entry = base::mac::ObjCCastStrict<HistoryEntryItem>(
+ HistoryEntryItem* entry = base::apple::ObjCCastStrict<HistoryEntryItem>(
[self.tableViewModel itemAtIndexPath:touchedItemIndexPath]);
__weak HistoryTableViewController* weakSelf = self;
diff --git a/ios/chrome/browser/ui/incognito_interstitial/incognito_interstitial_view_controller.mm b/ios/chrome/browser/ui/incognito_interstitial/incognito_interstitial_view_controller.mm
index 6732b57..d831890 100644
--- a/ios/chrome/browser/ui/incognito_interstitial/incognito_interstitial_view_controller.mm
+++ b/ios/chrome/browser/ui/incognito_interstitial/incognito_interstitial_view_controller.mm
@@ -6,9 +6,9 @@
#import <algorithm>
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/shared/ui/elements/extended_touch_target_button.h"
#import "ios/chrome/browser/shared/ui/util/attributed_string_util.h"
diff --git a/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.mm b/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.mm
index cd89ac83..e8e3474 100644
--- a/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.mm
+++ b/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.mm
@@ -5,7 +5,7 @@
#import "ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.h"
#import "ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator+subclassing.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/timer/timer.h"
@@ -111,7 +111,8 @@
if ([self.bannerViewController
conformsToProtocol:@protocol(InfobarBannerInteractable)]) {
UIViewController<InfobarBannerInteractable>* interactableBanner =
- base::mac::ObjCCastStrict<UIViewController<InfobarBannerInteractable>>(
+ base::apple::ObjCCastStrict<
+ UIViewController<InfobarBannerInteractable>>(
self.bannerViewController);
interactableBanner.interactionDelegate = self.bannerTransitionDriver;
}
diff --git a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_edit_address_profile_table_view_controller.mm b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_edit_address_profile_table_view_controller.mm
index 51ad13b..80fdca5 100644
--- a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_edit_address_profile_table_view_controller.mm
+++ b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_edit_address_profile_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_edit_address_profile_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/strings/grit/components_strings.h"
diff --git a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_edit_address_profile_table_view_controller_unittest.mm b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_edit_address_profile_table_view_controller_unittest.mm
index a84ddf7b..f2f9e0a2 100644
--- a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_edit_address_profile_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_edit_address_profile_table_view_controller_unittest.mm
@@ -5,8 +5,8 @@
#import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_edit_address_profile_table_view_controller.h"
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "components/autofill/core/browser/autofill_test_utils.h"
diff --git a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_save_address_profile_table_view_controller.mm b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_save_address_profile_table_view_controller.mm
index ac86d626..5dc0b55 100644
--- a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_save_address_profile_table_view_controller.mm
+++ b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_save_address_profile_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_save_address_profile_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/strings/sys_string_conversions.h"
@@ -209,7 +209,7 @@
if (itemType == ItemTypeAddressProfileSaveUpdateButton) {
TableViewTextButtonCell* tableViewTextButtonCell =
- base::mac::ObjCCastStrict<TableViewTextButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextButtonCell>(cell);
[tableViewTextButtonCell.button
addTarget:self
action:@selector(saveAddressProfileButtonWasPressed:)
@@ -219,7 +219,7 @@
UIEdgeInsetsMake(0, 0, 0, self.tableView.bounds.size.width);
} else if (itemType == ItemTypeAddressProfileNoThanksButton) {
TableViewTextButtonCell* tableViewTextButtonCell =
- base::mac::ObjCCastStrict<TableViewTextButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextButtonCell>(cell);
[tableViewTextButtonCell.button
addTarget:self
action:@selector(noThanksButtonWasPressed:)
diff --git a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_save_address_profile_table_view_controller_unittest.mm b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_save_address_profile_table_view_controller_unittest.mm
index ab7dc2a..1f0d96d3 100644
--- a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_save_address_profile_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_save_address_profile_table_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/infobar_save_address_profile_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.h"
#import "ios/chrome/browser/ui/autofill/autofill_ui_type.h"
@@ -115,7 +115,7 @@
CreateController();
CheckController();
InfobarSaveAddressProfileTableViewController* save_view_controller =
- base::mac::ObjCCastStrict<InfobarSaveAddressProfileTableViewController>(
+ base::apple::ObjCCastStrict<InfobarSaveAddressProfileTableViewController>(
controller());
[save_view_controller
setupModalViewControllerWithPrefs:GetDataForSaveModal()];
@@ -137,7 +137,7 @@
CreateController();
CheckController();
InfobarSaveAddressProfileTableViewController* update_view_controller =
- base::mac::ObjCCastStrict<InfobarSaveAddressProfileTableViewController>(
+ base::apple::ObjCCastStrict<InfobarSaveAddressProfileTableViewController>(
controller());
[update_view_controller
setupModalViewControllerWithPrefs:GetDataForUpdateModal()];
@@ -157,7 +157,7 @@
CreateController();
CheckController();
InfobarSaveAddressProfileTableViewController* save_view_controller =
- base::mac::ObjCCastStrict<InfobarSaveAddressProfileTableViewController>(
+ base::apple::ObjCCastStrict<InfobarSaveAddressProfileTableViewController>(
controller());
[save_view_controller
setupModalViewControllerWithPrefs:GetDataForSaveInAccountModal()];
@@ -184,7 +184,7 @@
CreateController();
CheckController();
InfobarSaveAddressProfileTableViewController* save_view_controller =
- base::mac::ObjCCastStrict<InfobarSaveAddressProfileTableViewController>(
+ base::apple::ObjCCastStrict<InfobarSaveAddressProfileTableViewController>(
controller());
[save_view_controller
setupModalViewControllerWithPrefs:GetDataForMigrationModal()];
@@ -212,7 +212,7 @@
CreateController();
CheckController();
InfobarSaveAddressProfileTableViewController* update_view_controller =
- base::mac::ObjCCastStrict<InfobarSaveAddressProfileTableViewController>(
+ base::apple::ObjCCastStrict<InfobarSaveAddressProfileTableViewController>(
controller());
[update_view_controller
setupModalViewControllerWithPrefs:GetDataForUpdateInAccountModal()];
diff --git a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.mm b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.mm
index 4ab7d4c..149fd38 100644
--- a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.mm
+++ b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/autofill/core/common/autofill_features.h"
@@ -159,12 +159,12 @@
if (itemType == ItemTypeTextField) {
TableViewTextEditCell* editCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(cell);
editCell.textField.delegate = self;
editCell.selectionStyle = UITableViewCellSelectionStyleNone;
} else if (itemType == ItemTypeSaveButton) {
TableViewTextButtonCell* tableViewTextButtonCell =
- base::mac::ObjCCastStrict<TableViewTextButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextButtonCell>(cell);
[tableViewTextButtonCell.button addTarget:self
action:@selector(didTapSaveButton)
forControlEvents:UIControlEventTouchUpInside];
@@ -228,7 +228,7 @@
for (NSInteger itemIndex = 0; itemIndex < itemCount; ++itemIndex) {
NSIndexPath* path = [NSIndexPath indexPathForItem:itemIndex
inSection:section];
- AutofillEditItem* item = base::mac::ObjCCastStrict<AutofillEditItem>(
+ AutofillEditItem* item = base::apple::ObjCCastStrict<AutofillEditItem>(
[model itemAtIndexPath:path]);
self.profileData[[NSNumber numberWithInt:item.autofillUIType]] =
item.textFieldValue;
diff --git a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller_unittest.mm b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller_unittest.mm
index 616da9c..a50e6dd 100644
--- a/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.h"
#import "ios/chrome/browser/ui/infobars/modals/autofill_address_profile/legacy_infobar_edit_address_profile_modal_delegate.h"
#import "testing/gtest_mac.h"
diff --git a/ios/chrome/browser/ui/infobars/modals/infobar_password_table_view_controller.mm b/ios/chrome/browser/ui/infobars/modals/infobar_password_table_view_controller.mm
index bfb4ad8..f82d035 100644
--- a/ios/chrome/browser/ui/infobars/modals/infobar_password_table_view_controller.mm
+++ b/ios/chrome/browser/ui/infobars/modals/infobar_password_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/infobars/modals/infobar_password_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/notreached.h"
@@ -227,7 +227,7 @@
switch (itemType) {
case ItemTypeSaveCredentials: {
TableViewTextButtonCell* tableViewTextButtonCell =
- base::mac::ObjCCastStrict<TableViewTextButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextButtonCell>(cell);
[tableViewTextButtonCell.button
addTarget:self
action:@selector(saveCredentialsButtonWasPressed:)
@@ -238,7 +238,7 @@
}
case ItemTypeCancel: {
TableViewTextButtonCell* tableViewTextButtonCell =
- base::mac::ObjCCastStrict<TableViewTextButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextButtonCell>(cell);
[tableViewTextButtonCell.button
addTarget:self
action:@selector(neverSaveCredentialsForCurrentSite)
@@ -247,7 +247,7 @@
}
case ItemTypeUsername: {
TableViewTextEditCell* editCell =
- base::mac::ObjCCast<TableViewTextEditCell>(cell);
+ base::apple::ObjCCast<TableViewTextEditCell>(cell);
[editCell.textField addTarget:self
action:@selector(usernameEditDidBegin)
forControlEvents:UIControlEventEditingDidBegin];
@@ -260,7 +260,7 @@
}
case ItemTypePassword: {
TableViewTextEditCell* editCell =
- base::mac::ObjCCast<TableViewTextEditCell>(cell);
+ base::apple::ObjCCast<TableViewTextEditCell>(cell);
[editCell.textField addTarget:self
action:@selector(updateSaveCredentialsButtonState)
forControlEvents:UIControlEventEditingChanged];
diff --git a/ios/chrome/browser/ui/infobars/modals/infobar_save_card_table_view_controller.mm b/ios/chrome/browser/ui/infobars/modals/infobar_save_card_table_view_controller.mm
index 53dc589f..502d725 100644
--- a/ios/chrome/browser/ui/infobars/modals/infobar_save_card_table_view_controller.mm
+++ b/ios/chrome/browser/ui/infobars/modals/infobar_save_card_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/infobars/modals/infobar_save_card_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/autofill/core/common/autofill_features.h"
@@ -275,7 +275,7 @@
}
case ItemTypeCardHolderName: {
TableViewTextEditCell* editCell =
- base::mac::ObjCCast<TableViewTextEditCell>(cell);
+ base::apple::ObjCCast<TableViewTextEditCell>(cell);
[editCell.textField addTarget:self
action:@selector(nameEditDidBegin)
forControlEvents:UIControlEventEditingDidBegin];
@@ -289,7 +289,7 @@
}
case ItemTypeCardExpireMonth: {
TableViewTextEditCell* editCell =
- base::mac::ObjCCast<TableViewTextEditCell>(cell);
+ base::apple::ObjCCast<TableViewTextEditCell>(cell);
[editCell.textField addTarget:self
action:@selector(monthEditDidBegin)
forControlEvents:UIControlEventEditingDidBegin];
@@ -303,7 +303,7 @@
}
case ItemTypeCardExpireYear: {
TableViewTextEditCell* editCell =
- base::mac::ObjCCast<TableViewTextEditCell>(cell);
+ base::apple::ObjCCast<TableViewTextEditCell>(cell);
[editCell.textField addTarget:self
action:@selector(yearEditDidBegin)
forControlEvents:UIControlEventEditingDidBegin];
@@ -317,7 +317,7 @@
}
case ItemTypeCardLegalMessage: {
TableViewTextLinkCell* linkCell =
- base::mac::ObjCCast<TableViewTextLinkCell>(cell);
+ base::apple::ObjCCast<TableViewTextLinkCell>(cell);
linkCell.delegate = self;
linkCell.separatorInset =
UIEdgeInsetsMake(0, self.tableView.bounds.size.width, 0, 0);
@@ -325,7 +325,7 @@
}
case ItemTypeCardSave: {
TableViewTextButtonCell* tableViewTextButtonCell =
- base::mac::ObjCCastStrict<TableViewTextButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextButtonCell>(cell);
[tableViewTextButtonCell.button
addTarget:self
action:@selector(saveCardButtonWasPressed:)
diff --git a/ios/chrome/browser/ui/infobars/modals/infobar_translate_table_view_controller.mm b/ios/chrome/browser/ui/infobars/modals/infobar_translate_table_view_controller.mm
index 2151387b5..89200eb 100644
--- a/ios/chrome/browser/ui/infobars/modals/infobar_translate_table_view_controller.mm
+++ b/ios/chrome/browser/ui/infobars/modals/infobar_translate_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/infobars/modals/infobar_translate_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/prefs/ios/pref_observer_bridge.h"
#import "components/prefs/pref_change_registrar.h"
@@ -341,7 +341,7 @@
ItemType itemType = static_cast<ItemType>(
[self.tableViewModel itemTypeForIndexPath:indexPath]);
TableViewTextButtonCell* tableViewTextButtonCell =
- base::mac::ObjCCast<TableViewTextButtonCell>(cell);
+ base::apple::ObjCCast<TableViewTextButtonCell>(cell);
// Clear the existing targets before adding the new ones.
[tableViewTextButtonCell.button removeTarget:nil
action:nil
diff --git a/ios/chrome/browser/ui/infobars/modals/permissions/infobar_permissions_table_view_controller.mm b/ios/chrome/browser/ui/infobars/modals/permissions/infobar_permissions_table_view_controller.mm
index 08cba6c..f533c0c 100644
--- a/ios/chrome/browser/ui/infobars/modals/permissions/infobar_permissions_table_view_controller.mm
+++ b/ios/chrome/browser/ui/infobars/modals/permissions/infobar_permissions_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/infobars/modals/permissions/infobar_permissions_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/notreached.h"
@@ -124,7 +124,7 @@
case ItemTypePermissionsCamera:
case ItemTypePermissionsMicrophone: {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
switchCell.switchView.tag = itemType;
[switchCell.switchView addTarget:self
action:@selector(permissionSwitchToggled:)
@@ -241,10 +241,10 @@
[self.presentationHandler resizeInfobarModal];
} else {
TableViewSwitchItem* currentItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(
[self.tableViewModel itemAtIndexPath:index]);
TableViewSwitchCell* currentCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(
[self.tableView cellForRowAtIndexPath:index]);
currentItem.on = state == web::PermissionStateAllowed;
// Reload the switch cell if its value is outdated.
diff --git a/ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.mm b/ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.mm
index 4c36bd00..85501791 100644
--- a/ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.mm
+++ b/ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/ui/infobars/presentation/infobar_banner_animator.h"
#import "ios/chrome/browser/ui/infobars/presentation/infobar_banner_presentation_controller.h"
diff --git a/ios/chrome/browser/ui/keyboard/menu_builder_unittest.mm b/ios/chrome/browser/ui/keyboard/menu_builder_unittest.mm
index cfa959ad..23b8d3e 100644
--- a/ios/chrome/browser/ui/keyboard/menu_builder_unittest.mm
+++ b/ios/chrome/browser/ui/keyboard/menu_builder_unittest.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "testing/gtest/include/gtest/gtest.h"
#import "testing/platform_test.h"
diff --git a/ios/chrome/browser/ui/main/incognito_blocker_scene_agent.mm b/ios/chrome/browser/ui/main/incognito_blocker_scene_agent.mm
index d83e7a3..11164b2 100644
--- a/ios/chrome/browser/ui/main/incognito_blocker_scene_agent.mm
+++ b/ios/chrome/browser/ui/main/incognito_blocker_scene_agent.mm
@@ -5,8 +5,8 @@
#import "ios/chrome/browser/ui/main/incognito_blocker_scene_agent.h"
#import "base/apple/bundle_locations.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
@interface IncognitoBlockerSceneAgent () <SceneStateObserver>
@@ -105,7 +105,7 @@
owner:self
options:nil];
UIViewController* launchScreenController =
- base::mac::ObjCCastStrict<UIViewController>([topObjects lastObject]);
+ base::apple::ObjCCastStrict<UIViewController>([topObjects lastObject]);
launchScreenController.view.autoresizingMask =
UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
return launchScreenController;
diff --git a/ios/chrome/browser/ui/ntp/feed_management/follow_management_view_controller.mm b/ios/chrome/browser/ui/ntp/feed_management/follow_management_view_controller.mm
index 8ff61a12..677c133 100644
--- a/ios/chrome/browser/ui/ntp/feed_management/follow_management_view_controller.mm
+++ b/ios/chrome/browser/ui/ntp/feed_management/follow_management_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/ntp/feed_management/follow_management_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/net/crurl.h"
#import "ios/chrome/browser/shared/ui/table_view/table_view_favicon_data_source.h"
#import "ios/chrome/browser/ui/follow/followed_web_channel.h"
@@ -72,9 +72,9 @@
[self.tableViewModel itemAtIndexPath:indexPath];
FollowedWebChannelItem* followedWebChannelItem =
- base::mac::ObjCCastStrict<FollowedWebChannelItem>(tableViewItem);
+ base::apple::ObjCCastStrict<FollowedWebChannelItem>(tableViewItem);
FollowedWebChannelCell* followedWebChannelCell =
- base::mac::ObjCCastStrict<FollowedWebChannelCell>(cellToReturn);
+ base::apple::ObjCCastStrict<FollowedWebChannelCell>(cellToReturn);
[self.faviconDataSource
faviconForPageURL:followedWebChannelItem.URL
@@ -227,7 +227,7 @@
- (void)visitSiteTapped {
FollowedWebChannelItem* followedWebChannelItem =
- base::mac::ObjCCastStrict<FollowedWebChannelItem>(
+ base::apple::ObjCCastStrict<FollowedWebChannelItem>(
[self.tableViewModel itemAtIndexPath:self.indexPathOfSelectedRow]);
const GURL& webPageURL =
followedWebChannelItem.followedWebChannel.webPageURL.gurl;
@@ -248,13 +248,13 @@
- (void)removeFollowedWebChannel:(FollowedWebChannel*)channel {
for (UITableViewCell* cell in self.tableView.visibleCells) {
FollowedWebChannelCell* followedWebChannelCell =
- base::mac::ObjCCastStrict<FollowedWebChannelCell>(cell);
+ base::apple::ObjCCastStrict<FollowedWebChannelCell>(cell);
if ([followedWebChannelCell.followedWebChannel isEqual:channel]) {
NSIndexPath* indexPath = [self.tableView indexPathForCell:cell];
[followedWebChannelCell stopAnimatingActivityIndicator];
self.lastUnfollowedWebChannelItem =
- base::mac::ObjCCastStrict<FollowedWebChannelItem>(
+ base::apple::ObjCCastStrict<FollowedWebChannelItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
self.indexPathOfLastUnfollowAttempt = indexPath;
[self deleteItemAtIndex:indexPath];
@@ -338,7 +338,7 @@
self.indexPathOfLastUnfollowAttempt = indexPath;
FollowedWebChannelCell* followedWebChannelCell =
- base::mac::ObjCCastStrict<FollowedWebChannelCell>(
+ base::apple::ObjCCastStrict<FollowedWebChannelCell>(
[self.tableView cellForRowAtIndexPath:indexPath]);
[followedWebChannelCell startAnimatingActivityIndicator];
[self.followDelegate
diff --git a/ios/chrome/browser/ui/ntp/feed_management/followed_web_channel_item.mm b/ios/chrome/browser/ui/ntp/feed_management/followed_web_channel_item.mm
index 19b1026f..cc43e592 100644
--- a/ios/chrome/browser/ui/ntp/feed_management/followed_web_channel_item.mm
+++ b/ios/chrome/browser/ui/ntp/feed_management/followed_web_channel_item.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/follow/followed_web_site_state.h"
#import "ios/chrome/browser/net/crurl.h"
#import "ios/chrome/browser/ui/follow/followed_web_channel.h"
@@ -57,7 +57,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:tableCell withStyler:styler];
FollowedWebChannelCell* cell =
- base::mac::ObjCCastStrict<FollowedWebChannelCell>(tableCell);
+ base::apple::ObjCCastStrict<FollowedWebChannelCell>(tableCell);
cell.followedWebChannel = self.followedWebChannel;
}
diff --git a/ios/chrome/browser/ui/ntp/feed_menu_coordinator_unittest.mm b/ios/chrome/browser/ui/ntp/feed_menu_coordinator_unittest.mm
index 7fb2f53..3807882 100644
--- a/ios/chrome/browser/ui/ntp/feed_menu_coordinator_unittest.mm
+++ b/ios/chrome/browser/ui/ntp/feed_menu_coordinator_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/ntp/feed_menu_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/scoped_feature_list.h"
#import "components/feed/core/v2/public/ios/pref_names.h"
#import "components/prefs/pref_service.h"
@@ -100,7 +100,7 @@
UIAlertController* GetAlertController() {
EXPECT_TRUE([base_view_controller_.presentedViewController
isKindOfClass:[UIAlertController class]]);
- return base::mac::ObjCCastStrict<UIAlertController>(
+ return base::apple::ObjCCastStrict<UIAlertController>(
base_view_controller_.presentedViewController);
}
diff --git a/ios/chrome/browser/ui/ntp/metrics/feed_metrics_recorder.mm b/ios/chrome/browser/ui/ntp/metrics/feed_metrics_recorder.mm
index 9d25674f..f95acb0 100644
--- a/ios/chrome/browser/ui/ntp/metrics/feed_metrics_recorder.mm
+++ b/ios/chrome/browser/ui/ntp/metrics/feed_metrics_recorder.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/ntp/metrics/feed_metrics_recorder.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
@@ -168,15 +168,16 @@
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
if (visible) {
- NSDate* lastInteractionTimeForGoodVisitsDate = base::mac::ObjCCast<NSDate>(
- [defaults objectForKey:kLastInteractionTimeForGoodVisits]);
+ NSDate* lastInteractionTimeForGoodVisitsDate =
+ base::apple::ObjCCast<NSDate>(
+ [defaults objectForKey:kLastInteractionTimeForGoodVisits]);
if (lastInteractionTimeForGoodVisitsDate != nil) {
self.lastInteractionTimeForGoodVisits =
base::Time::FromNSDate(lastInteractionTimeForGoodVisitsDate);
}
NSDate* lastInteractionTimeForDiscoverGoodVisitsDate =
- base::mac::ObjCCast<NSDate>(
+ base::apple::ObjCCast<NSDate>(
[defaults objectForKey:kLastInteractionTimeForDiscoverGoodVisits]);
if (lastInteractionTimeForDiscoverGoodVisitsDate != nil) {
self.lastInteractionTimeForDiscoverGoodVisits =
@@ -184,7 +185,7 @@
}
NSDate* lastInteractionTimeForFollowingGoodVisitsDate =
- base::mac::ObjCCast<NSDate>(
+ base::apple::ObjCCast<NSDate>(
[defaults objectForKey:kLastInteractionTimeForFollowingGoodVisits]);
if (lastInteractionTimeForFollowingGoodVisitsDate != nil) {
self.lastInteractionTimeForFollowingGoodVisits =
@@ -207,7 +208,7 @@
// Checks if there is a timestamp in defaults for when a user clicked
// on an article in order to be able to trigger a non-short click
// interaction.
- NSDate* articleVisitStart = base::mac::ObjCCast<NSDate>(
+ NSDate* articleVisitStart = base::apple::ObjCCast<NSDate>(
[defaults objectForKey:kArticleVisitTimestampKey]);
self.feedBecameVisibleTime = base::Time::Now();
@@ -917,7 +918,7 @@
NSDate* now = [NSDate date];
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
- NSDate* lastActivityBucketReported = base::mac::ObjCCast<NSDate>(
+ NSDate* lastActivityBucketReported = base::apple::ObjCCast<NSDate>(
[defaults objectForKey:kActivityBucketLastReportedDateKey]);
// If the `lastActivityBucketReported` does not exist, set it to now to
// prevent the first day from logging a metric.
@@ -1343,7 +1344,7 @@
// The midnight time for the day in which the
// `ContentSuggestions.Feed.TimeSpentInFeed` was last recorded.
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
- NSDate* lastInteractionReported = base::mac::ObjCCast<NSDate>(
+ NSDate* lastInteractionReported = base::apple::ObjCCast<NSDate>(
[defaults objectForKey:kLastDayTimeInFeedReportedKey]);
base::Time lastInteractionReportedInTime;
if (lastInteractionReported != nil) {
diff --git a/ios/chrome/browser/ui/ntp/metrics/feed_session_recorder.mm b/ios/chrome/browser/ui/ntp/metrics/feed_session_recorder.mm
index 08c382b..afbadf2 100644
--- a/ios/chrome/browser/ui/ntp/metrics/feed_session_recorder.mm
+++ b/ios/chrome/browser/ui/ntp/metrics/feed_session_recorder.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/ntp/metrics/feed_session_recorder.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/time/time.h"
@@ -72,7 +72,7 @@
// Disk value can be nil if this is a fresh install or if there was an issue
// writing to NSUserDefaults.
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
- NSDate* previousInteractionDate = base::mac::ObjCCast<NSDate>(
+ NSDate* previousInteractionDate = base::apple::ObjCCast<NSDate>(
[defaults objectForKey:kFeedPreviousInteractionDateKey]);
if (previousInteractionDate) {
_previousInteractionDate =
diff --git a/ios/chrome/browser/ui/ntp/metrics/new_tab_page_metrics_recorder.h b/ios/chrome/browser/ui/ntp/metrics/new_tab_page_metrics_recorder.h
index 4bb413c..221e16de 100644
--- a/ios/chrome/browser/ui/ntp/metrics/new_tab_page_metrics_recorder.h
+++ b/ios/chrome/browser/ui/ntp/metrics/new_tab_page_metrics_recorder.h
@@ -5,7 +5,7 @@
#ifndef IOS_CHROME_BROWSER_UI_NTP_METRICS_NEW_TAB_PAGE_METRICS_RECORDER_H_
#define IOS_CHROME_BROWSER_UI_NTP_METRICS_NEW_TAB_PAGE_METRICS_RECORDER_H_
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
namespace base {
class TimeDelta;
diff --git a/ios/chrome/browser/ui/ntp/metrics/new_tab_page_metrics_recorder.mm b/ios/chrome/browser/ui/ntp/metrics/new_tab_page_metrics_recorder.mm
index b629823..f349d3fe 100644
--- a/ios/chrome/browser/ui/ntp/metrics/new_tab_page_metrics_recorder.mm
+++ b/ios/chrome/browser/ui/ntp/metrics/new_tab_page_metrics_recorder.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/ntp/metrics/new_tab_page_metrics_recorder.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
@@ -74,7 +74,7 @@
}
// Find/Set first NTP impression ever.
NSDate* firstImpressionRecordedTileAblationExperiment =
- base::mac::ObjCCast<NSDate>(
+ base::apple::ObjCCast<NSDate>(
[defaults objectForKey:kFirstImpressionRecordedTileAblationKey]);
int impressions = [defaults integerForKey:kNumberOfNTPImpressionsRecordedKey];
// Record first NTP impression.
@@ -85,7 +85,7 @@
[defaults setInteger:1 forKey:kNumberOfNTPImpressionsRecordedKey];
return;
}
- NSDate* lastImpressionTileAblation = base::mac::ObjCCast<NSDate>(
+ NSDate* lastImpressionTileAblation = base::apple::ObjCCast<NSDate>(
[defaults objectForKey:kLastNTPImpressionRecordedKey]);
// Check when the last impression happened.
if (now - base::Time::FromNSDate(lastImpressionTileAblation) >=
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_header_view_controller.mm b/ios/chrome/browser/ui/ntp/new_tab_page_header_view_controller.mm
index 700bb57a..a168a88f 100644
--- a/ios/chrome/browser/ui/ntp/new_tab_page_header_view_controller.mm
+++ b/ios/chrome/browser/ui/ntp/new_tab_page_header_view_controller.mm
@@ -4,10 +4,10 @@
#import "ios/chrome/browser/ui/ntp/new_tab_page_header_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/feature_list.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
#import "base/strings/sys_string_conversions.h"
@@ -437,7 +437,7 @@
- (void)loadVoiceSearch:(id)sender {
DCHECK(self.voiceSearchIsEnabled);
[self.NTPMetricsRecorder recordVoiceSearchTapped];
- UIView* voiceSearchButton = base::mac::ObjCCastStrict<UIView>(sender);
+ UIView* voiceSearchButton = base::apple::ObjCCastStrict<UIView>(sender);
[self.layoutGuideCenter referenceView:voiceSearchButton
underName:kVoiceSearchButtonGuide];
[self.dispatcher startVoiceSearch];
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_mediator.mm b/ios/chrome/browser/ui/ntp/new_tab_page_mediator.mm
index efbfdb12..e5f841d 100644
--- a/ios/chrome/browser/ui/ntp/new_tab_page_mediator.mm
+++ b/ios/chrome/browser/ui/ntp/new_tab_page_mediator.mm
@@ -6,7 +6,7 @@
#import <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/signin/public/identity_manager/objc/identity_manager_observer_bridge.h"
diff --git a/ios/chrome/browser/ui/omnibox/keyboard_assist/omnibox_assistive_keyboard_delegate.mm b/ios/chrome/browser/ui/omnibox/keyboard_assist/omnibox_assistive_keyboard_delegate.mm
index be07b25..3a18ca7 100644
--- a/ios/chrome/browser/ui/omnibox/keyboard_assist/omnibox_assistive_keyboard_delegate.mm
+++ b/ios/chrome/browser/ui/omnibox/keyboard_assist/omnibox_assistive_keyboard_delegate.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/omnibox/keyboard_assist/omnibox_assistive_keyboard_delegate.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "ios/chrome/browser/shared/public/commands/application_commands.h"
@@ -39,7 +39,7 @@
// can be a regular view or a bar button item. Handle both cases.
UIView* view;
if ([sender isKindOfClass:[UIView class]]) {
- view = base::mac::ObjCCastStrict<UIView>(sender);
+ view = base::apple::ObjCCastStrict<UIView>(sender);
} else if ([sender isKindOfClass:[UIBarButtonItem class]]) {
view = [sender valueForKey:@"view"];
}
diff --git a/ios/chrome/browser/ui/omnibox/keyboard_assist/omnibox_keyboard_accessory_view.mm b/ios/chrome/browser/ui/omnibox/keyboard_assist/omnibox_keyboard_accessory_view.mm
index 5d5aa9d..16d63926 100644
--- a/ios/chrome/browser/ui/omnibox/keyboard_assist/omnibox_keyboard_accessory_view.mm
+++ b/ios/chrome/browser/ui/omnibox/keyboard_assist/omnibox_keyboard_accessory_view.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/omnibox/keyboard_assist/omnibox_keyboard_accessory_view.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/search_engines/search_engine_observer_bridge.h"
#import "ios/chrome/browser/search_engines/search_engines_util.h"
#import "ios/chrome/browser/shared/public/features/features.h"
@@ -208,7 +208,7 @@
}
- (void)keyboardButtonPressed:(id)sender {
- UIButton* button = base::mac::ObjCCastStrict<UIButton>(sender);
+ UIButton* button = base::apple::ObjCCastStrict<UIButton>(sender);
[[UIDevice currentDevice] playInputClick];
if (IsUIButtonConfigurationEnabled()) {
[_delegate keyPressed:button.configuration.title];
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_egtest.mm b/ios/chrome/browser/ui/omnibox/omnibox_egtest.mm
index 7bfc3d4..ed88e43 100644
--- a/ios/chrome/browser/ui/omnibox/omnibox_egtest.mm
+++ b/ios/chrome/browser/ui/omnibox/omnibox_egtest.mm
@@ -4,9 +4,9 @@
#import <XCTest/XCTest.h>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "build/build_config.h"
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_mediator.mm b/ios/chrome/browser/ui/omnibox/omnibox_mediator.mm
index 4c62d25..fe1a21c2 100644
--- a/ios/chrome/browser/ui/omnibox/omnibox_mediator.mm
+++ b/ios/chrome/browser/ui/omnibox/omnibox_mediator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/omnibox/omnibox_mediator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/strings/sys_string_conversions.h"
@@ -359,7 +359,7 @@
auto lensCompletion =
^(__kindof id<NSItemProviderReading> providedItem, NSError* error) {
dispatch_async(dispatch_get_main_queue(), ^{
- UIImage* image = base::mac::ObjCCast<UIImage>(providedItem);
+ UIImage* image = base::apple::ObjCCast<UIImage>(providedItem);
if (image) {
[weakSelf lensImage:image];
}
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_text_field_experimental.mm b/ios/chrome/browser/ui/omnibox/omnibox_text_field_experimental.mm
index ad50315..8f74513 100644
--- a/ios/chrome/browser/ui/omnibox/omnibox_text_field_experimental.mm
+++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_experimental.mm
@@ -6,10 +6,10 @@
#import <CoreText/CoreText.h>
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/command_line.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/sys_string_conversions.h"
#import "components/grit/components_scaled_resources.h"
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
index edd9bbb3..2880d7e 100644
--- a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
+++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
@@ -6,10 +6,10 @@
#import <CoreText/CoreText.h>
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/command_line.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/sys_string_conversions.h"
#import "components/grit/components_scaled_resources.h"
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_text_field_legacy.mm b/ios/chrome/browser/ui/omnibox/omnibox_text_field_legacy.mm
index 112a70f..0518f40 100644
--- a/ios/chrome/browser/ui/omnibox/omnibox_text_field_legacy.mm
+++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_legacy.mm
@@ -6,10 +6,10 @@
#import <CoreText/CoreText.h>
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/command_line.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/sys_string_conversions.h"
#import "components/grit/components_scaled_resources.h"
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_text_field_paste_delegate.mm b/ios/chrome/browser/ui/omnibox/omnibox_text_field_paste_delegate.mm
index 708d54c..aa6002a 100644
--- a/ios/chrome/browser/ui/omnibox/omnibox_text_field_paste_delegate.mm
+++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_paste_delegate.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/omnibox/omnibox_text_field_paste_delegate.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
@interface OmniboxTextFieldPasteDelegate ()
@@ -25,7 +25,7 @@
completionHandler:^(id<NSItemProviderReading> _Nullable object,
NSError* _Nullable error) {
if (!error) {
- self.URL = base::mac::ObjCCast<NSURL>(object);
+ self.URL = base::apple::ObjCCast<NSURL>(object);
}
[item setDefaultResult];
}];
diff --git a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_carousel_control_unittest_util.mm b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_carousel_control_unittest_util.mm
index 52e6d7b..d4d74ea 100644
--- a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_carousel_control_unittest_util.mm
+++ b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_carousel_control_unittest_util.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_carousel_control_unittest_util.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_accessibility_identifier_constants.h"
#import "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_carousel_control.h"
@@ -21,7 +21,7 @@
}
UILabel* GetLabelFromCarouselControl(OmniboxPopupCarouselControl* control) {
- return base::mac::ObjCCastStrict<UILabel>(GetViewOfClassWithIdentifier(
+ return base::apple::ObjCCastStrict<UILabel>(GetViewOfClassWithIdentifier(
[UILabel class], kOmniboxCarouselControlLabelAccessibilityIdentifier,
control));
}
diff --git a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_view_controller.mm b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_view_controller.mm
index aeb4655..34335fc 100644
--- a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_view_controller.mm
+++ b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_view_controller.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/format_macros.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/time/time.h"
#import "components/favicon/core/large_icon_service.h"
diff --git a/ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_overlay_coordinator.mm b/ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_overlay_coordinator.mm
index d097564..6072e7c 100644
--- a/ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_overlay_coordinator.mm
+++ b/ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_overlay_coordinator.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_overlay_coordinator.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/infobars/infobar_ios.h"
#import "ios/chrome/browser/infobars/infobar_type.h"
#import "ios/chrome/browser/overlays/public/common/infobars/infobar_overlay_request_config.h"
@@ -180,7 +180,7 @@
// Called when the dismissal of the banner UI is finished.
- (void)finishDismissal {
InfobarBannerOverlayMediator* mediator =
- base::mac::ObjCCast<InfobarBannerOverlayMediator>(self.mediator);
+ base::apple::ObjCCast<InfobarBannerOverlayMediator>(self.mediator);
[mediator finishDismissal];
self.bannerViewController = nil;
self.mediator = nil;
@@ -204,7 +204,7 @@
}
InfobarBannerOverlayMediator* mediator =
- base::mac::ObjCCast<InfobarBannerOverlayMediator>(GetMediatorForRequest(
+ base::apple::ObjCCast<InfobarBannerOverlayMediator>(GetMediatorForRequest(
[self class].supportedMediatorClasses, self.request));
DCHECK(mediator) << "None of the supported mediator classes support request.";
return mediator;
diff --git a/ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_overlay_coordinator.mm b/ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_overlay_coordinator.mm
index ff96ebda..72c2f1a 100644
--- a/ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_overlay_coordinator.mm
+++ b/ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_overlay_coordinator.mm
@@ -5,7 +5,7 @@
#import "ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_overlay_coordinator.h"
#import "ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_overlay_coordinator+modal_configuration.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/notreached.h"
#import "ios/chrome/browser/ui/infobars/presentation/infobar_modal_positioner.h"
#import "ios/chrome/browser/ui/infobars/presentation/infobar_modal_transition_driver.h"
@@ -62,7 +62,8 @@
- (CGFloat)modalHeightForWidth:(CGFloat)width {
UIView* modalView = self.modalViewController.view;
CGSize modalContentSize = CGSizeZero;
- if (UIScrollView* scrollView = base::mac::ObjCCast<UIScrollView>(modalView)) {
+ if (UIScrollView* scrollView =
+ base::apple::ObjCCast<UIScrollView>(modalView)) {
CGRect layoutFrame = self.baseViewController.view.bounds;
layoutFrame.size.width = width;
scrollView.frame = layoutFrame;
diff --git a/ios/chrome/browser/ui/overlays/infobar_modal/translate/translate_infobar_modal_overlay_coordinator.mm b/ios/chrome/browser/ui/overlays/infobar_modal/translate/translate_infobar_modal_overlay_coordinator.mm
index b480c45..b302a45 100644
--- a/ios/chrome/browser/ui/overlays/infobar_modal/translate/translate_infobar_modal_overlay_coordinator.mm
+++ b/ios/chrome/browser/ui/overlays/infobar_modal/translate/translate_infobar_modal_overlay_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/overlays/infobar_modal/translate/translate_infobar_modal_overlay_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/infobars/infobar_type.h"
#import "ios/chrome/browser/overlays/public/default/default_infobar_overlay_request_config.h"
#import "ios/chrome/browser/shared/model/browser/browser.h"
@@ -78,7 +78,7 @@
#pragma mark - Private
- (TranslateInfobarModalOverlayMediator*)translateModalOverlayMediator {
- return base::mac::ObjCCastStrict<TranslateInfobarModalOverlayMediator>(
+ return base::apple::ObjCCastStrict<TranslateInfobarModalOverlayMediator>(
self.modalMediator);
}
diff --git a/ios/chrome/browser/ui/overlays/overlay_presentation_context_view_controller.mm b/ios/chrome/browser/ui/overlays/overlay_presentation_context_view_controller.mm
index a61852b..60ed32e 100644
--- a/ios/chrome/browser/ui/overlays/overlay_presentation_context_view_controller.mm
+++ b/ios/chrome/browser/ui/overlays/overlay_presentation_context_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/overlays/overlay_presentation_context_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/ui/overlays/overlay_presentation_controller.h"
@interface OverlayPresentationContextViewController ()
@@ -44,7 +44,7 @@
// The non-strict cast returns nil if the presented UIViewController does not
// use an OverlayPresentationController. This results in this selector
// returning NO for these UIViewControllers.
- return base::mac::ObjCCast<OverlayPresentationController>(
+ return base::apple::ObjCCast<OverlayPresentationController>(
self.presentedViewController.presentationController)
.resizesPresentationContainer;
}
diff --git a/ios/chrome/browser/ui/overlays/web_content_area/alerts/alert_overlay_coordinator.mm b/ios/chrome/browser/ui/overlays/web_content_area/alerts/alert_overlay_coordinator.mm
index ecb3c3e..052eb5f6 100644
--- a/ios/chrome/browser/ui/overlays/web_content_area/alerts/alert_overlay_coordinator.mm
+++ b/ios/chrome/browser/ui/overlays/web_content_area/alerts/alert_overlay_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/overlays/web_content_area/alerts/alert_overlay_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/overlays/public/web_content_area/alert_overlay.h"
#import "ios/chrome/browser/ui/alert_view/alert_view_controller.h"
#import "ios/chrome/browser/ui/overlays/overlay_request_coordinator+subclassing.h"
@@ -35,7 +35,7 @@
}
- (AlertOverlayMediator*)alertMediator {
- return base::mac::ObjCCastStrict<AlertOverlayMediator>(self.mediator);
+ return base::apple::ObjCCastStrict<AlertOverlayMediator>(self.mediator);
}
#pragma mark - AlertOverlayMediatorDataSource
diff --git a/ios/chrome/browser/ui/overlays/web_content_area/alerts/alert_overlay_coordinator_unittest.mm b/ios/chrome/browser/ui/overlays/web_content_area/alerts/alert_overlay_coordinator_unittest.mm
index a8a474c..d9be295 100644
--- a/ios/chrome/browser/ui/overlays/web_content_area/alerts/alert_overlay_coordinator_unittest.mm
+++ b/ios/chrome/browser/ui/overlays/web_content_area/alerts/alert_overlay_coordinator_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/overlays/web_content_area/alerts/alert_overlay_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/overlays/public/overlay_request.h"
#import "ios/chrome/browser/overlays/public/web_content_area/alert_overlay.h"
#import "ios/chrome/browser/overlays/test/overlay_test_macros.h"
@@ -73,7 +73,7 @@
ASSERT_FALSE(delegate_.HasUIBeenPresented(request_.get()));
[coordinator_ startAnimated:NO];
AlertViewController* view_controller =
- base::mac::ObjCCast<AlertViewController>(coordinator_.viewController);
+ base::apple::ObjCCast<AlertViewController>(coordinator_.viewController);
EXPECT_TRUE(view_controller);
EXPECT_EQ(view_controller.parentViewController, root_view_controller_);
EXPECT_TRUE(
diff --git a/ios/chrome/browser/ui/page_info/page_info_view_controller.mm b/ios/chrome/browser/ui/page_info/page_info_view_controller.mm
index 1aa55499..c6c9bae 100644
--- a/ios/chrome/browser/ui/page_info/page_info_view_controller.mm
+++ b/ios/chrome/browser/ui/page_info/page_info_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/page_info/page_info_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/notreached.h"
@@ -206,7 +206,7 @@
switch (sectionIdentifier) {
case SectionIdentifierSecurityContent: {
TableViewLinkHeaderFooterView* linkView =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
linkView.delegate = self;
} break;
}
@@ -225,7 +225,7 @@
case ItemTypePermissionsCamera:
case ItemTypePermissionsMicrophone: {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
switchCell.switchView.tag = itemType;
[switchCell.switchView addTarget:self
action:@selector(permissionSwitchToggled:)
@@ -347,10 +347,10 @@
withRowAnimation:UITableViewRowAnimationAutomatic];
} else {
TableViewSwitchItem* currentItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(
[self.tableViewModel itemAtIndexPath:index]);
TableViewSwitchCell* currentCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(
[self.tableView cellForRowAtIndexPath:index]);
currentItem.on = state == web::PermissionStateAllowed;
// Reload the switch cell if its value is outdated.
diff --git a/ios/chrome/browser/ui/partial_translate/partial_translate_mediator.mm b/ios/chrome/browser/ui/partial_translate/partial_translate_mediator.mm
index d3eb9ee..143695c 100644
--- a/ios/chrome/browser/ui/partial_translate/partial_translate_mediator.mm
+++ b/ios/chrome/browser/ui/partial_translate/partial_translate_mediator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/partial_translate/partial_translate_mediator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/memory/weak_ptr.h"
#import "base/metrics/histogram_functions.h"
#import "components/prefs/pref_member.h"
@@ -353,7 +353,7 @@
if (![element isKindOfClass:[UICommand class]]) {
continue;
}
- UICommand* command = base::mac::ObjCCast<UICommand>(element);
+ UICommand* command = base::apple::ObjCCast<UICommand>(element);
if (command.action != NSSelectorFromString(@"_translate:")) {
continue;
}
diff --git a/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_app_interface.mm b/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_app_interface.mm
index e2ee8a8..04e9aa6 100644
--- a/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_app_interface.mm
+++ b/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_app_interface.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_app_interface.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "components/prefs/pref_service.h"
#import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
#import "ios/chrome/browser/shared/model/prefs/pref_names.h"
@@ -30,7 +30,7 @@
(ReauthenticationResult)expectedResult {
CHECK(_scopedReauthOverride);
MockReauthenticationModule* mockModule =
- base::mac::ObjCCastStrict<MockReauthenticationModule>(
+ base::apple::ObjCCastStrict<MockReauthenticationModule>(
_scopedReauthOverride->module);
mockModule.expectedResult = expectedResult;
}
diff --git a/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_view_controller.mm b/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_view_controller.mm
index e7c58fe..f4a2c504 100644
--- a/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_view_controller.mm
+++ b/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "components/autofill/ios/browser/form_suggestion.h"
#import "components/password_manager/core/browser/ui/credential_ui_entry.h"
#import "components/password_manager/ios/shared_password_controller.h"
@@ -278,7 +278,8 @@
forCell:(UITableViewCell*)cell {
DCHECK(cell);
- TableViewURLCell* URLCell = base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ TableViewURLCell* URLCell =
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
auto faviconLoadedBlock = ^(FaviconAttributes* attributes) {
DCHECK(attributes);
// It doesn't matter which cell the user sees here, all the credentials
diff --git a/ios/chrome/browser/ui/popup_menu/cells/popup_menu_text_item.mm b/ios/chrome/browser/ui/popup_menu/cells/popup_menu_text_item.mm
index 0c5d6b2..dfa7815 100644
--- a/ios/chrome/browser/ui/popup_menu/cells/popup_menu_text_item.mm
+++ b/ios/chrome/browser/ui/popup_menu/cells/popup_menu_text_item.mm
@@ -6,7 +6,7 @@
#import <stdlib.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
#import "ios/chrome/browser/ui/popup_menu/public/popup_menu_ui_constants.h"
diff --git a/ios/chrome/browser/ui/popup_menu/popup_menu_mediator.mm b/ios/chrome/browser/ui/popup_menu/popup_menu_mediator.mm
index 2b7b233..4c2e27e7 100644
--- a/ios/chrome/browser/ui/popup_menu/popup_menu_mediator.mm
+++ b/ios/chrome/browser/ui/popup_menu/popup_menu_mediator.mm
@@ -4,10 +4,10 @@
#import "ios/chrome/browser/ui/popup_menu/popup_menu_mediator.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/feature_list.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
diff --git a/ios/chrome/browser/ui/price_notifications/price_notifications_price_tracking_mediator_unittest.mm b/ios/chrome/browser/ui/price_notifications/price_notifications_price_tracking_mediator_unittest.mm
index 9d088f9..d870bed 100644
--- a/ios/chrome/browser/ui/price_notifications/price_notifications_price_tracking_mediator_unittest.mm
+++ b/ios/chrome/browser/ui/price_notifications/price_notifications_price_tracking_mediator_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/price_notifications/price_notifications_price_tracking_mediator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "components/bookmarks/browser/bookmark_model.h"
diff --git a/ios/chrome/browser/ui/price_notifications/price_notifications_table_view_controller.mm b/ios/chrome/browser/ui/price_notifications/price_notifications_table_view_controller.mm
index b79d43d..b158a18c 100644
--- a/ios/chrome/browser/ui/price_notifications/price_notifications_table_view_controller.mm
+++ b/ios/chrome/browser/ui/price_notifications/price_notifications_table_view_controller.mm
@@ -6,7 +6,7 @@
#import <MaterialComponents/MaterialSnackbar.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/net/crurl.h"
#import "ios/chrome/browser/shared/public/commands/snackbar_commands.h"
#import "ios/chrome/browser/shared/ui/list_model/list_item+Controller.h"
@@ -113,7 +113,7 @@
- (NSIndexPath*)tableView:(UITableView*)tableView
willSelectRowAtIndexPath:(NSIndexPath*)indexPath {
PriceNotificationsTableViewItem* item =
- base::mac::ObjCCastStrict<PriceNotificationsTableViewItem>(
+ base::apple::ObjCCastStrict<PriceNotificationsTableViewItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
if (!item.tracking) {
@@ -130,7 +130,7 @@
}
PriceNotificationsTableViewItem* item =
- base::mac::ObjCCastStrict<PriceNotificationsTableViewItem>(
+ base::apple::ObjCCastStrict<PriceNotificationsTableViewItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
[self.mutator navigateToWebpageForItem:item];
}
@@ -138,7 +138,7 @@
- (BOOL)tableView:(UITableView*)tableView
canPerformPrimaryActionForRowAtIndexPath:(NSIndexPath*)indexPath {
PriceNotificationsTableViewItem* item =
- base::mac::ObjCCastStrict<PriceNotificationsTableViewItem>(
+ base::apple::ObjCCastStrict<PriceNotificationsTableViewItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
return item.tracking;
@@ -147,7 +147,7 @@
- (void)tableView:(UITableView*)tableView
performPrimaryActionForRowAtIndexPath:(NSIndexPath*)indexPath {
PriceNotificationsTableViewItem* item =
- base::mac::ObjCCastStrict<PriceNotificationsTableViewItem>(
+ base::apple::ObjCCastStrict<PriceNotificationsTableViewItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
[self.mutator navigateToWebpageForItem:item];
}
@@ -156,7 +156,7 @@
viewForHeaderInSection:(NSInteger)section {
UIView* header = [super tableView:tableView viewForHeaderInSection:section];
TableViewTextHeaderFooterView* link =
- base::mac::ObjCCast<TableViewTextHeaderFooterView>(header);
+ base::apple::ObjCCast<TableViewTextHeaderFooterView>(header);
if (link) {
link.delegate = self;
}
@@ -354,7 +354,7 @@
- (void)trackItemForCell:(PriceNotificationsTableViewCell*)cell {
NSIndexPath* indexPath = [self.tableView indexPathForCell:cell];
PriceNotificationsTableViewItem* item =
- base::mac::ObjCCastStrict<PriceNotificationsTableViewItem>(
+ base::apple::ObjCCastStrict<PriceNotificationsTableViewItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
[self.mutator trackItem:item];
}
@@ -362,7 +362,7 @@
- (void)stopTrackingItemForCell:(PriceNotificationsTableViewCell*)cell {
NSIndexPath* indexPath = [self.tableView indexPathForCell:cell];
PriceNotificationsTableViewItem* item =
- base::mac::ObjCCastStrict<PriceNotificationsTableViewItem>(
+ base::apple::ObjCCastStrict<PriceNotificationsTableViewItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
[self.mutator stopTrackingItem:item];
}
diff --git a/ios/chrome/browser/ui/price_notifications/price_notifications_table_view_controller_unittest.mm b/ios/chrome/browser/ui/price_notifications/price_notifications_table_view_controller_unittest.mm
index deaf1bef..947d4e84 100644
--- a/ios/chrome/browser/ui/price_notifications/price_notifications_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/price_notifications/price_notifications_table_view_controller_unittest.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/public/commands/command_dispatcher.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_link_header_footer_item.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_header_footer_item.h"
@@ -31,7 +31,7 @@
// Returns the TableViewHeaderFooterItem `T` from `section_id`.
T* GetHeaderItemFromSection(ChromeTableViewController* controller,
NSUInteger section_id) {
- return base::mac::ObjCCastStrict<T>([controller.tableViewModel
+ return base::apple::ObjCCastStrict<T>([controller.tableViewModel
headerForSectionIndex:[controller.tableViewModel
sectionForSectionIdentifier:section_id]]);
}
@@ -70,7 +70,7 @@
[model indexPathForItemType:ItemTypeListItem
sectionIdentifier:SectionIdentifierTrackableItemsOnCurrentSite];
PriceNotificationsTableViewItem* trackableItemPlaceholder =
- base::mac::ObjCCast<PriceNotificationsTableViewItem>(
+ base::apple::ObjCCast<PriceNotificationsTableViewItem>(
[model itemAtIndexPath:trackableItemPlaceholderIndexPath]);
EXPECT_EQ(trackableItemPlaceholder.loading, true);
@@ -85,10 +85,10 @@
[model indexPathsForItemType:ItemTypeListItem
sectionIdentifier:SectionIdentifierTrackedItems];
PriceNotificationsTableViewItem* firstTrackedItemPlacholder =
- base::mac::ObjCCast<PriceNotificationsTableViewItem>(
+ base::apple::ObjCCast<PriceNotificationsTableViewItem>(
[model itemAtIndexPath:placeholders[0]]);
PriceNotificationsTableViewItem* secondTrackedItemPlaceholder =
- base::mac::ObjCCast<PriceNotificationsTableViewItem>(
+ base::apple::ObjCCast<PriceNotificationsTableViewItem>(
[model itemAtIndexPath:placeholders[1]]);
EXPECT_EQ(placeholders.count, 2u);
@@ -101,7 +101,8 @@
TEST_F(PriceNotificationsTableViewControllerTest,
DisplayTrackableSectionEmptyStateWhenProductPageIsNotTrackable) {
id<PriceNotificationsConsumer> consumer =
- base::mac::ObjCCast<PriceNotificationsTableViewController>(controller());
+ base::apple::ObjCCast<PriceNotificationsTableViewController>(
+ controller());
[consumer setTrackableItem:nil currentlyTracking:NO];
TableViewTextHeaderFooterItem* item =
@@ -147,7 +148,8 @@
TEST_F(PriceNotificationsTableViewControllerTest,
DisplayTrackableItemWhenAvailable) {
id<PriceNotificationsConsumer> consumer =
- base::mac::ObjCCast<PriceNotificationsTableViewController>(controller());
+ base::apple::ObjCCast<PriceNotificationsTableViewController>(
+ controller());
PriceNotificationsTableViewItem* item =
[[PriceNotificationsTableViewItem alloc] initWithType:ItemTypeListItem];
item.title = @"Test Title";
@@ -167,7 +169,8 @@
// Simulates that a tracked item exists and is displayed
TEST_F(PriceNotificationsTableViewControllerTest, DisplayUsersTrackedItems) {
id<PriceNotificationsConsumer> consumer =
- base::mac::ObjCCast<PriceNotificationsTableViewController>(controller());
+ base::apple::ObjCCast<PriceNotificationsTableViewController>(
+ controller());
PriceNotificationsTableViewItem* item =
[[PriceNotificationsTableViewItem alloc] initWithType:ItemTypeListItem];
item.title = @"Test Title";
@@ -188,7 +191,7 @@
TEST_F(PriceNotificationsTableViewControllerTest,
DisplayUsersTrackedItemsWhenViewingTrackedItemWebpage) {
PriceNotificationsTableViewController* tableViewController =
- base::mac::ObjCCastStrict<PriceNotificationsTableViewController>(
+ base::apple::ObjCCastStrict<PriceNotificationsTableViewController>(
controller());
PriceNotificationsTableViewItem* item =
[[PriceNotificationsTableViewItem alloc] initWithType:ItemTypeListItem];
@@ -217,7 +220,8 @@
TEST_F(PriceNotificationsTableViewControllerTest,
TrackableItemMovedToTrackedSectionOnStartTracking) {
id<PriceNotificationsConsumer> consumer =
- base::mac::ObjCCast<PriceNotificationsTableViewController>(controller());
+ base::apple::ObjCCast<PriceNotificationsTableViewController>(
+ controller());
PriceNotificationsTableViewItem* item =
[[PriceNotificationsTableViewItem alloc] initWithType:ItemTypeListItem];
TableViewModel* model = controller().tableViewModel;
@@ -253,7 +257,7 @@
TEST_F(PriceNotificationsTableViewControllerTest,
RedirectToTrackedItemsWebpageOnSelection) {
PriceNotificationsTableViewController* tableViewController =
- base::mac::ObjCCastStrict<PriceNotificationsTableViewController>(
+ base::apple::ObjCCastStrict<PriceNotificationsTableViewController>(
controller());
PriceNotificationsTableViewItem* item =
[[PriceNotificationsTableViewItem alloc] initWithType:ItemTypeListItem];
@@ -297,7 +301,8 @@
TEST_F(PriceNotificationsTableViewControllerTest,
UntrackItemWhenTrackableItemSectionIsEmpty) {
id<PriceNotificationsConsumer> consumer =
- base::mac::ObjCCast<PriceNotificationsTableViewController>(controller());
+ base::apple::ObjCCast<PriceNotificationsTableViewController>(
+ controller());
PriceNotificationsTableViewItem* item =
[[PriceNotificationsTableViewItem alloc] initWithType:ItemTypeListItem];
@@ -319,7 +324,8 @@
TEST_F(PriceNotificationsTableViewControllerTest,
UntrackItemFromCurrentlyViewedWebpageWhenTrackableItemSectionIsEmpty) {
id<PriceNotificationsConsumer> consumer =
- base::mac::ObjCCast<PriceNotificationsTableViewController>(controller());
+ base::apple::ObjCCast<PriceNotificationsTableViewController>(
+ controller());
PriceNotificationsTableViewItem* item =
[[PriceNotificationsTableViewItem alloc] initWithType:ItemTypeListItem];
@@ -341,7 +347,8 @@
TEST_F(PriceNotificationsTableViewControllerTest,
UntrackItemRemainingTrackedItemWhenTrackableItemSectionIsNotEmpty) {
id<PriceNotificationsConsumer> consumer =
- base::mac::ObjCCast<PriceNotificationsTableViewController>(controller());
+ base::apple::ObjCCast<PriceNotificationsTableViewController>(
+ controller());
PriceNotificationsTableViewItem* trackable_item =
[[PriceNotificationsTableViewItem alloc] initWithType:ItemTypeListItem];
PriceNotificationsTableViewItem* tracked_item =
@@ -367,7 +374,8 @@
PriceNotificationsTableViewControllerTest,
UntrackItemWithMultipleTrackedItemsRemainingWhenTrackableItemSectionIsNotEmpty) {
id<PriceNotificationsConsumer> consumer =
- base::mac::ObjCCast<PriceNotificationsTableViewController>(controller());
+ base::apple::ObjCCast<PriceNotificationsTableViewController>(
+ controller());
PriceNotificationsTableViewItem* trackable_item =
[[PriceNotificationsTableViewItem alloc] initWithType:ItemTypeListItem];
PriceNotificationsTableViewItem* tracked_item;
@@ -395,7 +403,8 @@
TEST_F(PriceNotificationsTableViewControllerTest,
UntrackCrossMerchantItemWithItemOnCurrentPageNotTracked) {
id<PriceNotificationsConsumer> consumer =
- base::mac::ObjCCast<PriceNotificationsTableViewController>(controller());
+ base::apple::ObjCCast<PriceNotificationsTableViewController>(
+ controller());
PriceNotificationsTableViewItem* trackable_item =
[[PriceNotificationsTableViewItem alloc] initWithType:ItemTypeListItem];
[consumer setTrackableItem:trackable_item currentlyTracking:NO];
diff --git a/ios/chrome/browser/ui/promos_manager/promos_manager_coordinator_unittest.h b/ios/chrome/browser/ui/promos_manager/promos_manager_coordinator_unittest.h
index 6d731ab..cf9bd45c 100644
--- a/ios/chrome/browser/ui/promos_manager/promos_manager_coordinator_unittest.h
+++ b/ios/chrome/browser/ui/promos_manager/promos_manager_coordinator_unittest.h
@@ -5,7 +5,7 @@
#ifndef IOS_CHROME_BROWSER_UI_PROMOS_MANAGER_PROMOS_MANAGER_COORDINATOR_UNITTEST_H_
#define IOS_CHROME_BROWSER_UI_PROMOS_MANAGER_PROMOS_MANAGER_COORDINATOR_UNITTEST_H_
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/scoped_feature_list.h"
#import "base/test/task_environment.h"
#import "components/prefs/pref_registry_simple.h"
diff --git a/ios/chrome/browser/ui/promos_manager/promos_manager_coordinator_unittest.mm b/ios/chrome/browser/ui/promos_manager/promos_manager_coordinator_unittest.mm
index 1137449..299dd73 100644
--- a/ios/chrome/browser/ui/promos_manager/promos_manager_coordinator_unittest.mm
+++ b/ios/chrome/browser/ui/promos_manager/promos_manager_coordinator_unittest.mm
@@ -6,7 +6,7 @@
#import <Foundation/Foundation.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/scoped_feature_list.h"
#import "base/test/task_environment.h"
#import "components/prefs/pref_registry_simple.h"
diff --git a/ios/chrome/browser/ui/qr_scanner/qr_scanner_app_interface.mm b/ios/chrome/browser/ui/qr_scanner/qr_scanner_app_interface.mm
index 01626e13..f48b77a 100644
--- a/ios/chrome/browser/ui/qr_scanner/qr_scanner_app_interface.mm
+++ b/ios/chrome/browser/ui/qr_scanner/qr_scanner_app_interface.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/qr_scanner/qr_scanner_app_interface.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "components/search_engines/template_url_service.h"
@@ -209,7 +209,7 @@
(UIViewController*)qrScanner
isOn:(BOOL)isOn {
QRScannerViewController* qrScannerViewController =
- base::mac::ObjCCast<QRScannerViewController>(qrScanner);
+ base::apple::ObjCCast<QRScannerViewController>(qrScanner);
[qrScannerViewController overrideVoiceOverCheck:isOn];
}
diff --git a/ios/chrome/browser/ui/qr_scanner/qr_scanner_camera_controller.mm b/ios/chrome/browser/ui/qr_scanner/qr_scanner_camera_controller.mm
index 8b1f1a1..5beee8b 100644
--- a/ios/chrome/browser/ui/qr_scanner/qr_scanner_camera_controller.mm
+++ b/ios/chrome/browser/ui/qr_scanner/qr_scanner_camera_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/qr_scanner/qr_scanner_camera_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
@interface QRScannerCameraController () <AVCaptureMetadataOutputObjectsDelegate>
@@ -62,7 +62,7 @@
return;
}
NSString* resultString =
- [base::mac::ObjCCastStrict<AVMetadataMachineReadableCodeObject>(
+ [base::apple::ObjCCastStrict<AVMetadataMachineReadableCodeObject>(
metadataResult) stringValue];
if (resultString.length == 0) {
return;
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm b/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm
index 4258ca6..87c6200e 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm
+++ b/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm
@@ -8,9 +8,9 @@
#import <functional>
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/string_number_conversions.h"
#import "base/strings/string_util.h"
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_list_item_factory.mm b/ios/chrome/browser/ui/reading_list/reading_list_list_item_factory.mm
index 5502abb..ea9d3c3 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_list_item_factory.mm
+++ b/ios/chrome/browser/ui/reading_list/reading_list_list_item_factory.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/reading_list/reading_list_list_item_factory.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/reading_list/core/reading_list_entry.h"
#import "components/url_formatter/url_formatter.h"
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_mediator.mm b/ios/chrome/browser/ui/reading_list/reading_list_mediator.mm
index c9b131dd..0b5e909 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_mediator.mm
+++ b/ios/chrome/browser/ui/reading_list/reading_list_mediator.mm
@@ -6,7 +6,7 @@
#import <algorithm>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/memory/scoped_refptr.h"
#import "base/metrics/histogram_macros.h"
#import "base/strings/sys_string_conversions.h"
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_table_view_controller.mm b/ios/chrome/browser/ui/reading_list/reading_list_table_view_controller.mm
index 8d51147..375b466 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_table_view_controller.mm
+++ b/ios/chrome/browser/ui/reading_list/reading_list_table_view_controller.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/reading_list/reading_list_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
@@ -485,7 +485,8 @@
return;
}
- TableViewItem* tableViewItem = base::mac::ObjCCastStrict<TableViewItem>(item);
+ TableViewItem* tableViewItem =
+ base::apple::ObjCCastStrict<TableViewItem>(item);
if ([model hasItem:tableViewItem
inSectionWithIdentifier:kSectionIdentifierUnread]) {
[self markItemsAtIndexPaths:@[ [model indexPathForItem:tableViewItem] ]
@@ -501,7 +502,8 @@
return;
}
- TableViewItem* tableViewItem = base::mac::ObjCCastStrict<TableViewItem>(item);
+ TableViewItem* tableViewItem =
+ base::apple::ObjCCastStrict<TableViewItem>(item);
if ([model hasItem:tableViewItem
inSectionWithIdentifier:kSectionIdentifierRead]) {
[self markItemsAtIndexPaths:@[ [model indexPathForItem:tableViewItem] ]
@@ -511,7 +513,7 @@
- (void)deleteItem:(id<ReadingListListItem>)item {
TableViewItem<ReadingListListItem>* tableViewItem =
- base::mac::ObjCCastStrict<TableViewItem<ReadingListListItem>>(item);
+ base::apple::ObjCCastStrict<TableViewItem<ReadingListListItem>>(item);
if ([self.tableViewModel hasItem:tableViewItem]) {
NSIndexPath* indexPath =
[self.tableViewModel indexPathForItem:tableViewItem];
@@ -713,7 +715,7 @@
[self.tableViewModel indexPathForItemType:kItemTypeSignInPromo
sectionIdentifier:kSectionIdentifierSignInPromo];
TableViewSigninPromoItem* signInPromoItem =
- base::mac::ObjCCast<TableViewSigninPromoItem>(
+ base::apple::ObjCCast<TableViewSigninPromoItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
if (!signInPromoItem) {
return;
@@ -814,7 +816,7 @@
// Returns `item` cast as a TableViewItem.
- (TableViewItem<ReadingListListItem>*)tableItemForReadingListItem:
(id<ReadingListListItem>)item {
- return base::mac::ObjCCastStrict<TableViewItem<ReadingListListItem>>(item);
+ return base::apple::ObjCCastStrict<TableViewItem<ReadingListListItem>>(item);
}
// Applies `updater` to the items in `section`. The updates are done in reverse
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_table_view_item.mm b/ios/chrome/browser/ui/reading_list/reading_list_table_view_item.mm
index 2ecefe0..35bcb7f 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_table_view_item.mm
+++ b/ios/chrome/browser/ui/reading_list/reading_list_table_view_item.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/reading_list/reading_list_table_view_item.h"
+#import "base/apple/foundation_util.h"
#import "base/i18n/time_formatting.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "base/time/time.h"
@@ -92,7 +92,8 @@
- (void)configureCell:(TableViewCell*)cell
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:cell withStyler:styler];
- TableViewURLCell* URLCell = base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ TableViewURLCell* URLCell =
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
URLCell.titleLabel.text = [self titleLabelText];
URLCell.URLLabel.text = [self URLLabelText];
URLCell.cellUniqueIdentifier = base::SysUTF8ToNSString(self.entryURL.host());
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_table_view_item_unittest.mm b/ios/chrome/browser/ui/reading_list/reading_list_table_view_item_unittest.mm
index 4750e85b..bb5fc210 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_table_view_item_unittest.mm
+++ b/ios/chrome/browser/ui/reading_list/reading_list_table_view_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/reading_list/reading_list_table_view_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/url_formatter/elide_url.h"
#import "ios/chrome/browser/net/crurl.h"
diff --git a/ios/chrome/browser/ui/recent_tabs/recent_tabs_app_interface.mm b/ios/chrome/browser/ui/recent_tabs/recent_tabs_app_interface.mm
index 771011f..f096abac 100644
--- a/ios/chrome/browser/ui/recent_tabs/recent_tabs_app_interface.mm
+++ b/ios/chrome/browser/ui/recent_tabs/recent_tabs_app_interface.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/recent_tabs/recent_tabs_app_interface.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/ui/list_model/list_model.h"
#import "ios/chrome/test/app/chrome_test_util.h"
diff --git a/ios/chrome/browser/ui/recent_tabs/recent_tabs_coordinator_unittest.mm b/ios/chrome/browser/ui/recent_tabs/recent_tabs_coordinator_unittest.mm
index 252f2735..58a497f 100644
--- a/ios/chrome/browser/ui/recent_tabs/recent_tabs_coordinator_unittest.mm
+++ b/ios/chrome/browser/ui/recent_tabs/recent_tabs_coordinator_unittest.mm
@@ -8,8 +8,8 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "base/test/ios/wait_util.h"
#import "components/sessions/core/serialized_navigation_entry_test_helper.h"
#import "components/signin/public/identity_manager/identity_manager.h"
@@ -352,11 +352,11 @@
CreateController();
UINavigationController* navigation_controller =
- base::mac::ObjCCastStrict<UINavigationController>(
+ base::apple::ObjCCastStrict<UINavigationController>(
base_view_controller_.presentedViewController);
RecentTabsTableViewController* view_controller =
- base::mac::ObjCCastStrict<RecentTabsTableViewController>(
+ base::apple::ObjCCastStrict<RecentTabsTableViewController>(
navigation_controller.topViewController);
[coordinator_ stop];
diff --git a/ios/chrome/browser/ui/recent_tabs/recent_tabs_table_view_controller.mm b/ios/chrome/browser/ui/recent_tabs/recent_tabs_table_view_controller.mm
index b1bd555..5766450 100644
--- a/ios/chrome/browser/ui/recent_tabs/recent_tabs_table_view_controller.mm
+++ b/ios/chrome/browser/ui/recent_tabs/recent_tabs_table_view_controller.mm
@@ -6,9 +6,9 @@
#import <objc/runtime.h>
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
@@ -1199,11 +1199,11 @@
if (itemTypeSelected == ItemTypeOtherDevicesSigninPromo) {
[self.signinPromoViewMediator signinPromoViewIsVisible];
TableViewSigninPromoCell* signinPromoCell =
- base::mac::ObjCCastStrict<TableViewSigninPromoCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSigninPromoCell>(cell);
if (base::FeatureList::IsEnabled(
syncer::kReplaceSyncPromosWithSignInPromos)) {
TableViewSigninPromoItem* signinPromoItem =
- base::mac::ObjCCastStrict<TableViewSigninPromoItem>(
+ base::apple::ObjCCastStrict<TableViewSigninPromoItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
[signinPromoItem.configurator
configureSigninPromoView:signinPromoCell.signinPromoView
@@ -1231,13 +1231,13 @@
}
// Set button action method for ItemTypeOtherDevicesSyncOff.
if (itemTypeSelected == ItemTypeOtherDevicesSyncOff) {
- TableViewIllustratedCell* illustratedCell =
- base::mac::ObjCCastStrict<TableViewIllustratedCell>(cell);
- [illustratedCell.button addTarget:self
- action:@selector(updateSyncState)
- forControlEvents:UIControlEventTouchUpInside];
- illustratedCell.button.accessibilityIdentifier =
- kRecentTabsTabSyncOffButtonAccessibilityIdentifier;
+ TableViewIllustratedCell* illustratedCell =
+ base::apple::ObjCCastStrict<TableViewIllustratedCell>(cell);
+ [illustratedCell.button addTarget:self
+ action:@selector(updateSyncState)
+ forControlEvents:UIControlEventTouchUpInside];
+ illustratedCell.button.accessibilityIdentifier =
+ kRecentTabsTabSyncOffButtonAccessibilityIdentifier;
}
// Hide the separator between this cell and the SignIn Promo.
if (itemTypeSelected == ItemTypeOtherDevicesSignedOut) {
@@ -1249,7 +1249,7 @@
TabsSearchService* search_service =
TabsSearchServiceFactory::GetForBrowserState(self.browserState);
__weak TableViewTabsSearchSuggestedHistoryCell* weakCell =
- base::mac::ObjCCastStrict<TableViewTabsSearchSuggestedHistoryCell>(
+ base::apple::ObjCCastStrict<TableViewTabsSearchSuggestedHistoryCell>(
cell);
NSString* currentSearchTerm = self.searchTerms;
@@ -1299,7 +1299,8 @@
return nil;
TableViewItem* item = [self.tableViewModel itemAtIndexPath:indexPath];
- TableViewURLItem* URLItem = base::mac::ObjCCastStrict<TableViewURLItem>(item);
+ TableViewURLItem* URLItem =
+ base::apple::ObjCCastStrict<TableViewURLItem>(item);
return [self.menuProvider
contextMenuConfigurationForItem:URLItem
@@ -1333,7 +1334,7 @@
case ItemTypeSessionTabData: {
TableViewItem* item = [self.tableViewModel itemAtIndexPath:indexPath];
TableViewURLItem* URLItem =
- base::mac::ObjCCastStrict<TableViewURLItem>(item);
+ base::apple::ObjCCastStrict<TableViewURLItem>(item);
GURL gurl;
if (URLItem.URL)
gurl = URLItem.URL.gurl;
@@ -1391,8 +1392,10 @@
DCHECK(item);
DCHECK(cell);
- TableViewURLItem* URLItem = base::mac::ObjCCastStrict<TableViewURLItem>(item);
- TableViewURLCell* URLCell = base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ TableViewURLItem* URLItem =
+ base::apple::ObjCCastStrict<TableViewURLItem>(item);
+ TableViewURLCell* URLCell =
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
NSString* itemIdentifier = URLItem.uniqueIdentifier;
[self.imageDataSource
@@ -1678,10 +1681,10 @@
if (headerItem.type == ItemTypeRecentlyClosedHeader ||
headerItem.type == ItemTypeSessionHeader) {
TableViewDisclosureHeaderFooterView* disclosureHeaderView =
- base::mac::ObjCCastStrict<TableViewDisclosureHeaderFooterView>(
+ base::apple::ObjCCastStrict<TableViewDisclosureHeaderFooterView>(
headerView);
TableViewDisclosureHeaderFooterItem* disclosureItem =
- base::mac::ObjCCastStrict<TableViewDisclosureHeaderFooterItem>(
+ base::apple::ObjCCastStrict<TableViewDisclosureHeaderFooterItem>(
headerItem);
BOOL collapsed = [self.tableViewModel
sectionIsCollapsed:[self.tableViewModel
@@ -1759,7 +1762,7 @@
sectionIdentifier:SectionIdentifierOtherDevices];
TableViewItem* item = [self.tableViewModel itemAtIndexPath:indexPath];
TableViewSigninPromoItem* signInItem =
- base::mac::ObjCCastStrict<TableViewSigninPromoItem>(item);
+ base::apple::ObjCCastStrict<TableViewSigninPromoItem>(item);
signInItem.configurator = configurator;
// If section is collapsed no tableView update is needed.
if ([self.tableViewModel
diff --git a/ios/chrome/browser/ui/safe_mode/safe_mode_egtest.mm b/ios/chrome/browser/ui/safe_mode/safe_mode_egtest.mm
index 18c9de9..dfb6f288 100644
--- a/ios/chrome/browser/ui/safe_mode/safe_mode_egtest.mm
+++ b/ios/chrome/browser/ui/safe_mode/safe_mode_egtest.mm
@@ -3,9 +3,9 @@
// found in the LICENSE file.
#import "base/apple/bundle_locations.h"
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/ui/safe_mode/safe_mode_app_interface.h"
#import "ios/chrome/grit/ios_chromium_strings.h"
diff --git a/ios/chrome/browser/ui/scanner/camera_controller.mm b/ios/chrome/browser/ui/scanner/camera_controller.mm
index 5465fe7..8404b37 100644
--- a/ios/chrome/browser/ui/scanner/camera_controller.mm
+++ b/ios/chrome/browser/ui/scanner/camera_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/scanner/camera_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/stringprintf.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
diff --git a/ios/chrome/browser/ui/scanner/scanner_view.mm b/ios/chrome/browser/ui/scanner/scanner_view.mm
index 621392e..cd6566f 100644
--- a/ios/chrome/browser/ui/scanner/scanner_view.mm
+++ b/ios/chrome/browser/ui/scanner/scanner_view.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/scanner/scanner_view.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "base/numerics/math_constants.h"
#import "ios/chrome/browser/shared/ui/symbols/chrome_icon.h"
#import "ios/chrome/browser/ui/scanner/preview_overlay_view.h"
diff --git a/ios/chrome/browser/ui/scanner/video_preview_view.mm b/ios/chrome/browser/ui/scanner/video_preview_view.mm
index c2f4d08..bdf07ad 100644
--- a/ios/chrome/browser/ui/scanner/video_preview_view.mm
+++ b/ios/chrome/browser/ui/scanner/video_preview_view.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/scanner/video_preview_view.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/common/ui/util/ui_util.h"
@interface VideoPreviewView () {
@@ -31,7 +31,7 @@
}
- (AVCaptureVideoPreviewLayer*)previewLayer {
- return base::mac::ObjCCastStrict<AVCaptureVideoPreviewLayer>([self layer]);
+ return base::apple::ObjCCastStrict<AVCaptureVideoPreviewLayer>([self layer]);
}
- (CGRect)viewportRegionOfInterest {
diff --git a/ios/chrome/browser/ui/search_with/search_with_mediator.mm b/ios/chrome/browser/ui/search_with/search_with_mediator.mm
index 0948193..ecc5c358 100644
--- a/ios/chrome/browser/ui/search_with/search_with_mediator.mm
+++ b/ios/chrome/browser/ui/search_with/search_with_mediator.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/search_with/search_with_mediator.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/memory/raw_ptr.h"
#import "base/memory/weak_ptr.h"
#import "base/metrics/histogram_functions.h"
diff --git a/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_coordinator.mm b/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_coordinator.mm
index d65beba..1f3e621 100644
--- a/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_coordinator.mm
+++ b/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_coordinator.mm
@@ -8,9 +8,9 @@
#import <memory>
#import <utility>
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/ios/block_types.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/send_tab_to_self/entry_point_display_reason.h"
#import "components/send_tab_to_self/metrics_util.h"
@@ -219,7 +219,7 @@
- (CGFloat)modalHeightForWidth:(CGFloat)width {
UIView* view = self.sendTabToSelfViewController.view;
CGSize contentSize = CGSizeZero;
- if (UIScrollView* scrollView = base::mac::ObjCCast<UIScrollView>(view)) {
+ if (UIScrollView* scrollView = base::apple::ObjCCast<UIScrollView>(view)) {
CGRect layoutFrame = self.baseViewController.view.bounds;
layoutFrame.size.width = width;
scrollView.frame = layoutFrame;
diff --git a/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_manage_devices_item.mm b/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_manage_devices_item.mm
index c4d70b4..a63e0279 100644
--- a/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_manage_devices_item.mm
+++ b/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_manage_devices_item.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_manage_devices_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_cell.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
@@ -132,7 +132,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:cell withStyler:styler];
SendTabtoSelfManageDevicesCell* accountCell =
- base::mac::ObjCCastStrict<SendTabtoSelfManageDevicesCell>(cell);
+ base::apple::ObjCCastStrict<SendTabtoSelfManageDevicesCell>(cell);
if (self.showManageDevicesLink) {
NSString* text =
diff --git a/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_table_view_controller.mm b/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_table_view_controller.mm
index c348774..c6b1d727 100644
--- a/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_table_view_controller.mm
+++ b/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_table_view_controller.mm
@@ -6,9 +6,9 @@
#import <utility>
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/string_number_conversions.h"
#import "base/strings/sys_string_conversions.h"
#import "components/send_tab_to_self/features.h"
@@ -176,7 +176,7 @@
if (itemType == ItemTypeSend) {
TableViewTextButtonCell* tableViewTextButtonCell =
- base::mac::ObjCCastStrict<TableViewTextButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextButtonCell>(cell);
[tableViewTextButtonCell.button addTarget:self
action:@selector(sendTabWhenPressed:)
forControlEvents:UIControlEventTouchUpInside];
@@ -199,7 +199,7 @@
DCHECK(item);
if (item.type == ItemTypeDevice) {
SendTabToSelfImageDetailTextItem* imageDetailTextItem =
- base::mac::ObjCCastStrict<SendTabToSelfImageDetailTextItem>(item);
+ base::apple::ObjCCastStrict<SendTabToSelfImageDetailTextItem>(item);
if (imageDetailTextItem == self.selectedItem) {
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
return;
diff --git a/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.mm b/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.mm
index f166def..77c5eb5 100644
--- a/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.mm
@@ -6,8 +6,8 @@
#import <MaterialComponents/MaterialSnackbar.h>
+#import "base/apple/foundation_util.h"
#import "base/ios/block_types.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/notreached.h"
@@ -133,7 +133,7 @@
viewForFooterInSection:(NSInteger)section {
UIView* footer = [super tableView:tableView viewForFooterInSection:section];
VersionFooter* versionFooter =
- base::mac::ObjCCastStrict<VersionFooter>(footer);
+ base::apple::ObjCCastStrict<VersionFooter>(footer);
versionFooter.delegate = self;
return footer;
}
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_add_credit_card_view_controller.mm b/ios/chrome/browser/ui/settings/autofill/autofill_add_credit_card_view_controller.mm
index ee687f4c..9a9fe9c 100644
--- a/ios/chrome/browser/ui/settings/autofill/autofill_add_credit_card_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/autofill/autofill_add_credit_card_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/autofill/autofill_add_credit_card_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_edit_item.h"
@@ -225,7 +225,7 @@
// Set the delegate and style for only `TableViewTextEditCell` type of cell
// not other types.
TableViewTextEditCell* editCell =
- base::mac::ObjCCast<TableViewTextEditCell>(cell);
+ base::apple::ObjCCast<TableViewTextEditCell>(cell);
editCell.textField.delegate = self;
editCell.selectionStyle = UITableViewCellSelectionStyleNone;
@@ -291,7 +291,7 @@
NSIndexPath* path =
[self.tableViewModel indexPathForItemType:itemType
sectionIdentifier:sectionIdentifier];
- AutofillEditItem* item = base::mac::ObjCCastStrict<AutofillEditItem>(
+ AutofillEditItem* item = base::apple::ObjCCastStrict<AutofillEditItem>(
[self.tableViewModel itemAtIndexPath:path]);
NSString* text = item.textFieldValue;
return text;
@@ -305,7 +305,7 @@
NSIndexPath* path =
[self.tableViewModel indexPathForItemType:itemType
sectionIdentifier:sectionIdentifier];
- AutofillEditItem* item = base::mac::ObjCCastStrict<AutofillEditItem>(
+ AutofillEditItem* item = base::apple::ObjCCastStrict<AutofillEditItem>(
[self.tableViewModel itemAtIndexPath:path]);
item.textFieldValue = text;
[self reconfigureCellsForItems:@[ item ]];
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_edit_table_view_controller.mm b/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_edit_table_view_controller.mm
index 19a7833..bbc9ff8 100644
--- a/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_edit_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_edit_table_view_controller.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/settings/autofill/autofill_credit_card_edit_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/format_macros.h"
#import "base/ios/block_types.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/autofill/core/browser/autofill_data_util.h"
#import "components/autofill/core/browser/data_model/credit_card.h"
@@ -123,7 +123,7 @@
for (NSInteger itemIndex = 0; itemIndex < itemCount; ++itemIndex) {
NSIndexPath* path = [NSIndexPath indexPathForItem:itemIndex
inSection:section];
- AutofillEditItem* item = base::mac::ObjCCastStrict<AutofillEditItem>(
+ AutofillEditItem* item = base::apple::ObjCCastStrict<AutofillEditItem>(
[model itemAtIndexPath:path]);
if ([self.tableViewModel itemTypeForIndexPath:path] == ItemTypeNickname) {
NSString* trimmedNickname = [item.textFieldValue
@@ -271,7 +271,7 @@
NSInteger itemType = [self.tableViewModel itemTypeForIndexPath:indexPath];
TableViewTextEditCell* editCell =
- base::mac::ObjCCast<TableViewTextEditCell>(cell);
+ base::apple::ObjCCast<TableViewTextEditCell>(cell);
editCell.textField.delegate = self;
switch (itemType) {
case ItemTypeCardholderName:
@@ -282,7 +282,7 @@
break;
case ItemTypeCopiedToChrome: {
CopiedToChromeCell* copiedToChromeCell =
- base::mac::ObjCCastStrict<CopiedToChromeCell>(cell);
+ base::apple::ObjCCastStrict<CopiedToChromeCell>(cell);
[copiedToChromeCell.button addTarget:self
action:@selector(buttonTapped:)
forControlEvents:UIControlEventTouchUpInside];
@@ -309,7 +309,7 @@
if (self.tableView.editing) {
UITableViewCell* cell = [self.tableView cellForRowAtIndexPath:indexPath];
TableViewTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(cell);
[textFieldCell.textField becomeFirstResponder];
}
}
@@ -468,7 +468,7 @@
NSIndexPath* indexPath =
[self.tableViewModel indexPathForItemType:itemType
sectionIdentifier:SectionIdentifierFields];
- AutofillEditItem* item = base::mac::ObjCCastStrict<AutofillEditItem>(
+ AutofillEditItem* item = base::apple::ObjCCastStrict<AutofillEditItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
return item.textFieldValue;
}
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.mm b/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.mm
index 67b0f491..497ceadfe 100644
--- a/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/strings/sys_string_conversions.h"
#import "components/autofill/core/browser/personal_data_manager.h"
@@ -354,7 +354,7 @@
break;
case ItemTypeAutofillCardSwitch: {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(autofillCardSwitchChanged:)
forControlEvents:UIControlEventValueChanged];
@@ -362,7 +362,7 @@
}
case ItemTypeAutofillCardManaged: {
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[managedCell.trailingButton
addTarget:self
action:@selector(didTapManagedUIInfoButton:)
@@ -391,7 +391,7 @@
[self.tableViewModel indexPathForItemType:switchItemType
sectionIdentifier:SectionIdentifierSwitches];
TableViewSwitchItem* switchItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(
[self.tableViewModel itemAtIndexPath:switchPath]);
switchItem.on = on;
}
@@ -410,7 +410,7 @@
[model indexPathForItemType:switchItemType
sectionIdentifier:SectionIdentifierSwitches];
TableViewSwitchItem* switchItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(
[model itemAtIndexPath:switchPath]);
[switchItem setEnabled:enabled];
[self reconfigureCellsForItems:@[ switchItem ]];
@@ -472,7 +472,7 @@
TableViewItem* item = [self.tableViewModel itemAtIndexPath:indexPath];
if ([item isKindOfClass:[AutofillCardItem class]]) {
AutofillCardItem* autofillItem =
- base::mac::ObjCCastStrict<AutofillCardItem>(item);
+ base::apple::ObjCCastStrict<AutofillCardItem>(item);
return [autofillItem isDeletable];
}
return NO;
@@ -497,7 +497,7 @@
self.deletionInProgress = YES;
for (NSIndexPath* indexPath in indexPaths) {
- AutofillCardItem* item = base::mac::ObjCCastStrict<AutofillCardItem>(
+ AutofillCardItem* item = base::apple::ObjCCastStrict<AutofillCardItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
_personalDataManager->RemoveByGUID(item.GUID);
}
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller_unittest.mm
index 3787efd..88b016b 100644
--- a/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/utf_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "base/uuid.h"
@@ -49,7 +49,7 @@
}
void TearDown() override {
- [base::mac::ObjCCastStrict<AutofillCreditCardTableViewController>(
+ [base::apple::ObjCCastStrict<AutofillCreditCardTableViewController>(
controller()) settingsWillBeDismissed];
ChromeTableViewControllerTest::TearDown();
}
@@ -82,7 +82,7 @@
// timeout.
bool deleteItemAndWait(int section, int row, ConditionBlock condition) {
AutofillCreditCardTableViewController* view_controller =
- base::mac::ObjCCastStrict<AutofillCreditCardTableViewController>(
+ base::apple::ObjCCastStrict<AutofillCreditCardTableViewController>(
controller());
[view_controller deleteItems:@[ [NSIndexPath indexPathForRow:row
inSection:section] ]];
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_edit_table_view_controller.mm b/ios/chrome/browser/ui/settings/autofill/autofill_edit_table_view_controller.mm
index c8a8ab3..7ab88ab 100644
--- a/ios/chrome/browser/ui/settings/autofill/autofill_edit_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/autofill/autofill_edit_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/autofill/autofill_edit_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
#import "ios/chrome/browser/ui/autofill/cells/autofill_edit_item.h"
@@ -137,7 +137,7 @@
TableViewTextEditCell* settingsCell = nil;
for (UIView* view = textField; view; view = [view superview]) {
TableViewTextEditCell* cell =
- base::mac::ObjCCast<TableViewTextEditCell>(view);
+ base::apple::ObjCCast<TableViewTextEditCell>(view);
if (cell) {
settingsCell = cell;
break;
@@ -201,7 +201,7 @@
if (nextCellPath) {
TableViewTextEditCell* nextCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(
[self.tableView cellForRowAtIndexPath:nextCellPath]);
[nextCell.textField becomeFirstResponder];
} else {
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller.mm b/ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller.mm
index 7337e78..75b1659 100644
--- a/ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/i18n/message_formatter.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/strings/sys_string_conversions.h"
@@ -360,7 +360,7 @@
return;
}
- AutofillProfileItem* item = base::mac::ObjCCastStrict<AutofillProfileItem>(
+ AutofillProfileItem* item = base::apple::ObjCCastStrict<AutofillProfileItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
[self
showAddressProfileDetailsPageForProfile:_personalDataManager
@@ -439,7 +439,7 @@
break;
case ItemTypeAutofillAddressSwitch: {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(autofillAddressSwitchChanged:)
forControlEvents:UIControlEventValueChanged];
@@ -447,7 +447,7 @@
}
case ItemTypeAutofillAddressManaged: {
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[managedCell.trailingButton
addTarget:self
action:@selector(didTapManagedUIInfoButton:)
@@ -476,7 +476,7 @@
[self.tableViewModel indexPathForItemType:switchItemType
sectionIdentifier:SectionIdentifierSwitches];
TableViewSwitchItem* switchItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(
[self.tableViewModel itemAtIndexPath:switchPath]);
switchItem.on = on;
}
@@ -495,7 +495,7 @@
[model indexPathForItemType:switchItemType
sectionIdentifier:SectionIdentifierSwitches];
TableViewSwitchItem* switchItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(
[model itemAtIndexPath:switchPath]);
[switchItem setEnabled:enabled];
[self reconfigureCellsForItems:@[ switchItem ]];
@@ -578,8 +578,9 @@
_deletionInProgress = YES;
for (NSIndexPath* indexPath in indexPaths) {
- AutofillProfileItem* item = base::mac::ObjCCastStrict<AutofillProfileItem>(
- [self.tableViewModel itemAtIndexPath:indexPath]);
+ AutofillProfileItem* item =
+ base::apple::ObjCCastStrict<AutofillProfileItem>(
+ [self.tableViewModel itemAtIndexPath:indexPath]);
_personalDataManager->RemoveByGUID([item GUID]);
}
@@ -655,8 +656,9 @@
continue;
}
profileCount++;
- AutofillProfileItem* item = base::mac::ObjCCastStrict<AutofillProfileItem>(
- [self.tableViewModel itemAtIndexPath:indexPath]);
+ AutofillProfileItem* item =
+ base::apple::ObjCCastStrict<AutofillProfileItem>(
+ [self.tableViewModel itemAtIndexPath:indexPath]);
switch (item.autofillProfileSource) {
case AutofillAccountProfile:
accountProfiles = YES;
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller_unittest.mm
index 569ae08..1617c356 100644
--- a/ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/autofill/autofill_profile_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/utf_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "base/test/scoped_feature_list.h"
@@ -63,8 +63,8 @@
}
void TearDown() override {
- [base::mac::ObjCCastStrict<AutofillProfileTableViewController>(controller())
- settingsWillBeDismissed];
+ [base::apple::ObjCCastStrict<AutofillProfileTableViewController>(
+ controller()) settingsWillBeDismissed];
ChromeTableViewControllerTest::TearDown();
}
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_settings_profile_edit_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/autofill/autofill_settings_profile_edit_table_view_controller_unittest.mm
index 26bb2a2..70c8400 100644
--- a/ios/chrome/browser/ui/settings/autofill/autofill_settings_profile_edit_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/autofill/autofill_settings_profile_edit_table_view_controller_unittest.mm
@@ -5,8 +5,8 @@
#import "ios/chrome/browser/ui/settings/autofill/autofill_settings_profile_edit_table_view_controller.h"
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "components/autofill/core/browser/autofill_test_utils.h"
diff --git a/ios/chrome/browser/ui/settings/autofill/cells/autofill_profile_item.mm b/ios/chrome/browser/ui/settings/autofill/cells/autofill_profile_item.mm
index cc7d6d7b..a69b81d8 100644
--- a/ios/chrome/browser/ui/settings/autofill/cells/autofill_profile_item.mm
+++ b/ios/chrome/browser/ui/settings/autofill/cells/autofill_profile_item.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/autofill/cells/autofill_profile_item.h"
+#import "base/apple/foundation_util.h"
#import "base/i18n/rtl.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
diff --git a/ios/chrome/browser/ui/settings/autofill/cells/autofill_profile_item_unittest.mm b/ios/chrome/browser/ui/settings/autofill/cells/autofill_profile_item_unittest.mm
index 6df64ea..ebd74e3 100644
--- a/ios/chrome/browser/ui/settings/autofill/cells/autofill_profile_item_unittest.mm
+++ b/ios/chrome/browser/ui/settings/autofill/cells/autofill_profile_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/autofill/cells/autofill_profile_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
@@ -29,7 +29,7 @@
ASSERT_TRUE([cell isMemberOfClass:[AutofillProfileCell class]]);
AutofillProfileCell* imageCell =
- base::mac::ObjCCastStrict<AutofillProfileCell>(cell);
+ base::apple::ObjCCastStrict<AutofillProfileCell>(cell);
EXPECT_FALSE(imageCell.textLabel.text);
EXPECT_FALSE(imageCell.detailTextLabel.text);
EXPECT_FALSE(imageCell.imageView.image);
@@ -51,7 +51,7 @@
ASSERT_TRUE([cell isMemberOfClass:[AutofillProfileCell class]]);
AutofillProfileCell* imageCell =
- base::mac::ObjCCastStrict<AutofillProfileCell>(cell);
+ base::apple::ObjCCastStrict<AutofillProfileCell>(cell);
EXPECT_FALSE(item.image);
[item configureCell:cell withStyler:[[ChromeTableViewStyler alloc] init]];
EXPECT_FALSE(item.image);
diff --git a/ios/chrome/browser/ui/settings/bandwidth/bandwidth_management_table_view_controller.mm b/ios/chrome/browser/ui/settings/bandwidth/bandwidth_management_table_view_controller.mm
index c8957e2..146acfcc 100644
--- a/ios/chrome/browser/ui/settings/bandwidth/bandwidth_management_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/bandwidth/bandwidth_management_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/bandwidth/bandwidth_management_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/prefs/ios/pref_observer_bridge.h"
@@ -120,7 +120,7 @@
if (SectionIdentifierActions ==
[self.tableViewModel sectionIdentifierForSectionIndex:section]) {
TableViewLinkHeaderFooterView* footer =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterView>(footerView);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterView>(footerView);
footer.delegate = self;
}
return footerView;
diff --git a/ios/chrome/browser/ui/settings/bandwidth/dataplan_usage_table_view_controller.mm b/ios/chrome/browser/ui/settings/bandwidth/dataplan_usage_table_view_controller.mm
index 9103112b..d7d4f950 100644
--- a/ios/chrome/browser/ui/settings/bandwidth/dataplan_usage_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/bandwidth/dataplan_usage_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/bandwidth/dataplan_usage_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "components/prefs/pref_member.h"
#import "components/prefs/pref_service.h"
#import "ios/chrome/browser/prerender/prerender_pref.h"
diff --git a/ios/chrome/browser/ui/settings/cells/search_engine_item.mm b/ios/chrome/browser/ui/settings/cells/search_engine_item.mm
index a55ac93..d3c420f 100644
--- a/ios/chrome/browser/ui/settings/cells/search_engine_item.mm
+++ b/ios/chrome/browser/ui/settings/cells/search_engine_item.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/cells/search_engine_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_url_item.h"
@@ -42,7 +42,7 @@
self.uniqueIdentifier = base::SysUTF8ToNSString(self.URL.host());
TableViewURLCell* cell =
- base::mac::ObjCCastStrict<TableViewURLCell>(tableCell);
+ base::apple::ObjCCastStrict<TableViewURLCell>(tableCell);
cell.titleLabel.text = self.text;
cell.URLLabel.text = self.detailText;
cell.cellUniqueIdentifier = self.uniqueIdentifier;
diff --git a/ios/chrome/browser/ui/settings/cells/search_engine_item_unittest.mm b/ios/chrome/browser/ui/settings/cells/search_engine_item_unittest.mm
index 52ac0a1..cb23b92 100644
--- a/ios/chrome/browser/ui/settings/cells/search_engine_item_unittest.mm
+++ b/ios/chrome/browser/ui/settings/cells/search_engine_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/cells/search_engine_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_url_item.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
@@ -33,7 +33,8 @@
id cell = [[[item cellClass] alloc] init];
ASSERT_TRUE([cell isMemberOfClass:[TableViewURLCell class]]);
- TableViewURLCell* URLCell = base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ TableViewURLCell* URLCell =
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
EXPECT_FALSE(URLCell.titleLabel.text);
EXPECT_FALSE(URLCell.URLLabel.text);
EXPECT_EQ(item.uniqueIdentifier, URLCell.cellUniqueIdentifier);
diff --git a/ios/chrome/browser/ui/settings/cells/settings_check_item_unittest.mm b/ios/chrome/browser/ui/settings/cells/settings_check_item_unittest.mm
index 0db4191..631736e 100644
--- a/ios/chrome/browser/ui/settings/cells/settings_check_item_unittest.mm
+++ b/ios/chrome/browser/ui/settings/cells/settings_check_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/cells/settings_check_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/ui/settings/cells/settings_check_cell.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
@@ -32,7 +32,7 @@
ASSERT_TRUE([cell isMemberOfClass:[SettingsCheckCell class]]);
SettingsCheckCell* CheckCell =
- base::mac::ObjCCastStrict<SettingsCheckCell>(cell);
+ base::apple::ObjCCastStrict<SettingsCheckCell>(cell);
EXPECT_FALSE(CheckCell.textLabel.text);
EXPECT_FALSE(CheckCell.detailTextLabel.text);
@@ -53,7 +53,7 @@
id cell = [[[item cellClass] alloc] init];
SettingsCheckCell* CheckCell =
- base::mac::ObjCCastStrict<SettingsCheckCell>(cell);
+ base::apple::ObjCCastStrict<SettingsCheckCell>(cell);
[item configureCell:cell withStyler:[[ChromeTableViewStyler alloc] init]];
EXPECT_FALSE(CheckCell.infoButton.hidden);
@@ -74,7 +74,7 @@
id cell = [[[item cellClass] alloc] init];
SettingsCheckCell* CheckCell =
- base::mac::ObjCCastStrict<SettingsCheckCell>(cell);
+ base::apple::ObjCCastStrict<SettingsCheckCell>(cell);
[item configureCell:cell withStyler:[[ChromeTableViewStyler alloc] init]];
EXPECT_TRUE(CheckCell.infoButton.hidden);
@@ -91,7 +91,7 @@
id cell = [[[item cellClass] alloc] init];
SettingsCheckCell* CheckCell =
- base::mac::ObjCCastStrict<SettingsCheckCell>(cell);
+ base::apple::ObjCCastStrict<SettingsCheckCell>(cell);
[item configureCell:cell withStyler:[[ChromeTableViewStyler alloc] init]];
EXPECT_FALSE(CheckCell.infoButton.hidden);
diff --git a/ios/chrome/browser/ui/settings/cells/table_view_clear_browsing_data_item.mm b/ios/chrome/browser/ui/settings/cells/table_view_clear_browsing_data_item.mm
index e663854..8a7bd2e 100644
--- a/ios/chrome/browser/ui/settings/cells/table_view_clear_browsing_data_item.mm
+++ b/ios/chrome/browser/ui/settings/cells/table_view_clear_browsing_data_item.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/cells/table_view_clear_browsing_data_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
@@ -33,7 +33,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:tableCell withStyler:styler];
TableViewClearBrowsingDataCell* cell =
- base::mac::ObjCCastStrict<TableViewClearBrowsingDataCell>(tableCell);
+ base::apple::ObjCCastStrict<TableViewClearBrowsingDataCell>(tableCell);
[cell setImage:self.image];
cell.textLabel.text = self.text;
cell.detailTextLabel.text = self.detailText;
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_coordinator.mm b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_coordinator.mm
index 633efd6..68ac5d5 100644
--- a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_coordinator.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_coordinator.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/model/browser/browser.h"
#import "ios/chrome/browser/shared/public/commands/application_commands.h"
#import "ios/chrome/browser/shared/public/commands/command_dispatcher.h"
@@ -76,7 +76,7 @@
- (void)clearBrowsingDataTableViewControllerWantsDismissal:
(ClearBrowsingDataTableViewController*)controller {
SettingsNavigationController* navigationController =
- base::mac::ObjCCastStrict<SettingsNavigationController>(
+ base::apple::ObjCCastStrict<SettingsNavigationController>(
self.viewController.navigationController);
CHECK_EQ(controller, self.viewController);
// The user tapped the "done" button, so the entire settings should be
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_egtest.mm b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_egtest.mm
index 02763e5a..97e95c41 100644
--- a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_egtest.mm
+++ b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_egtest.mm
@@ -4,8 +4,8 @@
#import <XCTest/XCTest.h>
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/ui/elements/activity_overlay_egtest_util.h"
#import "ios/chrome/browser/shared/ui/elements/elements_constants.h"
#import "ios/chrome/browser/signin/fake_system_identity.h"
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.mm b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.mm
index bba590d7..71c84748 100644
--- a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.mm
+++ b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.h"
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/scoped_observation.h"
#import "base/strings/sys_string_conversions.h"
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager_unittest.mm b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager_unittest.mm
index e82383aa..f471eb2 100644
--- a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager_unittest.mm
+++ b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager_unittest.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.h"
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/utf_string_conversions.h"
#import "components/browsing_data/core/pref_names.h"
#import "components/pref_registry/pref_registry_syncable.h"
@@ -321,7 +321,7 @@
ListItem* googleAccount =
[model_ footerForSectionWithIdentifier:SectionIdentifierGoogleAccount];
TableViewLinkHeaderFooterItem* accountFooterTextItem =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterItem>(googleAccount);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterItem>(googleAccount);
ASSERT_TRUE(([accountFooterTextItem.text rangeOfString:@"Google"].location !=
NSNotFound));
ASSERT_EQ(2u, [accountFooterTextItem.urls count]);
@@ -360,7 +360,7 @@
ListItem* googleAccount =
[model_ footerForSectionWithIdentifier:SectionIdentifierGoogleAccount];
TableViewLinkHeaderFooterItem* accountFooterTextItem =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterItem>(googleAccount);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterItem>(googleAccount);
ASSERT_TRUE(
([accountFooterTextItem.text
rangeOfString:[NSString
@@ -394,7 +394,7 @@
ListItem* googleAccount =
[model_ footerForSectionWithIdentifier:SectionIdentifierGoogleAccount];
TableViewLinkHeaderFooterItem* accountFooterTextItem =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterItem>(googleAccount);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterItem>(googleAccount);
ASSERT_TRUE(
([accountFooterTextItem.text
rangeOfString:[NSString
@@ -429,7 +429,7 @@
ListItem* googleAccount =
[model_ footerForSectionWithIdentifier:SectionIdentifierGoogleAccount];
TableViewLinkHeaderFooterItem* accountFooterTextItem =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterItem>(googleAccount);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterItem>(googleAccount);
ASSERT_FALSE(
([accountFooterTextItem.text
rangeOfString:[NSString
@@ -464,7 +464,7 @@
ListItem* googleAccount =
[model_ footerForSectionWithIdentifier:SectionIdentifierGoogleAccount];
TableViewLinkHeaderFooterItem* accountFooterTextItem =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterItem>(googleAccount);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterItem>(googleAccount);
ASSERT_FALSE(
([accountFooterTextItem.text
rangeOfString:[NSString
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_table_view_controller.mm b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_table_view_controller.mm
index 907f83f8..f0f968d 100644
--- a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
@@ -275,7 +275,7 @@
case SectionIdentifierSavedSiteData:
case SectionIdentifierGoogleAccount: {
TableViewLinkHeaderFooterView* linkView =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
linkView.delegate = self;
} break;
default:
@@ -317,7 +317,7 @@
case ItemTypeDataTypeAutofill: {
DCHECK([item isKindOfClass:[TableViewClearBrowsingDataItem class]]);
TableViewClearBrowsingDataItem* clearBrowsingDataItem =
- base::mac::ObjCCastStrict<TableViewClearBrowsingDataItem>(item);
+ base::apple::ObjCCastStrict<TableViewClearBrowsingDataItem>(item);
self.browserState->GetPrefs()->SetBoolean(clearBrowsingDataItem.prefName,
!clearBrowsingDataItem.checked);
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/time_range_selector_table_view_controller.mm b/ios/chrome/browser/ui/settings/clear_browsing_data/time_range_selector_table_view_controller.mm
index cdcc398..92f7536 100644
--- a/ios/chrome/browser/ui/settings/clear_browsing_data/time_range_selector_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/clear_browsing_data/time_range_selector_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/clear_browsing_data/time_range_selector_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "components/browsing_data/core/browsing_data_utils.h"
#import "components/browsing_data/core/pref_names.h"
#import "components/prefs/pref_member.h"
diff --git a/ios/chrome/browser/ui/settings/content_settings/block_popups_table_view_controller.mm b/ios/chrome/browser/ui/settings/content_settings/block_popups_table_view_controller.mm
index 13baf856..9267cae 100644
--- a/ios/chrome/browser/ui/settings/content_settings/block_popups_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/content_settings/block_popups_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/content_settings/block_popups_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/values.h"
#import "components/content_settings/core/browser/host_content_settings_map.h"
@@ -178,7 +178,7 @@
break;
case ItemTypeMainSwitch: {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(blockPopupsSwitchChanged:)
forControlEvents:UIControlEventValueChanged];
@@ -186,7 +186,7 @@
}
case ItemTypeManaged: {
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[managedCell.trailingButton
addTarget:self
action:@selector(didTapManagedUIInfoButton:)
diff --git a/ios/chrome/browser/ui/settings/content_settings/block_popups_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/content_settings/block_popups_table_view_controller_unittest.mm
index 10ca89c4..0b8de62 100644
--- a/ios/chrome/browser/ui/settings/content_settings/block_popups_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/content_settings/block_popups_table_view_controller_unittest.mm
@@ -6,7 +6,7 @@
#import <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "components/content_settings/core/browser/host_content_settings_map.h"
@@ -197,10 +197,10 @@
NSIndexPath* first_index = [NSIndexPath indexPathForRow:0 inSection:1];
NSIndexPath* second_index = [NSIndexPath indexPathForRow:1 inSection:1];
TableViewDetailTextItem* first_item =
- base::mac::ObjCCastStrict<TableViewDetailTextItem>(
+ base::apple::ObjCCastStrict<TableViewDetailTextItem>(
[popups_controller.tableViewModel itemAtIndexPath:first_index]);
TableViewDetailTextItem* second_item =
- base::mac::ObjCCastStrict<TableViewDetailTextItem>(
+ base::apple::ObjCCastStrict<TableViewDetailTextItem>(
[popups_controller.tableViewModel itemAtIndexPath:second_index]);
std::set<std::string> deleted_patterns{
diff --git a/ios/chrome/browser/ui/settings/content_settings/content_settings_table_view_controller.mm b/ios/chrome/browser/ui/settings/content_settings/content_settings_table_view_controller.mm
index 9002cfb..38b109d 100644
--- a/ios/chrome/browser/ui/settings/content_settings/content_settings_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/content_settings/content_settings_table_view_controller.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/settings/content_settings/content_settings_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/content_settings/core/browser/host_content_settings_map.h"
@@ -372,7 +372,7 @@
if (itemType == ItemTypeSettingsShowLinkPreview) {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(showLinkPreviewSwitchToggled:)
forControlEvents:UIControlEventValueChanged];
@@ -380,7 +380,7 @@
if (itemType == ItemTypeSettingsDetectAddresses) {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(detectAddressesSwitchToggled:)
forControlEvents:UIControlEventValueChanged];
diff --git a/ios/chrome/browser/ui/settings/content_settings/content_settings_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/content_settings/content_settings_table_view_controller_unittest.mm
index 87fd249..9fec200 100644
--- a/ios/chrome/browser/ui/settings/content_settings/content_settings_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/content_settings/content_settings_table_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/content_settings/content_settings_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/model/browser/test/test_browser.h"
#import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.h"
@@ -25,8 +25,8 @@
}
void TearDown() override {
- [base::mac::ObjCCastStrict<ContentSettingsTableViewController>(controller())
- settingsWillBeDismissed];
+ [base::apple::ObjCCastStrict<ContentSettingsTableViewController>(
+ controller()) settingsWillBeDismissed];
ChromeTableViewControllerTest::TearDown();
}
diff --git a/ios/chrome/browser/ui/settings/content_settings/default_page_mode_table_view_controller.mm b/ios/chrome/browser/ui/settings/content_settings/default_page_mode_table_view_controller.mm
index 0cacf4b..b87a8a4 100644
--- a/ios/chrome/browser/ui/settings/content_settings/default_page_mode_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/content_settings/default_page_mode_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/content_settings/default_page_mode_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_detail_icon_item.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_link_header_footer_item.h"
@@ -113,7 +113,7 @@
}
TableViewLinkHeaderFooterItem* footer =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterItem>(
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterItem>(
[self.tableViewModel
footerForSectionWithIdentifier:SectionIdentifierMode]);
if (mode == DefaultPageModeDesktop) {
diff --git a/ios/chrome/browser/ui/settings/content_settings/default_page_mode_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/content_settings/default_page_mode_table_view_controller_unittest.mm
index 80469e3..d09a9d94 100644
--- a/ios/chrome/browser/ui/settings/content_settings/default_page_mode_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/content_settings/default_page_mode_table_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/content_settings/default_page_mode_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.h"
#import "ios/chrome/grit/ios_strings.h"
#import "testing/gtest_mac.h"
@@ -65,7 +65,7 @@
TEST_F(DefaultPageModeTableViewControllerTest, TestCheckmark) {
ChromeTableViewController* chrome_controller = controller();
DefaultPageModeTableViewController* controller =
- base::mac::ObjCCastStrict<DefaultPageModeTableViewController>(
+ base::apple::ObjCCastStrict<DefaultPageModeTableViewController>(
chrome_controller);
CheckAccessoryType(UITableViewCellAccessoryNone, 0, 0);
diff --git a/ios/chrome/browser/ui/settings/content_settings/web_inspector_state_table_view_controller.mm b/ios/chrome/browser/ui/settings/content_settings/web_inspector_state_table_view_controller.mm
index 71a6f47..8a1a6b2 100644
--- a/ios/chrome/browser/ui/settings/content_settings/web_inspector_state_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/content_settings/web_inspector_state_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/content_settings/web_inspector_state_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_detail_icon_item.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_link_header_footer_item.h"
@@ -92,7 +92,7 @@
switch ([self.tableViewModel itemTypeForIndexPath:indexPath]) {
case ItemTypeSettingsWebInspectorEnabled: {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView
addTarget:self
action:@selector(webInspectorEnabledSwitchChanged:)
diff --git a/ios/chrome/browser/ui/settings/content_settings/web_inspector_state_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/content_settings/web_inspector_state_table_view_controller_unittest.mm
index 44c4025..8029719 100644
--- a/ios/chrome/browser/ui/settings/content_settings/web_inspector_state_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/content_settings/web_inspector_state_table_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/content_settings/web_inspector_state_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.h"
#import "ios/chrome/grit/ios_strings.h"
#import "testing/gtest_mac.h"
@@ -56,7 +56,7 @@
TEST_F(WebInspectorStateTableViewControllerTest, TestCheckmark) {
ChromeTableViewController* chrome_controller = controller();
WebInspectorStateTableViewController* controller =
- base::mac::ObjCCastStrict<WebInspectorStateTableViewController>(
+ base::apple::ObjCCastStrict<WebInspectorStateTableViewController>(
chrome_controller);
[controller setWebInspectorEnabled:YES];
diff --git a/ios/chrome/browser/ui/settings/default_browser/default_browser_settings_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/default_browser/default_browser_settings_table_view_controller_unittest.mm
index 5f31e41db..9b8578b 100644
--- a/ios/chrome/browser/ui/settings/default_browser/default_browser_settings_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/default_browser/default_browser_settings_table_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/default_browser/default_browser_settings_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.h"
#import "ios/chrome/browser/ui/settings/settings_table_view_controller.h"
#import "ios/chrome/grit/ios_strings.h"
@@ -21,7 +21,7 @@
void SetUp() override { ChromeTableViewControllerTest::SetUp(); }
void TearDown() override {
- [base::mac::ObjCCastStrict<DefaultBrowserSettingsTableViewController>(
+ [base::apple::ObjCCastStrict<DefaultBrowserSettingsTableViewController>(
controller()) settingsWillBeDismissed];
ChromeTableViewControllerTest::TearDown();
}
diff --git a/ios/chrome/browser/ui/settings/elements/enterprise_info_popover_view_controller.mm b/ios/chrome/browser/ui/settings/elements/enterprise_info_popover_view_controller.mm
index cff7211a..5e54f202 100644
--- a/ios/chrome/browser/ui/settings/elements/enterprise_info_popover_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/elements/enterprise_info_popover_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/elements/enterprise_info_popover_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/model/url/chrome_url_constants.h"
#import "ios/chrome/browser/ui/settings/elements/elements_constants.h"
diff --git a/ios/chrome/browser/ui/settings/elements/info_popover_view_controller.mm b/ios/chrome/browser/ui/settings/elements/info_popover_view_controller.mm
index b943da6..994f5424e 100644
--- a/ios/chrome/browser/ui/settings/elements/info_popover_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/elements/info_popover_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/elements/info_popover_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/ui/settings/elements/elements_constants.h"
#import "ios/chrome/common/string_util.h"
@@ -71,7 +71,7 @@
- (void)popoverPresentationControllerDidDismissPopover:
(UIPopoverPresentationController*)popoverPresentationController {
if (_isPresentingFromButton) {
- UIButton* buttonView = base::mac::ObjCCastStrict<UIButton>(
+ UIButton* buttonView = base::apple::ObjCCastStrict<UIButton>(
popoverPresentationController.sourceView);
buttonView.enabled = YES;
}
diff --git a/ios/chrome/browser/ui/settings/elements/supervised_user_info_popover_view_controller.mm b/ios/chrome/browser/ui/settings/elements/supervised_user_info_popover_view_controller.mm
index cbbda44e..e2320c0e 100644
--- a/ios/chrome/browser/ui/settings/elements/supervised_user_info_popover_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/elements/supervised_user_info_popover_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/elements/supervised_user_info_popover_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/supervised_user/core/common/features.h"
#import "ios/chrome/browser/shared/model/url/chrome_url_constants.h"
diff --git a/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.mm b/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.mm
index 7061cd7..ff4354ed 100644
--- a/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
#import "base/strings/sys_string_conversions.h"
@@ -547,7 +547,7 @@
case SectionIdentifierSignOut: {
// Might be a different type of footer.
TableViewLinkHeaderFooterView* linkView =
- base::mac::ObjCCast<TableViewLinkHeaderFooterView>(view);
+ base::apple::ObjCCast<TableViewLinkHeaderFooterView>(view);
linkView.delegate = self;
break;
}
@@ -572,7 +572,7 @@
switch (itemType) {
case ItemTypeAccount: {
TableViewAccountItem* item =
- base::mac::ObjCCastStrict<TableViewAccountItem>(
+ base::apple::ObjCCastStrict<TableViewAccountItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
DCHECK(item.identity);
@@ -827,7 +827,7 @@
_isBeingDismissed = YES;
__weak __typeof(self) weakSelf = self;
void (^popAccountsTableViewController)() = ^() {
- [base::mac::ObjCCastStrict<SettingsNavigationController>(
+ [base::apple::ObjCCastStrict<SettingsNavigationController>(
weakSelf.navigationController)
popViewControllerOrCloseSettingsAnimated:YES];
};
@@ -882,8 +882,9 @@
#pragma mark - ChromeAccountManagerServiceObserver
- (void)identityUpdated:(id<SystemIdentity>)identity {
- TableViewAccountItem* item = base::mac::ObjCCastStrict<TableViewAccountItem>(
- [_identityMap objectForKey:identity.gaiaID]);
+ TableViewAccountItem* item =
+ base::apple::ObjCCastStrict<TableViewAccountItem>(
+ [_identityMap objectForKey:identity.gaiaID]);
if (!item) {
return;
}
diff --git a/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_unittest.mm
index 5e03bb0..3c2410ff 100644
--- a/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_unittest.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/functional/callback_helpers.h"
-#import "base/mac/foundation_util.h"
#import "base/run_loop.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/scoped_feature_list.h"
@@ -111,7 +111,7 @@
}
void TearDown() override {
- [base::mac::ObjCCast<AccountsTableViewController>(controller())
+ [base::apple::ObjCCast<AccountsTableViewController>(controller())
settingsWillBeDismissed];
ChromeTableViewControllerTest::TearDown();
}
diff --git a/ios/chrome/browser/ui/settings/google_services/google_services_settings_coordinator.mm b/ios/chrome/browser/ui/settings/google_services/google_services_settings_coordinator.mm
index 39576fd..9969acb 100644
--- a/ios/chrome/browser/ui/settings/google_services/google_services_settings_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/google_services/google_services_settings_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/google_services/google_services_settings_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "components/google/core/common/google_util.h"
#import "components/signin/public/identity_manager/identity_manager.h"
#import "components/strings/grit/components_strings.h"
@@ -125,7 +125,7 @@
}
- (GoogleServicesSettingsViewController*)googleServicesSettingsViewController {
- return base::mac::ObjCCast<GoogleServicesSettingsViewController>(
+ return base::apple::ObjCCast<GoogleServicesSettingsViewController>(
self.viewController);
}
diff --git a/ios/chrome/browser/ui/settings/google_services/google_services_settings_mediator.mm b/ios/chrome/browser/ui/settings/google_services/google_services_settings_mediator.mm
index c94858d..d8ce876 100644
--- a/ios/chrome/browser/ui/settings/google_services/google_services_settings_mediator.mm
+++ b/ios/chrome/browser/ui/settings/google_services/google_services_settings_mediator.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/google_services/google_services_settings_mediator.h"
+#import "base/apple/foundation_util.h"
#import "base/auto_reset.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "components/metrics/metrics_pref_names.h"
#import "components/password_manager/core/common/password_manager_features.h"
@@ -233,7 +233,7 @@
switch (type) {
case AllowChromeSigninItemType: {
SyncSwitchItem* signinDisabledItem =
- base::mac::ObjCCast<SyncSwitchItem>(item);
+ base::apple::ObjCCast<SyncSwitchItem>(item);
if (IsSigninControllableByUser(self.userPrefService)) {
signinDisabledItem.on = self.allowChromeSigninPreference.value;
} else {
@@ -243,37 +243,37 @@
break;
}
case ImproveChromeItemType:
- base::mac::ObjCCast<SyncSwitchItem>(item).on =
+ base::apple::ObjCCast<SyncSwitchItem>(item).on =
self.sendDataUsagePreference.value;
break;
case ImproveChromeManagedItemType:
- base::mac::ObjCCast<TableViewInfoButtonItem>(item).statusText =
+ base::apple::ObjCCast<TableViewInfoButtonItem>(item).statusText =
self.sendDataUsagePreference.value
? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
break;
case BetterSearchAndBrowsingItemType:
- base::mac::ObjCCast<SyncSwitchItem>(item).on =
+ base::apple::ObjCCast<SyncSwitchItem>(item).on =
self.anonymizedDataCollectionPreference.value;
break;
case BetterSearchAndBrowsingManagedItemType:
- base::mac::ObjCCast<TableViewInfoButtonItem>(item).statusText =
+ base::apple::ObjCCast<TableViewInfoButtonItem>(item).statusText =
self.anonymizedDataCollectionPreference.value
? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
break;
case ImproveSearchSuggestionsItemType:
- base::mac::ObjCCast<SyncSwitchItem>(item).on =
+ base::apple::ObjCCast<SyncSwitchItem>(item).on =
self.improveSearchSuggestionsPreference.value;
break;
case ImproveSearchSuggestionsManagedItemType:
- base::mac::ObjCCast<TableViewInfoButtonItem>(item).statusText =
+ base::apple::ObjCCast<TableViewInfoButtonItem>(item).statusText =
self.improveSearchSuggestionsPreference.value
? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
break;
case TrackPricesOnTabsItemType:
- base::mac::ObjCCast<SyncSwitchItem>(item).on =
+ base::apple::ObjCCast<SyncSwitchItem>(item).on =
self.trackPricesOnTabsPreference.value;
break;
}
@@ -452,7 +452,7 @@
- (void)toggleSwitchItem:(TableViewItem*)item
withValue:(BOOL)value
targetRect:(CGRect)targetRect {
- SyncSwitchItem* syncSwitchItem = base::mac::ObjCCast<SyncSwitchItem>(item);
+ SyncSwitchItem* syncSwitchItem = base::apple::ObjCCast<SyncSwitchItem>(item);
syncSwitchItem.on = value;
ItemType type = static_cast<ItemType>(item.type);
switch (type) {
diff --git a/ios/chrome/browser/ui/settings/google_services/google_services_settings_view_controller.mm b/ios/chrome/browser/ui/settings/google_services/google_services_settings_view_controller.mm
index 3070083..a02608bc 100644
--- a/ios/chrome/browser/ui/settings/google_services/google_services_settings_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/google_services/google_services_settings_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/google_services/google_services_settings_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "ios/chrome/browser/net/crurl.h"
@@ -49,7 +49,7 @@
if (self.bubbleViewController) {
[self.bubbleViewController dismissViewControllerAnimated:YES
completion:nil];
- UIButton* buttonView = base::mac::ObjCCastStrict<UIButton>(
+ UIButton* buttonView = base::apple::ObjCCastStrict<UIButton>(
self.bubbleViewController.popoverPresentationController.sourceView);
buttonView.enabled = YES;
}
@@ -114,7 +114,7 @@
return cell;
if ([cell isKindOfClass:[TableViewSwitchCell class]]) {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(switchAction:)
forControlEvents:UIControlEventValueChanged];
@@ -122,7 +122,7 @@
switchCell.switchView.tag = item.type;
} else if ([cell isKindOfClass:[TableViewInfoButtonCell class]]) {
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
if ([self.modelDelegate
isAllowChromeSigninItem:[self.tableViewModel
itemAtIndexPath:indexPath]
diff --git a/ios/chrome/browser/ui/settings/google_services/manage_sync_settings_mediator.mm b/ios/chrome/browser/ui/settings/google_services/manage_sync_settings_mediator.mm
index bea8380..5a8ec28b 100644
--- a/ios/chrome/browser/ui/settings/google_services/manage_sync_settings_mediator.mm
+++ b/ios/chrome/browser/ui/settings/google_services/manage_sync_settings_mediator.mm
@@ -4,10 +4,10 @@
#import "ios/chrome/browser/ui/settings/google_services/manage_sync_settings_mediator.h"
+#import "base/apple/foundation_util.h"
#import "base/auto_reset.h"
#import "base/check_op.h"
#import "base/containers/fixed_flat_map.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "components/signin/public/base/consent_level.h"
#import "components/signin/public/base/signin_metrics.h"
@@ -299,7 +299,7 @@
BOOL shouldSyncEverythingItemBeOn =
self.syncSetupService->IsSyncEverythingEnabled();
SyncSwitchItem* syncEverythingItem =
- base::mac::ObjCCastStrict<SyncSwitchItem>(self.syncEverythingItem);
+ base::apple::ObjCCastStrict<SyncSwitchItem>(self.syncEverythingItem);
BOOL needsUpdate =
(syncEverythingItem.on != shouldSyncEverythingItemBeOn) ||
(syncEverythingItem.enabled != shouldSyncEverythingBeEditable);
@@ -323,7 +323,7 @@
indexPathForItemType:IdentityAccountItemType
sectionIdentifier:AccountSectionIdentifier];
TableViewCentralAccountItem* identityAccountItem =
- base::mac::ObjCCast<TableViewCentralAccountItem>(
+ base::apple::ObjCCast<TableViewCentralAccountItem>(
[self.consumer.tableViewModel itemAtIndexPath:accountCellIndexPath]);
CHECK(identityAccountItem);
CHECK(_signedInIdentity);
@@ -342,7 +342,8 @@
if ([item isKindOfClass:[TableViewInfoButtonItem class]])
continue;
- SyncSwitchItem* syncSwitchItem = base::mac::ObjCCast<SyncSwitchItem>(item);
+ SyncSwitchItem* syncSwitchItem =
+ base::apple::ObjCCast<SyncSwitchItem>(item);
syncer::UserSelectableType dataType =
static_cast<syncer::UserSelectableType>(syncSwitchItem.dataType);
BOOL isDataTypeSynced =
@@ -863,7 +864,8 @@
// Notifications are sent by SyncObserverModelBridge while changing
// settings.
base::AutoReset<BOOL> autoReset(&_ignoreSyncStateChanges, YES);
- SyncSwitchItem* syncSwitchItem = base::mac::ObjCCast<SyncSwitchItem>(item);
+ SyncSwitchItem* syncSwitchItem =
+ base::apple::ObjCCast<SyncSwitchItem>(item);
syncSwitchItem.on = value;
SyncSettingsItemType itemType =
static_cast<SyncSettingsItemType>(item.type);
diff --git a/ios/chrome/browser/ui/settings/google_services/manage_sync_settings_mediator_unittest.mm b/ios/chrome/browser/ui/settings/google_services/manage_sync_settings_mediator_unittest.mm
index c3f97e1..15c302db 100644
--- a/ios/chrome/browser/ui/settings/google_services/manage_sync_settings_mediator_unittest.mm
+++ b/ios/chrome/browser/ui/settings/google_services/manage_sync_settings_mediator_unittest.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/scoped_feature_list.h"
#import "components/signin/public/identity_manager/account_info.h"
@@ -289,7 +289,7 @@
footerForSectionWithIdentifier:SyncSettingsSectionIdentifier::
SignOutSectionIdentifier];
TableViewLinkHeaderFooterItem* footerTextItem =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterItem>(footer);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterItem>(footer);
EXPECT_GT([footerTextItem.text length], 0UL);
}
@@ -343,7 +343,7 @@
SyncErrorsSectionIdentifier];
ASSERT_EQ(1UL, error_items.count);
TableViewDetailIconItem* error_item =
- base::mac::ObjCCastStrict<TableViewDetailIconItem>(error_items[0]);
+ base::apple::ObjCCastStrict<TableViewDetailIconItem>(error_items[0]);
EXPECT_NSEQ(
error_item.detailText,
l10n_util::GetNSString(
@@ -380,7 +380,7 @@
continue;
}
SyncSwitchItem* switch_item =
- base::mac::ObjCCastStrict<SyncSwitchItem>(item);
+ base::apple::ObjCCastStrict<SyncSwitchItem>(item);
if (switch_item.type == PaymentsDataTypeItemType) {
EXPECT_FALSE(switch_item.enabled);
} else {
@@ -430,7 +430,7 @@
EXPECT_EQ(1UL, account_item.count);
TableViewCentralAccountItem* account_details =
- base::mac::ObjCCastStrict<TableViewCentralAccountItem>(account_item[0]);
+ base::apple::ObjCCastStrict<TableViewCentralAccountItem>(account_item[0]);
EXPECT_EQ(account_details.type,
SyncSettingsItemType::IdentityAccountItemType);
@@ -454,21 +454,21 @@
itemsInSectionWithIdentifier:SignOutSectionIdentifier];
EXPECT_EQ(ManageGoogleAccountItemType,
- base::mac::ObjCCastStrict<TableViewItem>(items[0]).type);
+ base::apple::ObjCCastStrict<TableViewItem>(items[0]).type);
EXPECT_EQ(ManageAccountsItemType,
- base::mac::ObjCCastStrict<TableViewItem>(items[1]).type);
+ base::apple::ObjCCastStrict<TableViewItem>(items[1]).type);
EXPECT_EQ(SignOutItemType,
- base::mac::ObjCCastStrict<TableViewItem>(items[2]).type);
+ base::apple::ObjCCastStrict<TableViewItem>(items[2]).type);
EXPECT_NSEQ(l10n_util::GetNSString(
IDS_IOS_GOOGLE_ACCOUNT_SETTINGS_MANAGE_GOOGLE_ACCOUNT_ITEM),
- base::mac::ObjCCastStrict<TableViewTextItem>(items[0]).text);
+ base::apple::ObjCCastStrict<TableViewTextItem>(items[0]).text);
EXPECT_NSEQ(l10n_util::GetNSString(
IDS_IOS_GOOGLE_ACCOUNT_SETTINGS_MANAGE_ACCOUNTS_ITEM),
- base::mac::ObjCCastStrict<TableViewTextItem>(items[1]).text);
+ base::apple::ObjCCastStrict<TableViewTextItem>(items[1]).text);
EXPECT_NSEQ(
l10n_util::GetNSString(IDS_IOS_GOOGLE_ACCOUNT_SETTINGS_SIGN_OUT_ITEM),
- base::mac::ObjCCastStrict<TableViewTextItem>(items[2]).text);
+ base::apple::ObjCCastStrict<TableViewTextItem>(items[2]).text);
}
// Tests that Sync errors display as a text button at the top of the page for a
@@ -493,11 +493,12 @@
EXPECT_EQ(2UL, error_items.count);
EXPECT_NSEQ(
- base::mac::ObjCCastStrict<SettingsImageDetailTextItem>(error_items[0])
+ base::apple::ObjCCastStrict<SettingsImageDetailTextItem>(error_items[0])
.detailText,
l10n_util::GetNSString(
IDS_IOS_ACCOUNT_TABLE_ERROR_ENTER_PASSPHRASE_MESSAGE));
- EXPECT_NSEQ(base::mac::ObjCCastStrict<TableViewTextItem>(error_items[1]).text,
- l10n_util::GetNSString(
- IDS_IOS_ACCOUNT_TABLE_ERROR_ENTER_PASSPHRASE_BUTTON));
+ EXPECT_NSEQ(
+ base::apple::ObjCCastStrict<TableViewTextItem>(error_items[1]).text,
+ l10n_util::GetNSString(
+ IDS_IOS_ACCOUNT_TABLE_ERROR_ENTER_PASSPHRASE_BUTTON));
}
diff --git a/ios/chrome/browser/ui/settings/google_services/manage_sync_settings_table_view_controller.mm b/ios/chrome/browser/ui/settings/google_services/manage_sync_settings_table_view_controller.mm
index 6e67eef..a8d5213 100644
--- a/ios/chrome/browser/ui/settings/google_services/manage_sync_settings_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/google_services/manage_sync_settings_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/google_services/manage_sync_settings_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/net/crurl.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_info_button_cell.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_switch_cell.h"
@@ -65,7 +65,7 @@
TableViewModel* model = self.tableViewModel;
NSIndexPath* indexPath = [model indexPathForItemType:sender.tag];
DCHECK(indexPath);
- SyncSwitchItem* syncSwitchItem = base::mac::ObjCCastStrict<SyncSwitchItem>(
+ SyncSwitchItem* syncSwitchItem = base::apple::ObjCCastStrict<SyncSwitchItem>(
[model itemAtIndexPath:indexPath]);
DCHECK(syncSwitchItem);
[self.serviceDelegate toggleSwitchItem:syncSwitchItem withValue:sender.isOn];
@@ -79,7 +79,7 @@
cellForRowAtIndexPath:indexPath];
if ([cell isKindOfClass:[TableViewSwitchCell class]]) {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(switchAction:)
forControlEvents:UIControlEventValueChanged];
@@ -87,7 +87,7 @@
switchCell.switchView.tag = item.type;
} else if ([cell isKindOfClass:[TableViewInfoButtonCell class]]) {
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
managedCell.textLabel.textColor = [UIColor colorNamed:kTextSecondaryColor];
[managedCell.trailingButton addTarget:self
action:@selector(didTapManagedUIInfoButton:)
@@ -110,7 +110,7 @@
if (sectionIdentifier == SignOutSectionIdentifier) {
TableViewLinkHeaderFooterView* linkView =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
linkView.delegate = self;
}
diff --git a/ios/chrome/browser/ui/settings/import_data_table_view_controller.mm b/ios/chrome/browser/ui/settings/import_data_table_view_controller.mm
index ff27048..887bb4e 100644
--- a/ios/chrome/browser/ui/settings/import_data_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/import_data_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/import_data_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_item.h"
diff --git a/ios/chrome/browser/ui/settings/import_data_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/import_data_table_view_controller_unittest.mm
index b864c43..7be7a3f3 100644
--- a/ios/chrome/browser/ui/settings/import_data_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/import_data_table_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/import_data_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.h"
#import "ios/chrome/browser/shared/ui/table_view/table_view_model.h"
@@ -61,7 +61,8 @@
void SelectRowAtIndex(NSInteger itemIndex) {
ImportDataTableViewController* import_data_controller =
- base::mac::ObjCCastStrict<ImportDataTableViewController>(controller());
+ base::apple::ObjCCastStrict<ImportDataTableViewController>(
+ controller());
NSIndexPath* itemPath = [NSIndexPath indexPathForItem:itemIndex
inSection:1];
[import_data_controller tableView:[import_data_controller tableView]
@@ -107,17 +108,17 @@
CreateController();
ImportDataTableViewController* import_data_controller =
- base::mac::ObjCCastStrict<ImportDataTableViewController>(controller());
+ base::apple::ObjCCastStrict<ImportDataTableViewController>(controller());
NSIndexPath* importIndexPath =
[NSIndexPath indexPathForItem:kImportDataItemIndex inSection:1];
NSIndexPath* keepSeparateIndexPath =
[NSIndexPath indexPathForItem:kKeepDataSeparateItemIndex inSection:1];
SettingsImageDetailTextItem* importItem =
- base::mac::ObjCCastStrict<SettingsImageDetailTextItem>(
+ base::apple::ObjCCastStrict<SettingsImageDetailTextItem>(
[import_data_controller.tableViewModel
itemAtIndexPath:importIndexPath]);
SettingsImageDetailTextItem* keepSeparateItem =
- base::mac::ObjCCastStrict<SettingsImageDetailTextItem>(
+ base::apple::ObjCCastStrict<SettingsImageDetailTextItem>(
[import_data_controller.tableViewModel
itemAtIndexPath:keepSeparateIndexPath]);
EXPECT_EQ(UITableViewCellAccessoryNone, importItem.accessoryType);
diff --git a/ios/chrome/browser/ui/settings/language/add_language_table_view_controller.mm b/ios/chrome/browser/ui/settings/language/add_language_table_view_controller.mm
index 3538d50..ab90610 100644
--- a/ios/chrome/browser/ui/settings/language/add_language_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/language/add_language_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/language/add_language_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/shared/ui/list_model/list_item+Controller.h"
@@ -130,7 +130,7 @@
- (void)tableView:(UITableView*)tableView
didSelectRowAtIndexPath:(NSIndexPath*)indexPath {
- LanguageItem* languageItem = base::mac::ObjCCastStrict<LanguageItem>(
+ LanguageItem* languageItem = base::apple::ObjCCastStrict<LanguageItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
[self.delegate addLanguageTableViewController:self
diff --git a/ios/chrome/browser/ui/settings/language/language_settings_mediator.mm b/ios/chrome/browser/ui/settings/language/language_settings_mediator.mm
index 495f473..f9c4bbb 100644
--- a/ios/chrome/browser/ui/settings/language/language_settings_mediator.mm
+++ b/ios/chrome/browser/ui/settings/language/language_settings_mediator.mm
@@ -6,9 +6,9 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/containers/contains.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/notreached.h"
#import "base/strings/sys_string_conversions.h"
diff --git a/ios/chrome/browser/ui/settings/language/language_settings_table_view_controller.mm b/ios/chrome/browser/ui/settings/language/language_settings_table_view_controller.mm
index 476b9026..0edab4f 100644
--- a/ios/chrome/browser/ui/settings/language/language_settings_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/language/language_settings_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/language/language_settings_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
@@ -230,7 +230,7 @@
return UITableViewCellEditingStyleNone;
// The last Translate-blocked language cannot be deleted.
- LanguageItem* languageItem = base::mac::ObjCCastStrict<LanguageItem>(item);
+ LanguageItem* languageItem = base::apple::ObjCCastStrict<LanguageItem>(item);
return ([languageItem isBlocked] && [self numberOfBlockedLanguages] <= 1)
? UITableViewCellEditingStyleNone
: UITableViewCellEditingStyleDelete;
@@ -256,7 +256,7 @@
(ItemType)[self.tableViewModel itemTypeForIndexPath:indexPath];
switch (itemType) {
case ItemTypeLanguage: {
- LanguageItem* languageItem = base::mac::ObjCCastStrict<LanguageItem>(
+ LanguageItem* languageItem = base::apple::ObjCCastStrict<LanguageItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
languageItem.canOfferTranslate =
[self canOfferTranslateForLanguage:languageItem];
@@ -332,7 +332,7 @@
forRowAtIndexPath:(NSIndexPath*)indexPath {
DCHECK_EQ(editingStyle, UITableViewCellEditingStyleDelete);
- LanguageItem* languageItem = base::mac::ObjCCastStrict<LanguageItem>(
+ LanguageItem* languageItem = base::apple::ObjCCastStrict<LanguageItem>(
[self.tableViewModel itemAtIndexPath:indexPath]);
// Update the model and the table view.
@@ -358,7 +358,7 @@
// Update the model.
TableViewModel* model = self.tableViewModel;
- LanguageItem* languageItem = base::mac::ObjCCastStrict<LanguageItem>(
+ LanguageItem* languageItem = base::apple::ObjCCastStrict<LanguageItem>(
[model itemAtIndexPath:sourceIndexPath]);
[model removeItemWithType:ItemTypeLanguage
fromSectionWithIdentifier:SectionIdentifierLanguages
@@ -384,7 +384,7 @@
switch (itemType) {
case ItemTypeTranslateSwitch: {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(translateSwitchChanged:)
forControlEvents:UIControlEventValueChanged];
@@ -392,7 +392,7 @@
}
case ItemTypeTranslateManaged: {
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[managedCell.trailingButton
addTarget:self
action:@selector(didTapManagedUIInfoButton:)
@@ -564,7 +564,8 @@
NSUInteger idx, BOOL* stop) {
if (item.type != ItemTypeLanguage)
return;
- LanguageItem* languageItem = base::mac::ObjCCastStrict<LanguageItem>(item);
+ LanguageItem* languageItem =
+ base::apple::ObjCCastStrict<LanguageItem>(item);
if ([languageItem isBlocked])
numberOfBlockedLanguages++;
}];
diff --git a/ios/chrome/browser/ui/settings/notifications/notifications_coordinator.mm b/ios/chrome/browser/ui/settings/notifications/notifications_coordinator.mm
index ebff37d..a9a3c54 100644
--- a/ios/chrome/browser/ui/settings/notifications/notifications_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/notifications/notifications_coordinator.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/settings/notifications/notifications_coordinator.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/model/browser/browser.h"
#import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
diff --git a/ios/chrome/browser/ui/settings/notifications/notifications_mediator.mm b/ios/chrome/browser/ui/settings/notifications/notifications_mediator.mm
index 49c64217..9fedf22 100644
--- a/ios/chrome/browser/ui/settings/notifications/notifications_mediator.mm
+++ b/ios/chrome/browser/ui/settings/notifications/notifications_mediator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/notifications/notifications_mediator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/notreached.h"
#import "components/prefs/pref_service.h"
#import "ios/chrome/browser/push_notification/push_notification_client_id.h"
@@ -114,7 +114,7 @@
withClientID:(PushNotificationClientId)clientID {
DCHECK(item);
TableViewDetailIconItem* iconItem =
- base::mac::ObjCCastStrict<TableViewDetailIconItem>(item);
+ base::apple::ObjCCastStrict<TableViewDetailIconItem>(item);
notifications_settings::ClientPermissionState permissionState =
notifications_settings::GetClientPermissionState(clientID, _gaiaID,
_prefService);
diff --git a/ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_coordinator.mm b/ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_coordinator.mm
index 677554e0..8117a38 100644
--- a/ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_coordinator.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_coordinator.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "components/commerce/core/shopping_service.h"
#import "ios/chrome/browser/commerce/shopping_service_factory.h"
#import "ios/chrome/browser/shared/coordinator/alert/alert_coordinator.h"
diff --git a/ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_mediator.mm b/ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_mediator.mm
index d6d7554..e1e22fe1 100644
--- a/ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_mediator.mm
+++ b/ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_mediator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_mediator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/sys_string_conversions.h"
#import "components/commerce/core/pref_names.h"
diff --git a/ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_view_controller.mm b/ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_view_controller.mm
index 8f8c6631a..29445f0 100644
--- a/ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/notifications/tracking_price/tracking_price_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_switch_cell.h"
@@ -103,7 +103,7 @@
cellForRowAtIndexPath:indexPath];
if ([cell isKindOfClass:[TableViewSwitchCell class]]) {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(switchAction:)
forControlEvents:UIControlEventValueChanged];
diff --git a/ios/chrome/browser/ui/settings/password/password_checkup/password_checkup_view_controller.mm b/ios/chrome/browser/ui/settings/password/password_checkup/password_checkup_view_controller.mm
index 03fec33..7100ea86 100644
--- a/ios/chrome/browser/ui/settings/password/password_checkup/password_checkup_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/password/password_checkup/password_checkup_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/password/password_checkup/password_checkup_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/strings/string_number_conversions.h"
#import "components/google/core/common/google_util.h"
@@ -514,7 +514,7 @@
[self.tableViewModel footerForSectionIndex:section]) {
// Attach self as delegate to handle clicks in page footer.
TableViewLinkHeaderFooterView* footerView =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
footerView.delegate = self;
}
diff --git a/ios/chrome/browser/ui/settings/password/password_details/add_password_coordinator.mm b/ios/chrome/browser/ui/settings/password/password_details/add_password_coordinator.mm
index 37d37e3..f85e8cb 100644
--- a/ios/chrome/browser/ui/settings/password/password_details/add_password_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/password/password_details/add_password_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/password/password_details/add_password_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/memory/scoped_refptr.h"
#import "base/metrics/histogram_functions.h"
#import "base/strings/sys_string_conversions.h"
diff --git a/ios/chrome/browser/ui/settings/password/password_details/add_password_view_controller.mm b/ios/chrome/browser/ui/settings/password/password_details/add_password_view_controller.mm
index e30f4e2..2808e7e 100644
--- a/ios/chrome/browser/ui/settings/password/password_details/add_password_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/password/password_details/add_password_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/password/password_details/add_password_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
@@ -381,7 +381,7 @@
if (itemType == ItemTypeNote) {
UITableViewCell* cell = [self.tableView cellForRowAtIndexPath:indexPath];
TableViewMultiLineTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewMultiLineTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewMultiLineTextEditCell>(cell);
[textFieldCell.textView becomeFirstResponder];
return;
}
@@ -456,13 +456,13 @@
switch (itemType) {
case ItemTypeUsername: {
TableViewTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(cell);
textFieldCell.textField.delegate = self;
break;
}
case ItemTypePassword: {
TableViewTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(cell);
textFieldCell.textField.delegate = self;
[textFieldCell.identifyingIconButton
addTarget:self
@@ -472,7 +472,7 @@
}
case ItemTypeWebsite: {
TableViewTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(cell);
textFieldCell.textField.delegate = self;
break;
}
diff --git a/ios/chrome/browser/ui/settings/password/password_details/add_password_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/password/password_details/add_password_view_controller_unittest.mm
index 65de269..81cdb540 100644
--- a/ios/chrome/browser/ui/settings/password/password_details/add_password_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/password/password_details/add_password_view_controller_unittest.mm
@@ -6,8 +6,8 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "base/test/metrics/histogram_tester.h"
@@ -145,7 +145,7 @@
indexOfPassword = [NSIndexPath indexPathForRow:1 inSection:2];
TableViewTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>([controller()
+ base::apple::ObjCCastStrict<TableViewTextEditCell>([controller()
tableView:controller().tableView
cellForRowAtIndexPath:indexOfPassword]);
EXPECT_TRUE(textFieldCell);
diff --git a/ios/chrome/browser/ui/settings/password/password_details/password_details_coordinator.mm b/ios/chrome/browser/ui/settings/password/password_details/password_details_coordinator.mm
index 1d456d1..17b5765 100644
--- a/ios/chrome/browser/ui/settings/password/password_details/password_details_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/password/password_details/password_details_coordinator.mm
@@ -7,7 +7,7 @@
#import <utility>
#import <vector>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/memory/scoped_refptr.h"
#import "base/strings/sys_string_conversions.h"
#import "components/password_manager/core/browser/password_manager_client.h"
diff --git a/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.h b/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.h
index be6150b..ff75b72 100644
--- a/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.h
+++ b/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.h
@@ -7,7 +7,7 @@
#import <Foundation/Foundation.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/memory/scoped_refptr.h"
#import "ios/chrome/browser/ui/settings/password/password_details/password_details.h"
#import "ios/chrome/browser/ui/settings/password/password_details/password_details_table_view_controller_delegate.h"
diff --git a/ios/chrome/browser/ui/settings/password/password_details/password_details_table_view_controller.mm b/ios/chrome/browser/ui/settings/password/password_details/password_details_table_view_controller.mm
index 200197f..27dc2b7 100644
--- a/ios/chrome/browser/ui/settings/password/password_details/password_details_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/password/password_details/password_details_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/password/password_details/password_details_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/strings/sys_string_conversions.h"
@@ -503,7 +503,7 @@
forSection:(NSInteger)section {
if ([view isKindOfClass:[TableViewTextHeaderFooterView class]]) {
TableViewTextHeaderFooterView* footer =
- base::mac::ObjCCastStrict<TableViewTextHeaderFooterView>(view);
+ base::apple::ObjCCastStrict<TableViewTextHeaderFooterView>(view);
NSString* footerText =
self.passwordDetailsInfoItems[section].isNoteFooterShown
? l10n_util::GetNSStringF(
@@ -531,7 +531,7 @@
UITableViewCell* cell =
[self.tableView cellForRowAtIndexPath:indexPath];
TableViewTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(cell);
[textFieldCell.textField becomeFirstResponder];
} else {
[self ensureContextMenuShownForItemType:itemType
@@ -545,7 +545,7 @@
UITableViewCell* cell =
[self.tableView cellForRowAtIndexPath:indexPath];
TableViewTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(cell);
[textFieldCell.textField becomeFirstResponder];
} else {
[self ensureContextMenuShownForItemType:itemType
@@ -574,7 +574,7 @@
case PasswordDetailsItemTypeNote: {
UITableViewCell* cell = [self.tableView cellForRowAtIndexPath:indexPath];
TableViewMultiLineTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewMultiLineTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewMultiLineTextEditCell>(cell);
[textFieldCell.textView becomeFirstResponder];
break;
}
@@ -681,7 +681,7 @@
switch (itemType) {
case PasswordDetailsItemTypeUsername: {
TableViewTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(cell);
textFieldCell.textField.delegate = self;
[textFieldCell.identifyingIconButton
addTarget:self
@@ -692,7 +692,7 @@
}
case PasswordDetailsItemTypePassword: {
TableViewTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>(cell);
+ base::apple::ObjCCastStrict<TableViewTextEditCell>(cell);
textFieldCell.textField.delegate = self;
[textFieldCell.identifyingIconButton
addTarget:self
@@ -849,7 +849,7 @@
UITableViewHeaderFooterView* footer =
[self.tableView footerViewForSection:indexPath.section];
TableViewTextHeaderFooterView* textFooter =
- base::mac::ObjCCastStrict<TableViewTextHeaderFooterView>(footer);
+ base::apple::ObjCCastStrict<TableViewTextHeaderFooterView>(footer);
NSString* footerText =
shouldDisplayNoteFooter
? l10n_util::GetNSStringF(
@@ -1362,9 +1362,10 @@
// success/failure.
- (void)copyPasswordDetails:(id)sender {
[self setOrExtendAuthValidityTimer];
- UIMenuController* menu = base::mac::ObjCCastStrict<UIMenuController>(sender);
+ UIMenuController* menu =
+ base::apple::ObjCCastStrict<UIMenuController>(sender);
PasswordDetailsMenuItem* menuItem =
- base::mac::ObjCCastStrict<PasswordDetailsMenuItem>(
+ base::apple::ObjCCastStrict<PasswordDetailsMenuItem>(
menu.menuItems.firstObject);
NSString* message = nil;
diff --git a/ios/chrome/browser/ui/settings/password/password_details/password_details_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/password/password_details/password_details_table_view_controller_unittest.mm
index b9833e59..df40a6b 100644
--- a/ios/chrome/browser/ui/settings/password/password_details/password_details_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/password/password_details/password_details_table_view_controller_unittest.mm
@@ -6,8 +6,8 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/utf_string_conversions.h"
#import "base/test/metrics/histogram_tester.h"
#import "base/test/scoped_feature_list.h"
@@ -367,7 +367,7 @@
SetPassword(websites);
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[password_details tableView:password_details.tableView
@@ -414,7 +414,7 @@
SetPassword(kExampleCom, kUsername, kPassword, /*note=*/"");
PasswordDetailsTableViewController* passwordDetails =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[passwordDetails editButtonPressed];
EXPECT_TRUE(passwordDetails.tableView.editing);
@@ -437,7 +437,7 @@
SetPassword();
PasswordDetailsTableViewController* passwordDetails =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[passwordDetails editButtonPressed];
EXPECT_TRUE(passwordDetails.tableView.editing);
@@ -461,7 +461,7 @@
SetPassword();
PasswordDetailsTableViewController* passwordDetails =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[passwordDetails editButtonPressed];
EXPECT_TRUE(passwordDetails.tableView.editing);
@@ -487,7 +487,7 @@
SetPassword();
PasswordDetailsTableViewController* passwordDetails =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[passwordDetails editButtonPressed];
EXPECT_TRUE(passwordDetails.tableView.editing);
@@ -606,7 +606,7 @@
SetPassword(kExampleCom, kUsername, kPassword, kNote,
/*is_compromised=*/true);
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
id applicationCommandsMock = OCMProtocolMock(@protocol(ApplicationCommands));
@@ -640,7 +640,7 @@
SetPassword(kExampleCom, kUsername, kPassword, kNote,
/*is_compromised=*/true);
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
EXPECT_FALSE(delegate().dismissWarningCalled);
@@ -665,7 +665,7 @@
/*is_compromised=*/false, /*is_muted=*/true,
DetailsContext::kDismissedWarnings);
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
EXPECT_FALSE(delegate().restoreWarningCalled);
@@ -687,7 +687,7 @@
indexOfPassword = [NSIndexPath indexPathForRow:2 inSection:0];
TableViewTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>([controller()
+ base::apple::ObjCCastStrict<TableViewTextEditCell>([controller()
tableView:controller().tableView
cellForRowAtIndexPath:indexOfPassword]);
EXPECT_TRUE(textFieldCell);
@@ -722,7 +722,7 @@
indexOfPassword = [NSIndexPath indexPathForRow:2 inSection:0];
TableViewTextEditCell* textFieldCell =
- base::mac::ObjCCastStrict<TableViewTextEditCell>([controller()
+ base::apple::ObjCCastStrict<TableViewTextEditCell>([controller()
tableView:controller().tableView
cellForRowAtIndexPath:indexOfPassword]);
EXPECT_TRUE(textFieldCell);
@@ -739,7 +739,7 @@
CheckEditCellText(kMaskedPassword, 0, 2);
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[password_details editButtonPressed];
EXPECT_TRUE(password_details.tableView.editing);
@@ -768,7 +768,7 @@
reauth().expectedResult = ReauthenticationResult::kFailure;
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[password_details editButtonPressed];
EXPECT_FALSE(password_details.tableView.editing);
@@ -781,7 +781,7 @@
EXPECT_FALSE(handler().deletionCalled);
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[password_details editButtonPressed];
[password_details tableView:password_details.tableView
@@ -797,7 +797,7 @@
EXPECT_FALSE(handler().deletionCalled);
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[password_details editButtonPressed];
[password_details tableView:password_details.tableView
@@ -813,7 +813,7 @@
SetPassword();
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[password_details editButtonPressed];
EXPECT_FALSE(handler().editingCalled);
@@ -837,7 +837,7 @@
SetPassword();
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[password_details editButtonPressed];
EXPECT_FALSE(delegate().password);
@@ -911,7 +911,7 @@
reauth().expectedResult = ReauthenticationResult::kFailure;
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[password_details editButtonPressed];
EXPECT_TRUE(password_details.tableView.editing);
@@ -929,7 +929,7 @@
reauth().expectedResult = ReauthenticationResult::kFailure;
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[password_details editButtonPressed];
EXPECT_TRUE(password_details.tableView.editing);
@@ -958,7 +958,7 @@
base::HistogramTester histogram_tester;
SetPassword();
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[password_details tableView:password_details.tableView
@@ -987,7 +987,7 @@
SetPassword();
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
[password_details tableView:password_details.tableView
@@ -1024,7 +1024,7 @@
SetPassword();
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
reauth().expectedResult = ReauthenticationResult::kFailure;
@@ -1051,7 +1051,7 @@
base::HistogramTester histogram_tester;
PasswordDetailsTableViewController* password_details =
- base::mac::ObjCCastStrict<PasswordDetailsTableViewController>(
+ base::apple::ObjCCastStrict<PasswordDetailsTableViewController>(
controller());
// When no menu controller is passed, there's no way of knowing which field
diff --git a/ios/chrome/browser/ui/settings/password/password_issues/password_issues_coordinator.mm b/ios/chrome/browser/ui/settings/password/password_issues/password_issues_coordinator.mm
index 060a9e2..1d4cd52e 100644
--- a/ios/chrome/browser/ui/settings/password/password_issues/password_issues_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/password/password_issues/password_issues_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/password/password_issues/password_issues_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/memory/raw_ptr.h"
#import "base/memory/scoped_refptr.h"
#import "ios/chrome/browser/favicon/favicon_loader.h"
diff --git a/ios/chrome/browser/ui/settings/password/password_issues/password_issues_table_view_controller.mm b/ios/chrome/browser/ui/settings/password/password_issues/password_issues_table_view_controller.mm
index 4c24dc4..6b1d22d 100644
--- a/ios/chrome/browser/ui/settings/password/password_issues/password_issues_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/password/password_issues/password_issues_table_view_controller.mm
@@ -5,7 +5,7 @@
#import "ios/chrome/browser/ui/settings/password/password_issues/password_issues_table_view_controller.h"
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "components/password_manager/core/common/password_manager_features.h"
#import "ios/chrome/browser/passwords/password_checkup_metrics.h"
#import "ios/chrome/browser/passwords/password_checkup_utils.h"
@@ -270,7 +270,7 @@
break;
case ItemTypePassword: {
PasswordIssueContentItem* passwordIssue =
- base::mac::ObjCCastStrict<PasswordIssueContentItem>(
+ base::apple::ObjCCastStrict<PasswordIssueContentItem>(
[model itemAtIndexPath:indexPath]);
[self.presenter presentPasswordIssueDetails:passwordIssue.password];
break;
@@ -299,7 +299,7 @@
switch ([self.tableViewModel itemTypeForIndexPath:indexPath]) {
case ItemTypePassword: {
TableViewURLCell* urlCell =
- base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
urlCell.textLabel.lineBreakMode = NSLineBreakByTruncatingHead;
// Load the favicon from cache.
[self loadFaviconAtIndexPath:indexPath forCell:cell];
@@ -316,7 +316,7 @@
if (section == 0 && [self.tableViewModel headerForSectionIndex:0]) {
// Attach self as delegate to handle clicks in page header.
TableViewLinkHeaderFooterView* headerView =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
headerView.delegate = self;
}
@@ -413,8 +413,10 @@
DCHECK(item);
DCHECK(cell);
- TableViewURLItem* URLItem = base::mac::ObjCCastStrict<TableViewURLItem>(item);
- TableViewURLCell* URLCell = base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ TableViewURLItem* URLItem =
+ base::apple::ObjCCastStrict<TableViewURLItem>(item);
+ TableViewURLCell* URLCell =
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
NSString* itemIdentifier = URLItem.uniqueIdentifier;
[self.imageDataSource
@@ -468,7 +470,7 @@
// item in the given tableView section.
- (CrURL*)changePasswordURLForPasswordInSection:(NSInteger)section {
PasswordIssueContentItem* passwordIssueItem =
- base::mac::ObjCCastStrict<PasswordIssueContentItem>([self.tableViewModel
+ base::apple::ObjCCastStrict<PasswordIssueContentItem>([self.tableViewModel
itemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:section]]);
CHECK(passwordIssueItem.password.changePasswordURL.has_value());
diff --git a/ios/chrome/browser/ui/settings/password/password_issues/password_issues_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/password/password_issues/password_issues_table_view_controller_unittest.mm
index 9cb6ed5..8548b567 100644
--- a/ios/chrome/browser/ui/settings/password/password_issues/password_issues_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/password/password_issues/password_issues_table_view_controller_unittest.mm
@@ -6,7 +6,7 @@
#import <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/utf_string_conversions.h"
#import "base/test/scoped_feature_list.h"
#import "components/password_manager/core/browser/ui/credential_ui_entry.h"
@@ -170,7 +170,7 @@
TableViewModel* model = passwords_controller.tableViewModel;
TableViewLinkHeaderFooterItem* header =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterItem>(
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterItem>(
[model headerForSectionIndex:section]);
EXPECT_NSEQ(header.text, expected_text);
@@ -422,7 +422,7 @@
GetPasswordIssuesController();
TableViewLinkHeaderFooterView* header_view =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterView>(
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterView>(
[passwords_controller tableView:passwords_controller.tableView
viewForHeaderInSection:0]);
diff --git a/ios/chrome/browser/ui/settings/password/password_manager_view_controller.mm b/ios/chrome/browser/ui/settings/password/password_manager_view_controller.mm
index 26366147..88088fd 100644
--- a/ios/chrome/browser/ui/settings/password/password_manager_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/password/password_manager_view_controller.mm
@@ -9,8 +9,8 @@
#import <utility>
#import <vector>
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/user_metrics.h"
#import "base/ranges/algorithm.h"
@@ -564,7 +564,7 @@
NSInteger itemType = [self.tableViewModel itemTypeForIndexPath:indexPath];
if (itemType == ItemTypeSavedPassword) {
password_manager::AffiliatedGroup affiliatedGroup =
- base::mac::ObjCCastStrict<AffiliatedGroupTableViewItem>(
+ base::apple::ObjCCastStrict<AffiliatedGroupTableViewItem>(
[self.tableViewModel itemAtIndexPath:indexPath])
.affiliatedGroup;
[origins addObject:base::SysUTF8ToNSString(
@@ -1483,7 +1483,7 @@
// Remove affiliated group.
if (itemType == ItemTypeSavedPassword) {
password_manager::AffiliatedGroup affiliatedGroup =
- base::mac::ObjCCastStrict<AffiliatedGroupTableViewItem>(item)
+ base::apple::ObjCCastStrict<AffiliatedGroupTableViewItem>(item)
.affiliatedGroup;
// Remove from local cache.
@@ -1497,7 +1497,8 @@
affiliatedGroup.GetCredentials().end());
} else if (itemType == ItemTypeBlocked) {
password_manager::CredentialUIEntry credential =
- base::mac::ObjCCastStrict<BlockedSiteTableViewItem>(item).credential;
+ base::apple::ObjCCastStrict<BlockedSiteTableViewItem>(item)
+ .credential;
auto removeCredential =
[](std::vector<password_manager::CredentialUIEntry>& credentials,
@@ -1872,7 +1873,7 @@
- (void)showDetailedViewPageForItem:(TableViewItem*)item {
[self.handler
- showDetailedViewForAffiliatedGroup:base::mac::ObjCCastStrict<
+ showDetailedViewForAffiliatedGroup:base::apple::ObjCCastStrict<
AffiliatedGroupTableViewItem>(item)
.affiliatedGroup];
}
@@ -1932,7 +1933,7 @@
DCHECK_EQ(SectionIdentifierBlocked,
[model sectionIdentifierForSectionIndex:indexPath.section]);
password_manager::CredentialUIEntry credential =
- base::mac::ObjCCastStrict<BlockedSiteTableViewItem>(
+ base::apple::ObjCCastStrict<BlockedSiteTableViewItem>(
[model itemAtIndexPath:indexPath])
.credential;
[self.handler showDetailedViewForCredential:credential];
@@ -1992,7 +1993,7 @@
// This is the text at the top of the page with a link. Attach as a delegate
// to ensure clicks on the link are handled.
TableViewLinkHeaderFooterView* linkView =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
linkView.delegate = self;
}
@@ -2035,7 +2036,7 @@
switch ([self.tableViewModel itemTypeForIndexPath:indexPath]) {
case ItemTypePasswordCheckStatus: {
SettingsCheckCell* passwordCheckCell =
- base::mac::ObjCCastStrict<SettingsCheckCell>(cell);
+ base::apple::ObjCCastStrict<SettingsCheckCell>(cell);
[passwordCheckCell.infoButton
addTarget:self
action:@selector(didTapPasswordCheckInfoButton:)
@@ -2045,7 +2046,7 @@
case ItemTypeSavedPassword:
case ItemTypeBlocked: {
// Load the favicon from cache.
- [base::mac::ObjCCastStrict<PasswordFormContentCell>(cell)
+ [base::apple::ObjCCastStrict<PasswordFormContentCell>(cell)
loadFavicon:self.imageDataSource];
break;
}
diff --git a/ios/chrome/browser/ui/settings/password/password_manager_view_controller_items.mm b/ios/chrome/browser/ui/settings/password/password_manager_view_controller_items.mm
index 8ffb3c23..da9bdf9 100644
--- a/ios/chrome/browser/ui/settings/password/password_manager_view_controller_items.mm
+++ b/ios/chrome/browser/ui/settings/password/password_manager_view_controller_items.mm
@@ -6,9 +6,9 @@
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/containers/span.h"
-#import "base/mac/foundation_util.h"
#import "base/ranges/algorithm.h"
#import "base/strings/string_number_conversions.h"
#import "base/strings/sys_string_conversions.h"
@@ -219,7 +219,7 @@
[super configureCell:tableCell withStyler:styler];
PasswordFormContentCell* cell =
- base::mac::ObjCCastStrict<PasswordFormContentCell>(tableCell);
+ base::apple::ObjCCastStrict<PasswordFormContentCell>(tableCell);
cell.titleLabel.text = self.title;
// Title might be a URL, use "...oo.bar.com", not "fooooooooo..." if too big.
cell.titleLabel.lineBreakMode = NSLineBreakByTruncatingHead;
@@ -265,7 +265,7 @@
[super configureCell:tableCell withStyler:styler];
PasswordFormContentCell* cell =
- base::mac::ObjCCastStrict<PasswordFormContentCell>(tableCell);
+ base::apple::ObjCCastStrict<PasswordFormContentCell>(tableCell);
cell.titleLabel.text = self.title;
// Title is a URL, use "...oo.bar.com", not "fooooooooo..." if too big.
cell.titleLabel.lineBreakMode = NSLineBreakByTruncatingHead;
diff --git a/ios/chrome/browser/ui/settings/password/password_settings/password_settings_view_controller.mm b/ios/chrome/browser/ui/settings/password/password_settings/password_settings_view_controller.mm
index a35f8e11..e0704e0 100644
--- a/ios/chrome/browser/ui/settings/password/password_settings/password_settings_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/password/password_settings/password_settings_view_controller.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/settings/password/password_settings/password_settings_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/notreached.h"
#import "base/strings/sys_string_conversions.h"
@@ -230,7 +230,7 @@
switch ([self.tableViewModel itemTypeForIndexPath:indexPath]) {
case ItemTypeSavePasswordsSwitch: {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(savePasswordsSwitchChanged:)
forControlEvents:UIControlEventValueChanged];
@@ -238,7 +238,7 @@
}
case ItemTypeAccountStorageSwitch: {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(accountStorageSwitchChanged:)
forControlEvents:UIControlEventValueChanged];
@@ -273,7 +273,7 @@
}
case ItemTypeManagedSavePasswords: {
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[managedCell.trailingButton
addTarget:self
action:@selector(didTapManagedUIInfoButton:)
diff --git a/ios/chrome/browser/ui/settings/password/password_settings_app_interface.mm b/ios/chrome/browser/ui/settings/password/password_settings_app_interface.mm
index 224772f..e661c85 100644
--- a/ios/chrome/browser/ui/settings/password/password_settings_app_interface.mm
+++ b/ios/chrome/browser/ui/settings/password/password_settings_app_interface.mm
@@ -6,7 +6,7 @@
#import <MaterialComponents/MaterialSnackbar.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/stringprintf.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
@@ -157,7 +157,7 @@
+ (MockReauthenticationModule*)mockModule {
DCHECK(_scopedReauthOverride);
- return base::mac::ObjCCastStrict<MockReauthenticationModule>(
+ return base::apple::ObjCCastStrict<MockReauthenticationModule>(
_scopedReauthOverride->module);
}
diff --git a/ios/chrome/browser/ui/settings/password/password_sharing/family_picker_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/password/password_sharing/family_picker_view_controller_unittest.mm
index 8e4b17c..197ae33 100644
--- a/ios/chrome/browser/ui/settings/password/password_sharing/family_picker_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/password/password_sharing/family_picker_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/password/password_sharing/family_picker_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/string_number_conversions.h"
#import "components/password_manager/core/browser/sharing/recipients_fetcher.h"
#import "ios/chrome/browser/shared/ui/symbols/symbols.h"
@@ -166,7 +166,7 @@
DefaultSymbolWithPointSize(kCircleSymbol, kAccessorySymbolSize), 0, 0);
FamilyPickerViewController* family_controller =
- base::mac::ObjCCastStrict<FamilyPickerViewController>(controller());
+ base::apple::ObjCCastStrict<FamilyPickerViewController>(controller());
[family_controller tableView:family_controller.tableView
didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
CheckCellAccessoryViewImage(
@@ -191,7 +191,7 @@
EXPECT_EQ(NumberOfItemsInSection(0), 2);
FamilyPickerViewController* family_controller =
- base::mac::ObjCCastStrict<FamilyPickerViewController>(controller());
+ base::apple::ObjCCastStrict<FamilyPickerViewController>(controller());
EXPECT_FALSE(family_controller.navigationItem.rightBarButtonItem.isEnabled);
NSIndexPath* indexPath1 = [NSIndexPath indexPathForRow:0 inSection:0];
diff --git a/ios/chrome/browser/ui/settings/password/passwords_mediator_unittest.mm b/ios/chrome/browser/ui/settings/password/passwords_mediator_unittest.mm
index 8a1eab1..401a35e 100644
--- a/ios/chrome/browser/ui/settings/password/passwords_mediator_unittest.mm
+++ b/ios/chrome/browser/ui/settings/password/passwords_mediator_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/password/passwords_mediator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/string_piece.h"
#import "base/strings/string_util.h"
#import "base/strings/utf_string_conversions.h"
diff --git a/ios/chrome/browser/ui/settings/privacy/handoff_table_view_controller.mm b/ios/chrome/browser/ui/settings/privacy/handoff_table_view_controller.mm
index 877e074..d3f4a64 100644
--- a/ios/chrome/browser/ui/settings/privacy/handoff_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/privacy/handoff_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/privacy/handoff_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/handoff/pref_names_ios.h"
@@ -108,7 +108,7 @@
if (itemType == ItemTypeSwitch) {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(switchChanged:)
forControlEvents:UIControlEventValueChanged];
diff --git a/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_coordinator.mm b/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_coordinator.mm
index a5de7da..6511e81 100644
--- a/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/model/browser/browser.h"
#import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
#import "ios/chrome/browser/shared/ui/table_view/table_view_utils.h"
diff --git a/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_mediator.mm b/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_mediator.mm
index 5be1bce..0051e6b6 100644
--- a/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_mediator.mm
+++ b/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_mediator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_mediator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/notreached.h"
#import "components/prefs/pref_service.h"
#import "ios/chrome/browser/shared/model/prefs/pref_names.h"
diff --git a/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_view_controller.mm b/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_view_controller.mm
index 778295f..dbe106d 100644
--- a/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "ios/chrome/browser/net/crurl.h"
@@ -85,7 +85,7 @@
- (void)setBrowserLockdownModeEnabled:(BOOL)enabled {
if (!_osLockdownModeEnabled) {
TableViewSwitchItem* lockdownModeSwitchItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(self.lockdownModeItem);
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(self.lockdownModeItem);
lockdownModeSwitchItem.on = enabled;
}
[self reloadCellsForItems];
@@ -179,7 +179,7 @@
switch ([self.tableViewModel itemTypeForIndexPath:indexPath]) {
case ItemTypeLockdownModeSwitch: {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(lockdownModeSwitchChanged:)
forControlEvents:UIControlEventValueChanged];
@@ -188,7 +188,7 @@
}
} else if ([cell isKindOfClass:[TableViewInfoButtonCell class]]) {
TableViewInfoButtonCell* infoCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[infoCell.trailingButton addTarget:self
action:@selector(didTapUIInfoButton:)
forControlEvents:UIControlEventTouchUpInside];
diff --git a/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_view_controller_unittest.mm
index fdc1bbd..8c8098c 100644
--- a/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/privacy/lockdown_mode/lockdown_mode_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_controller_test.h"
#import "ios/chrome/grit/ios_strings.h"
#import "testing/gtest_mac.h"
@@ -54,7 +54,8 @@
TEST_F(LockdownModeViewControllerTest, TestCheckmark) {
ChromeTableViewController* chrome_controller = controller();
LockdownModeViewController* controller =
- base::mac::ObjCCastStrict<LockdownModeViewController>(chrome_controller);
+ base::apple::ObjCCastStrict<LockdownModeViewController>(
+ chrome_controller);
[controller setBrowserLockdownModeEnabled:YES];
CheckSwitchCellStateAndTextWithId(YES, IDS_IOS_LOCKDOWN_MODE_TITLE, 0, 0);
diff --git a/ios/chrome/browser/ui/settings/privacy/privacy_coordinator.mm b/ios/chrome/browser/ui/settings/privacy/privacy_coordinator.mm
index edd58d3..8bc3519 100644
--- a/ios/chrome/browser/ui/settings/privacy/privacy_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/privacy/privacy_coordinator.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/privacy/privacy_coordinator.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/model/browser/browser.h"
#import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
#import "ios/chrome/browser/shared/public/commands/browser_commands.h"
diff --git a/ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_coordinator.mm b/ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_coordinator.mm
index 91cc5ecba..8f21a4fb 100644
--- a/ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/safe_browsing/core/common/safe_browsing_settings_metrics.h"
diff --git a/ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_mediator.mm b/ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_mediator.mm
index fac07fc..45872d0 100644
--- a/ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_mediator.mm
+++ b/ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_mediator.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_mediator.h"
+#import "base/apple/foundation_util.h"
#import "base/auto_reset.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/notreached.h"
@@ -274,7 +274,7 @@
- (void)updatePrivacySafeBrowsingSectionAndNotifyConsumer:(BOOL)notifyConsumer {
for (TableViewItem* item in self.safeBrowsingItems) {
TableViewInfoButtonItem* infoButtonItem =
- base::mac::ObjCCast<TableViewInfoButtonItem>(item);
+ base::apple::ObjCCast<TableViewInfoButtonItem>(item);
ItemType type = static_cast<ItemType>(item.type);
infoButtonItem.iconTintColor = [self shouldItemTypeHaveCheckmark:type]
? [UIColor colorNamed:kBlueColor]
diff --git a/ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_view_controller.mm b/ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_view_controller.mm
index 9934717..eb6afae 100644
--- a/ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/privacy/privacy_safe_browsing_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "ios/chrome/browser/net/crurl.h"
@@ -161,7 +161,7 @@
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
TableViewInfoButtonCell* infoCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[infoCell.trailingButton addTarget:self
action:@selector(didTapUIInfoButton:)
forControlEvents:UIControlEventTouchUpInside];
diff --git a/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.mm b/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.mm
index d92b5fc4..ecff62f 100644
--- a/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller.mm
@@ -6,8 +6,8 @@
#import <LocalAuthentication/LocalAuthentication.h>
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
@@ -474,7 +474,7 @@
UIView* footerView = [super tableView:tableView
viewForFooterInSection:section];
TableViewLinkHeaderFooterView* footer =
- base::mac::ObjCCast<TableViewLinkHeaderFooterView>(footerView);
+ base::apple::ObjCCast<TableViewLinkHeaderFooterView>(footerView);
if (footer) {
footer.delegate = self;
}
@@ -518,33 +518,33 @@
if (itemType == ItemTypeIncognitoReauth) {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(switchTapped:)
forControlEvents:UIControlEventTouchUpInside];
} else if (itemType == ItemTypeIncognitoReauthDisabled) {
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[managedCell.trailingButton
addTarget:self
action:@selector(didTapIncognitoReauthDisabledInfoButton:)
forControlEvents:UIControlEventTouchUpInside];
} else if (itemType == ItemTypeHTTPSOnlyMode) {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(HTTPSOnlyModeTapped:)
forControlEvents:UIControlEventTouchUpInside];
} else if (itemType == ItemTypeIncognitoInterstitial) {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView
addTarget:self
action:@selector(incognitoInterstitialSwitchTapped:)
forControlEvents:UIControlEventTouchUpInside];
} else if (itemType == ItemTypeIncognitoInterstitialDisabled) {
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[managedCell.trailingButton
addTarget:self
action:@selector
diff --git a/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller_unittest.mm
index aa10308..d62c4b07 100644
--- a/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/privacy/privacy_table_view_controller_unittest.mm
@@ -7,7 +7,7 @@
#import <LocalAuthentication/LAContext.h>
#import <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/memory/ptr_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/scoped_feature_list.h"
@@ -101,7 +101,7 @@
[[NSUserDefaults standardUserDefaults]
removeObjectForKey:kSpdyProxyEnabled];
}
- [base::mac::ObjCCastStrict<PrivacyTableViewController>(controller())
+ [base::apple::ObjCCastStrict<PrivacyTableViewController>(controller())
settingsWillBeDismissed];
ChromeTableViewControllerTest::TearDown();
}
diff --git a/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_enhanced_protection_coordinator.mm b/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_enhanced_protection_coordinator.mm
index 3a2e821..c5e8fa3 100644
--- a/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_enhanced_protection_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_enhanced_protection_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_enhanced_protection_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "components/safe_browsing/core/common/features.h"
#import "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/shared/model/browser/browser.h"
diff --git a/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_enhanced_protection_view_controller.mm b/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_enhanced_protection_view_controller.mm
index 16c3ff1..b374885 100644
--- a/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_enhanced_protection_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_enhanced_protection_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_enhanced_protection_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/safe_browsing/core/common/features.h"
@@ -224,7 +224,7 @@
if (sectionIdentifier == SectionIdentifierThingsToConsider) {
// Might be a different type of footer.
TableViewLinkHeaderFooterView* linkView =
- base::mac::ObjCCast<TableViewLinkHeaderFooterView>(view);
+ base::apple::ObjCCast<TableViewLinkHeaderFooterView>(view);
linkView.delegate = self;
}
return view;
diff --git a/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_coordinator.mm b/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_coordinator.mm
index e11f2eef..04fc3bd 100644
--- a/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/model/browser/browser.h"
#import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
#import "ios/chrome/browser/shared/public/features/features.h"
diff --git a/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_mediator.mm b/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_mediator.mm
index 2166a2b..d45cc3df 100644
--- a/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_mediator.mm
+++ b/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_mediator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_mediator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/notreached.h"
#import "components/password_manager/core/common/password_manager_pref_names.h"
#import "components/prefs/pref_service.h"
@@ -309,14 +309,14 @@
break;
case ItemTypeSafeBrowsingExtendedReporting: {
SyncSwitchItem* syncSwitchItem =
- base::mac::ObjCCastStrict<SyncSwitchItem>(item);
+ base::apple::ObjCCastStrict<SyncSwitchItem>(item);
syncSwitchItem.on =
safe_browsing::IsExtendedReportingEnabled(*self.userPrefService);
syncSwitchItem.enabled = self.inSafeBrowsingStandardProtection;
break;
}
case ItemTypeSafeBrowsingManagedExtendedReporting:
- base::mac::ObjCCastStrict<TableViewInfoButtonItem>(item).statusText =
+ base::apple::ObjCCastStrict<TableViewInfoButtonItem>(item).statusText =
self.safeBrowsingExtendedReportingPreference.value
? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
@@ -342,7 +342,7 @@
// state.
- (void)configureLeakCheckItem:(TableViewItem*)item {
TableViewSwitchItem* leakCheckItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(item);
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(item);
leakCheckItem.enabled = self.inSafeBrowsingStandardProtection;
leakCheckItem.on = [self passwordLeakCheckItemOnState];
if (base::FeatureList::IsEnabled(
@@ -358,7 +358,7 @@
#pragma mark - SafeBrowsingStandardProtectionViewControllerDelegate
- (void)toggleSwitchItem:(TableViewItem*)item withValue:(BOOL)value {
- SyncSwitchItem* syncSwitchItem = base::mac::ObjCCast<SyncSwitchItem>(item);
+ SyncSwitchItem* syncSwitchItem = base::apple::ObjCCast<SyncSwitchItem>(item);
syncSwitchItem.on = value;
ItemType type = static_cast<ItemType>(item.type);
switch (type) {
diff --git a/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_view_controller.mm b/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_view_controller.mm
index eb41054..d0b17b7 100644
--- a/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/privacy/safe_browsing/safe_browsing_standard_protection_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/safe_browsing/core/common/features.h"
@@ -114,7 +114,7 @@
cellForRowAtIndexPath:indexPath];
if ([cell isKindOfClass:[TableViewSwitchCell class]]) {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(switchAction:)
forControlEvents:UIControlEventValueChanged];
@@ -122,7 +122,7 @@
switchCell.switchView.tag = item.type;
} else if ([cell isKindOfClass:[TableViewInfoButtonCell class]]) {
TableViewInfoButtonCell* infoCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[infoCell.trailingButton addTarget:self
action:@selector(didTapManagedUIInfoButton:)
forControlEvents:UIControlEventTouchUpInside];
diff --git a/ios/chrome/browser/ui/settings/safety_check/safety_check_coordinator.mm b/ios/chrome/browser/ui/settings/safety_check/safety_check_coordinator.mm
index f8c65e1..8110205 100644
--- a/ios/chrome/browser/ui/settings/safety_check/safety_check_coordinator.mm
+++ b/ios/chrome/browser/ui/settings/safety_check/safety_check_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/safety_check/safety_check_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/memory/scoped_refptr.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
diff --git a/ios/chrome/browser/ui/settings/safety_check/safety_check_mediator.mm b/ios/chrome/browser/ui/settings/safety_check/safety_check_mediator.mm
index 8e85f31..ebdf12f7 100644
--- a/ios/chrome/browser/ui/settings/safety_check/safety_check_mediator.mm
+++ b/ios/chrome/browser/ui/settings/safety_check/safety_check_mediator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/safety_check/safety_check_mediator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
diff --git a/ios/chrome/browser/ui/settings/search_engine_table_view_controller.mm b/ios/chrome/browser/ui/settings/search_engine_table_view_controller.mm
index 9d65c67..550eedb 100644
--- a/ios/chrome/browser/ui/settings/search_engine_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/search_engine_table_view_controller.mm
@@ -6,7 +6,7 @@
#import <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
@@ -311,7 +311,7 @@
// Do nothing if the tapped engine was already the default.
SearchEngineItem* selectedTextItem =
- base::mac::ObjCCastStrict<SearchEngineItem>(selectedItem);
+ base::apple::ObjCCastStrict<SearchEngineItem>(selectedItem);
if (selectedTextItem.accessoryType == UITableViewCellAccessoryCheckmark) {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
return;
@@ -322,7 +322,7 @@
for (TableViewItem* item in
[model itemsInSectionWithIdentifier:SectionIdentifierFirstList]) {
SearchEngineItem* textItem =
- base::mac::ObjCCastStrict<SearchEngineItem>(item);
+ base::apple::ObjCCastStrict<SearchEngineItem>(item);
if (textItem.accessoryType == UITableViewCellAccessoryCheckmark) {
textItem.accessoryType = UITableViewCellAccessoryNone;
UITableViewCell* cell =
@@ -336,7 +336,7 @@
[model itemsInSectionWithIdentifier:SectionIdentifierSecondList]) {
DCHECK(item.type == ItemTypeCustomEngine);
SearchEngineItem* textItem =
- base::mac::ObjCCastStrict<SearchEngineItem>(item);
+ base::apple::ObjCCastStrict<SearchEngineItem>(item);
if (textItem.accessoryType == UITableViewCellAccessoryCheckmark) {
textItem.accessoryType = UITableViewCellAccessoryNone;
UITableViewCell* cell =
@@ -349,7 +349,7 @@
// Show the checkmark on the new default engine.
SearchEngineItem* newDefaultEngine =
- base::mac::ObjCCastStrict<SearchEngineItem>(
+ base::apple::ObjCCastStrict<SearchEngineItem>(
[model itemAtIndexPath:indexPath]);
newDefaultEngine.accessoryType = UITableViewCellAccessoryCheckmark;
UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];
@@ -392,8 +392,9 @@
DCHECK(item.type == ItemTypePrepopulatedEngine ||
item.type == ItemTypeCustomEngine);
SearchEngineItem* engineItem =
- base::mac::ObjCCastStrict<SearchEngineItem>(item);
- TableViewURLCell* urlCell = base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ base::apple::ObjCCastStrict<SearchEngineItem>(item);
+ TableViewURLCell* urlCell =
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
if (item.type == ItemTypePrepopulatedEngine) {
_faviconLoader->FaviconForPageUrl(
@@ -605,7 +606,7 @@
inSection:firstSection];
TableViewItem* item = [model itemAtIndexPath:indexPath];
SearchEngineItem* engineItem =
- base::mac::ObjCCastStrict<SearchEngineItem>(item);
+ base::apple::ObjCCastStrict<SearchEngineItem>(item);
engineItem.accessoryType = UITableViewCellAccessoryCheckmark;
[strongSelf.tableView
reloadRowsAtIndexPaths:@[ indexPath ]
@@ -651,7 +652,7 @@
for (NSIndexPath* indexPath in indexPaths) {
TableViewItem* item = [self.tableViewModel itemAtIndexPath:indexPath];
SearchEngineItem* engineItem =
- base::mac::ObjCCastStrict<SearchEngineItem>(item);
+ base::apple::ObjCCastStrict<SearchEngineItem>(item);
engineItem.enabled = !editing;
if (!editing && _firstList[indexPath.item] ==
_templateURLService->GetDefaultSearchProvider()) {
diff --git a/ios/chrome/browser/ui/settings/search_engine_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/search_engine_table_view_controller_unittest.mm
index c51c5fc..578d8836 100644
--- a/ios/chrome/browser/ui/settings/search_engine_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/search_engine_table_view_controller_unittest.mm
@@ -6,8 +6,8 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/files/scoped_temp_dir.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "base/test/ios/wait_util.h"
@@ -68,7 +68,7 @@
void TearDown() override {
DefaultSearchManager::SetFallbackSearchEnginesDisabledForTesting(false);
- [base::mac::ObjCCastStrict<SearchEngineTableViewController>(controller())
+ [base::apple::ObjCCastStrict<SearchEngineTableViewController>(controller())
settingsWillBeDismissed];
ChromeTableViewControllerTest::TearDown();
}
@@ -126,7 +126,7 @@
int section,
int row,
bool enabled) {
- SearchEngineItem* item = base::mac::ObjCCastStrict<SearchEngineItem>(
+ SearchEngineItem* item = base::apple::ObjCCastStrict<SearchEngineItem>(
GetTableViewItem(section, row));
EXPECT_NSEQ(expected_text, item.text);
EXPECT_NSEQ(expected_detail_text, item.detailText);
diff --git a/ios/chrome/browser/ui/settings/settings_egtest.mm b/ios/chrome/browser/ui/settings/settings_egtest.mm
index 1ecf890..60f7f63 100644
--- a/ios/chrome/browser/ui/settings/settings_egtest.mm
+++ b/ios/chrome/browser/ui/settings/settings_egtest.mm
@@ -7,7 +7,7 @@
#import <map>
#import <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/stringprintf.h"
#import "base/strings/sys_string_conversions.h"
#import "build/branding_buildflags.h"
diff --git a/ios/chrome/browser/ui/settings/settings_navigation_controller.mm b/ios/chrome/browser/ui/settings/settings_navigation_controller.mm
index 11e914b..ba72704 100644
--- a/ios/chrome/browser/ui/settings/settings_navigation_controller.mm
+++ b/ios/chrome/browser/ui/settings/settings_navigation_controller.mm
@@ -6,8 +6,8 @@
#import <MaterialComponents/MaterialSnackbar.h>
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/autofill/core/browser/personal_data_manager.h"
@@ -1055,7 +1055,7 @@
[self.currentPresentedViewController
performSelector:@selector(reportBackUserAction)];
}
- self.currentPresentedViewController = base::mac::ObjCCast<
+ self.currentPresentedViewController = base::apple::ObjCCast<
UIViewController<UIAdaptivePresentationControllerDelegate>>(
viewController);
}
diff --git a/ios/chrome/browser/ui/settings/settings_root_table_view_controller.mm b/ios/chrome/browser/ui/settings/settings_root_table_view_controller.mm
index 182e56b..e63bd51 100644
--- a/ios/chrome/browser/ui/settings/settings_root_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/settings_root_table_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/settings_root_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/notreached.h"
#import "ios/chrome/browser/net/crurl.h"
#import "ios/chrome/browser/shared/public/commands/application_commands.h"
@@ -261,7 +261,7 @@
return nil;
}
SettingsNavigationController* navigationController =
- base::mac::ObjCCast<SettingsNavigationController>(
+ base::apple::ObjCCast<SettingsNavigationController>(
self.navigationController);
UIBarButtonItem* doneButton = [navigationController doneButton];
if (_shouldDisableDoneButtonOnEdit) {
diff --git a/ios/chrome/browser/ui/settings/settings_table_view_controller.mm b/ios/chrome/browser/ui/settings/settings_table_view_controller.mm
index e380ff39..eb98969 100644
--- a/ios/chrome/browser/ui/settings/settings_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/settings_table_view_controller.mm
@@ -7,8 +7,8 @@
#import <MaterialComponents/MaterialSnackbar.h>
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
@@ -1217,7 +1217,7 @@
if ([cell isKindOfClass:[TableViewDetailIconCell class]]) {
TableViewDetailIconCell* detailCell =
- base::mac::ObjCCastStrict<TableViewDetailIconCell>(cell);
+ base::apple::ObjCCastStrict<TableViewDetailIconCell>(cell);
[detailCell setUserInteractionEnabled:YES];
detailCell.textLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
}
@@ -1225,7 +1225,7 @@
switch (itemType) {
case SettingsItemTypeMemoryDebugging: {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(memorySwitchToggled:)
forControlEvents:UIControlEventValueChanged];
@@ -1233,7 +1233,7 @@
}
case SettingsItemTypeArticlesForYou: {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(articlesForYouSwitchToggled:)
forControlEvents:UIControlEventValueChanged];
@@ -1242,7 +1242,7 @@
case SettingsItemTypeViewSource: {
#if BUILDFLAG(CHROMIUM_BRANDING) && !defined(NDEBUG)
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(viewSourceSwitchToggled:)
forControlEvents:UIControlEventValueChanged];
@@ -1253,7 +1253,7 @@
}
case SettingsItemTypeManagedDefaultSearchEngine: {
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[managedCell.trailingButton
addTarget:self
action:@selector(didTapManagedUIInfoButton:)
@@ -1264,7 +1264,7 @@
// Adds a trailing button with more information when the sign-in policy
// has been enabled by the organization.
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[managedCell.trailingButton
addTarget:self
action:@selector(didTapSigninDisabledInfoButton:)
@@ -1273,7 +1273,7 @@
}
case SettingsItemTypeManagedArticlesForYou: {
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[managedCell.trailingButton
addTarget:self
action:@selector(didTapManagedUIInfoButton:)
@@ -1284,7 +1284,7 @@
if (![self isSyncDisabledByPolicy])
break;
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[managedCell.trailingButton
addTarget:self
action:@selector(didTapSyncDisabledInfoButton:)
@@ -1562,7 +1562,7 @@
sectionIdentifier:SettingsSectionIdentifierDebug];
TableViewSwitchItem* switchItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(
[self.tableViewModel itemAtIndexPath:switchPath]);
BOOL newSwitchValue = sender.isOn;
@@ -1576,7 +1576,7 @@
sectionIdentifier:SettingsSectionIdentifierAdvanced];
TableViewSwitchItem* switchItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(
[self.tableViewModel itemAtIndexPath:switchPath]);
BOOL newSwitchValue = sender.isOn;
@@ -1591,7 +1591,7 @@
sectionIdentifier:SettingsSectionIdentifierDebug];
TableViewSwitchItem* switchItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(
[self.tableViewModel itemAtIndexPath:switchPath]);
BOOL newSwitchValue = sender.isOn;
@@ -1795,7 +1795,7 @@
indexPathForItemType:SettingsItemTypeAccount
sectionIdentifier:SettingsSectionIdentifierAccount];
TableViewAccountItem* identityAccountItem =
- base::mac::ObjCCast<TableViewAccountItem>(
+ base::apple::ObjCCast<TableViewAccountItem>(
[self.tableViewModel itemAtIndexPath:accountCellIndexPath]);
if (identityAccountItem) {
[self updateIdentityAccountItem:identityAccountItem];
@@ -2330,7 +2330,7 @@
sectionIdentifier:SettingsSectionIdentifierSignIn];
DCHECK(signinPromoCellIndexPath.item != NSNotFound);
TableViewSigninPromoItem* signinPromoItem =
- base::mac::ObjCCast<TableViewSigninPromoItem>(
+ base::apple::ObjCCast<TableViewSigninPromoItem>(
[self.tableViewModel itemAtIndexPath:signinPromoCellIndexPath]);
if (signinPromoItem) {
signinPromoItem.configurator = configurator;
diff --git a/ios/chrome/browser/ui/settings/settings_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/settings_table_view_controller_unittest.mm
index 4bc8d49..bc146b5b 100644
--- a/ios/chrome/browser/ui/settings/settings_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/settings_table_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/settings_table_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/scoped_feature_list.h"
#import "base/test/task_environment.h"
@@ -255,7 +255,7 @@
// Verify that the account item does not hold the error when done through the
// sync item.
TableViewAccountItem* identityAccountItem =
- base::mac::ObjCCast<TableViewAccountItem>(account_items[0]);
+ base::apple::ObjCCast<TableViewAccountItem>(account_items[0]);
EXPECT_FALSE(identityAccountItem.shouldDisplayError);
// Check that there is no sign-in promo when there is a sync error.
@@ -419,7 +419,7 @@
// Verify that the account item is in an error state.
TableViewAccountItem* identityAccountItem =
- base::mac::ObjCCast<TableViewAccountItem>(account_items[0]);
+ base::apple::ObjCCast<TableViewAccountItem>(account_items[0]);
EXPECT_TRUE(identityAccountItem.shouldDisplayError);
}
@@ -444,7 +444,7 @@
// Verify that the account item is in an error state.
TableViewAccountItem* identityAccountItem =
- base::mac::ObjCCast<TableViewAccountItem>(account_items[0]);
+ base::apple::ObjCCast<TableViewAccountItem>(account_items[0]);
ASSERT_TRUE(identityAccountItem.shouldDisplayError);
// Resolve the account error.
@@ -459,7 +459,7 @@
SettingsSectionIdentifierAccount];
ASSERT_NE(0U, account_items.count);
identityAccountItem =
- base::mac::ObjCCast<TableViewAccountItem>(account_items[0]);
+ base::apple::ObjCCast<TableViewAccountItem>(account_items[0]);
ASSERT_TRUE(identityAccountItem != nil);
EXPECT_FALSE(identityAccountItem.shouldDisplayError);
}
@@ -488,7 +488,7 @@
// Verify that the account item is not in an error state.
TableViewAccountItem* identityAccountItem =
- base::mac::ObjCCast<TableViewAccountItem>(account_items[0]);
+ base::apple::ObjCCast<TableViewAccountItem>(account_items[0]);
ASSERT_TRUE(identityAccountItem != nil);
EXPECT_FALSE(identityAccountItem.shouldDisplayError);
}
@@ -513,7 +513,7 @@
// Verify that the account item is not in an error state.
TableViewAccountItem* identityAccountItem =
- base::mac::ObjCCast<TableViewAccountItem>(account_items[0]);
+ base::apple::ObjCCast<TableViewAccountItem>(account_items[0]);
ASSERT_TRUE(identityAccountItem != nil);
EXPECT_FALSE(identityAccountItem.shouldDisplayError);
}
diff --git a/ios/chrome/browser/ui/settings/sync/sync_create_passphrase_table_view_controller.mm b/ios/chrome/browser/ui/settings/sync/sync_create_passphrase_table_view_controller.mm
index 7ddbdcc..fbd374e 100644
--- a/ios/chrome/browser/ui/settings/sync/sync_create_passphrase_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/sync/sync_create_passphrase_table_view_controller.mm
@@ -6,8 +6,8 @@
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/strings/grit/components_strings.h"
#import "components/sync/base/features.h"
diff --git a/ios/chrome/browser/ui/settings/sync/sync_encryption_passphrase_table_view_controller.mm b/ios/chrome/browser/ui/settings/sync/sync_encryption_passphrase_table_view_controller.mm
index be14190..8694ba8 100644
--- a/ios/chrome/browser/ui/settings/sync/sync_encryption_passphrase_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/sync/sync_encryption_passphrase_table_view_controller.mm
@@ -6,9 +6,9 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/i18n/time_formatting.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/strings/sys_string_conversions.h"
@@ -285,7 +285,7 @@
if (SectionIdentifierPassphrase ==
[self.tableViewModel sectionIdentifierForSectionIndex:section]) {
TableViewLinkHeaderFooterView* linkView =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterView>(view);
linkView.delegate = self;
}
return view;
@@ -495,7 +495,7 @@
[self forDecryption])) {
_syncObserver.reset();
SettingsNavigationController* settingsNavigationController =
- base::mac::ObjCCast<SettingsNavigationController>(
+ base::apple::ObjCCast<SettingsNavigationController>(
self.navigationController);
// During the sign-in flow it is possible for the Sync state to
// change when the user is in the Advanced Settings (e.g., if the user
@@ -529,7 +529,7 @@
->HasPrimaryIdentity(signin::ConsentLevel::kSignin)) {
return;
}
- [base::mac::ObjCCastStrict<SettingsNavigationController>(
+ [base::apple::ObjCCastStrict<SettingsNavigationController>(
self.navigationController) popViewControllerOrCloseSettingsAnimated:NO];
}
diff --git a/ios/chrome/browser/ui/settings/sync/sync_encryption_table_view_controller.mm b/ios/chrome/browser/ui/settings/sync/sync_encryption_table_view_controller.mm
index a86d532..c271eab 100644
--- a/ios/chrome/browser/ui/settings/sync/sync_encryption_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/sync/sync_encryption_table_view_controller.mm
@@ -6,8 +6,8 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/strings/sys_string_conversions.h"
@@ -163,7 +163,7 @@
[self.tableViewModel sectionIdentifierForSectionIndex:section] &&
[self.tableViewModel footerForSectionIndex:section]) {
TableViewLinkHeaderFooterView* footer =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterView>(footerView);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterView>(footerView);
footer.delegate = self;
}
return footerView;
diff --git a/ios/chrome/browser/ui/settings/sync/sync_encryption_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/sync/sync_encryption_table_view_controller_unittest.mm
index 45d4a7e..68a1327 100644
--- a/ios/chrome/browser/ui/settings/sync/sync_encryption_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/sync/sync_encryption_table_view_controller_unittest.mm
@@ -6,8 +6,8 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/shared/model/browser/test/test_browser.h"
#import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h"
@@ -36,7 +36,7 @@
void TearDown() override {
SyncEncryptionTableViewController* controller_ =
- base::mac::ObjCCastStrict<SyncEncryptionTableViewController>(
+ base::apple::ObjCCastStrict<SyncEncryptionTableViewController>(
controller());
if ([controller_ respondsToSelector:@selector(settingsWillBeDismissed)]) {
[controller_ performSelector:@selector(settingsWillBeDismissed)];
diff --git a/ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.mm b/ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.mm
index 60e20625..0f8ae7c 100644
--- a/ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/net/crurl.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/shared/ui/symbols/chrome_icon.h"
@@ -759,28 +759,28 @@
itemType == ItemTypeTableViewInfoButtonWithDetailText ||
itemType == ItemTypeTableViewInfoButtonWithImage) {
TableViewInfoButtonCell* managedCell =
- base::mac::ObjCCastStrict<TableViewInfoButtonCell>(cell);
+ base::apple::ObjCCastStrict<TableViewInfoButtonCell>(cell);
[managedCell.trailingButton addTarget:self
action:@selector(didTapManagedUIInfoButton:)
forControlEvents:UIControlEventTouchUpInside];
} else if (itemType == ItemTypeCheck6) {
SettingsCheckCell* checkCell =
- base::mac::ObjCCastStrict<SettingsCheckCell>(cell);
+ base::apple::ObjCCastStrict<SettingsCheckCell>(cell);
[checkCell.infoButton addTarget:self
action:@selector(didTapCheckInfoButton:)
forControlEvents:UIControlEventTouchUpInside];
} else if (itemType == ItemTypeSearchHistorySuggestedItem) {
TableViewTabsSearchSuggestedHistoryCell* searchHistoryCell =
- base::mac::ObjCCastStrict<TableViewTabsSearchSuggestedHistoryCell>(
+ base::apple::ObjCCastStrict<TableViewTabsSearchSuggestedHistoryCell>(
cell);
[searchHistoryCell updateHistoryResultsCount:7];
} else if (itemType == ItemTypeURLWithActivityIndicator) {
TableViewURLCell* URLCell =
- base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
[URLCell startAnimatingActivityIndicator];
} else if (itemType == ItemTypeURLWithActivityIndicatorStopped) {
TableViewURLCell* URLCell =
- base::mac::ObjCCastStrict<TableViewURLCell>(cell);
+ base::apple::ObjCCastStrict<TableViewURLCell>(cell);
[URLCell startAnimatingActivityIndicator];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 4 * NSEC_PER_SEC),
dispatch_get_main_queue(), ^{
diff --git a/ios/chrome/browser/ui/settings/tabs/tab_pickup/tab_pickup_settings_table_view_controller.mm b/ios/chrome/browser/ui/settings/tabs/tab_pickup/tab_pickup_settings_table_view_controller.mm
index acfd744..a13ff8dc 100644
--- a/ios/chrome/browser/ui/settings/tabs/tab_pickup/tab_pickup_settings_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/tabs/tab_pickup/tab_pickup_settings_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/tabs/tab_pickup/tab_pickup_settings_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/i18n/message_formatter.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/notreached.h"
@@ -160,7 +160,7 @@
if (itemType == ItemType::kSwitch) {
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(switchChanged:)
forControlEvents:UIControlEventValueChanged];
@@ -175,7 +175,7 @@
UIView* headerView = [super tableView:tableView
viewForHeaderInSection:section];
TableViewLinkHeaderFooterView* header =
- base::mac::ObjCCast<TableViewLinkHeaderFooterView>(headerView);
+ base::apple::ObjCCast<TableViewLinkHeaderFooterView>(headerView);
if (header) {
header.delegate = self;
}
diff --git a/ios/chrome/browser/ui/settings/translate_table_view_controller.mm b/ios/chrome/browser/ui/settings/translate_table_view_controller.mm
index 6a651c15..d28f6ee 100644
--- a/ios/chrome/browser/ui/settings/translate_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/translate_table_view_controller.mm
@@ -10,7 +10,7 @@
#import <MaterialComponents/MaterialSnackbar.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/google/core/common/google_util.h"
@@ -167,7 +167,7 @@
case ItemTypeTranslate: {
cell.selectionStyle = UITableViewCellSelectionStyleNone;
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(translateToggled:)
forControlEvents:UIControlEventValueChanged];
@@ -189,7 +189,7 @@
if (SectionIdentifierTranslate ==
[self.tableViewModel sectionIdentifierForSectionIndex:section]) {
TableViewLinkHeaderFooterView* footer =
- base::mac::ObjCCastStrict<TableViewLinkHeaderFooterView>(footerView);
+ base::apple::ObjCCastStrict<TableViewLinkHeaderFooterView>(footerView);
footer.delegate = self;
}
return footerView;
@@ -237,10 +237,10 @@
sectionIdentifier:SectionIdentifierTranslate];
TableViewSwitchItem* switchItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(
[self.tableViewModel itemAtIndexPath:switchPath]);
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(
[self.tableView cellForRowAtIndexPath:switchPath]);
DCHECK_EQ(switchCell.switchView, sender);
diff --git a/ios/chrome/browser/ui/settings/translate_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/translate_table_view_controller_unittest.mm
index a43db17..419cf09 100644
--- a/ios/chrome/browser/ui/settings/translate_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/translate_table_view_controller_unittest.mm
@@ -6,8 +6,8 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/files/file_path.h"
-#import "base/mac/foundation_util.h"
#import "base/task/single_thread_task_runner.h"
#import "base/test/task_environment.h"
#import "components/language/core/browser/language_prefs.h"
@@ -64,7 +64,7 @@
}
void TearDown() override {
- [base::mac::ObjCCastStrict<TranslateTableViewController>(controller())
+ [base::apple::ObjCCastStrict<TranslateTableViewController>(controller())
settingsWillBeDismissed];
ChromeTableViewControllerTest::TearDown();
}
diff --git a/ios/chrome/browser/ui/settings/voice_search_table_view_controller.mm b/ios/chrome/browser/ui/settings/voice_search_table_view_controller.mm
index f1a36bc..750efb6 100644
--- a/ios/chrome/browser/ui/settings/voice_search_table_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/voice_search_table_view_controller.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/settings/voice_search_table_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/strings/sys_string_conversions.h"
@@ -159,7 +159,7 @@
if (itemType == ItemTypeTTSEnabled) {
// Have the switch send a message on UIControlEventValueChanged.
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(cell);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(cell);
switchCell.selectionStyle = UITableViewCellSelectionStyleNone;
[switchCell.switchView addTarget:self
action:@selector(ttsToggled:)
@@ -206,10 +206,10 @@
sectionIdentifier:SectionIdentifierTTS];
TableViewSwitchItem* switchItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(
[self.tableViewModel itemAtIndexPath:switchPath]);
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(
[self.tableView cellForRowAtIndexPath:switchPath]);
// Update the model and the preference with the current value of the switch.
@@ -264,7 +264,7 @@
: UITableViewCellAccessoryNone;
TableViewDetailTextItem* textItem =
- base::mac::ObjCCastStrict<TableViewDetailTextItem>(
+ base::apple::ObjCCastStrict<TableViewDetailTextItem>(
[languageItems objectAtIndex:ii]);
if (textItem.accessoryType != type) {
textItem.accessoryType = type;
@@ -292,7 +292,7 @@
[self.tableViewModel indexPathForItemType:ItemTypeTTSEnabled
sectionIdentifier:SectionIdentifierTTS];
TableViewSwitchCell* switchCell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(
[self.tableView cellForRowAtIndexPath:switchPath]);
// Some languages do not support TTS. Disable the switch for those
@@ -310,7 +310,7 @@
// Also update the switch item.
TableViewSwitchItem* switchItem =
- base::mac::ObjCCastStrict<TableViewSwitchItem>(
+ base::apple::ObjCCastStrict<TableViewSwitchItem>(
[self.tableViewModel itemAtIndexPath:switchPath]);
switchItem.enabled = enabled;
switchItem.on = on;
diff --git a/ios/chrome/browser/ui/settings/voice_search_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/voice_search_table_view_controller_unittest.mm
index da92982..ebd8bae 100644
--- a/ios/chrome/browser/ui/settings/voice_search_table_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/settings/voice_search_table_view_controller_unittest.mm
@@ -6,8 +6,8 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/files/file_path.h"
-#import "base/mac/foundation_util.h"
#import "base/test/task_environment.h"
#import "components/prefs/pref_member.h"
#import "components/prefs/pref_registry_simple.h"
@@ -50,7 +50,7 @@
}
TableViewSwitchCell* GetSwitchCell() {
- return base::mac::ObjCCastStrict<TableViewSwitchCell>(
+ return base::apple::ObjCCastStrict<TableViewSwitchCell>(
[controller().tableView
cellForRowAtIndexPath:[NSIndexPath indexPathForItem:0
inSection:0]]);
diff --git a/ios/chrome/browser/ui/sharing/activity_services/activity_service_mediator.mm b/ios/chrome/browser/ui/sharing/activity_services/activity_service_mediator.mm
index a08684f4..33b98e1 100644
--- a/ios/chrome/browser/ui/sharing/activity_services/activity_service_mediator.mm
+++ b/ios/chrome/browser/ui/sharing/activity_services/activity_service_mediator.mm
@@ -6,7 +6,7 @@
#import <MobileCoreServices/MobileCoreServices.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "base/strings/string_number_conversions.h"
diff --git a/ios/chrome/browser/ui/sharing/qr_generator/qr_generator_coordinator_unittest.mm b/ios/chrome/browser/ui/sharing/qr_generator/qr_generator_coordinator_unittest.mm
index 3267204..695e55ab 100644
--- a/ios/chrome/browser/ui/sharing/qr_generator/qr_generator_coordinator_unittest.mm
+++ b/ios/chrome/browser/ui/sharing/qr_generator/qr_generator_coordinator_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/sharing/qr_generator/qr_generator_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/task_environment.h"
#import "ios/chrome/browser/shared/coordinator/scene/scene_state.h"
#import "ios/chrome/browser/shared/coordinator/scene/scene_state_browser_agent.h"
@@ -79,7 +79,7 @@
isKindOfClass:[QRGeneratorViewController class]]);
QRGeneratorViewController* viewController =
- base::mac::ObjCCastStrict<QRGeneratorViewController>(
+ base::apple::ObjCCastStrict<QRGeneratorViewController>(
base_view_controller_.presentedViewController);
// Mimick click on done button.
@@ -105,7 +105,7 @@
[coordinator_ start];
QRGeneratorViewController* viewController =
- base::mac::ObjCCastStrict<QRGeneratorViewController>(
+ base::apple::ObjCCastStrict<QRGeneratorViewController>(
base_view_controller_.presentedViewController);
id vcPartialMock = OCMPartialMock(viewController);
@@ -129,7 +129,7 @@
[coordinator_ start];
QRGeneratorViewController* viewController =
- base::mac::ObjCCastStrict<QRGeneratorViewController>(
+ base::apple::ObjCCastStrict<QRGeneratorViewController>(
base_view_controller_.presentedViewController);
__block PopoverLabelViewController* popoverViewController;
@@ -139,7 +139,7 @@
UIViewController* givenVC) {
if ([givenVC isKindOfClass:[PopoverLabelViewController class]]) {
popoverViewController =
- base::mac::ObjCCastStrict<PopoverLabelViewController>(givenVC);
+ base::apple::ObjCCastStrict<PopoverLabelViewController>(givenVC);
return YES;
}
return NO;
diff --git a/ios/chrome/browser/ui/sharing/sharing_coordinator.mm b/ios/chrome/browser/ui/sharing/sharing_coordinator.mm
index ccbc68b..c780157 100644
--- a/ios/chrome/browser/ui/sharing/sharing_coordinator.mm
+++ b/ios/chrome/browser/ui/sharing/sharing_coordinator.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/sharing/sharing_coordinator.h"
+#import "base/apple/foundation_util.h"
#import "base/files/file_util.h"
#import "base/ios/block_types.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/strings/sys_string_conversions.h"
#import "base/task/thread_pool.h"
@@ -69,7 +69,7 @@
NSString* temporary_directory_path = GetTemporaryDocumentDirectory();
base::File::Error error;
if (!CreateDirectoryAndGetError(
- base::mac::NSStringToFilePath(temporary_directory_path), &error)) {
+ base::apple::NSStringToFilePath(temporary_directory_path), &error)) {
DLOG(ERROR) << "Error creating destination dir: " << error;
return NO;
}
diff --git a/ios/chrome/browser/ui/spotlight_debugger/spotlight_debugger_coordinator.mm b/ios/chrome/browser/ui/spotlight_debugger/spotlight_debugger_coordinator.mm
index 3ef0306..eaedfa0 100644
--- a/ios/chrome/browser/ui/spotlight_debugger/spotlight_debugger_coordinator.mm
+++ b/ios/chrome/browser/ui/spotlight_debugger/spotlight_debugger_coordinator.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/spotlight_debugger/spotlight_debugger_coordinator.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/app/spotlight/bookmarks_spotlight_manager.h"
#import "ios/chrome/app/spotlight/reading_list_spotlight_manager.h"
#import "ios/chrome/browser/shared/model/browser/browser.h"
diff --git a/ios/chrome/browser/ui/spotlight_debugger/spotlight_debugger_view_controller.mm b/ios/chrome/browser/ui/spotlight_debugger/spotlight_debugger_view_controller.mm
index 86bdab5..6c613e1 100644
--- a/ios/chrome/browser/ui/spotlight_debugger/spotlight_debugger_view_controller.mm
+++ b/ios/chrome/browser/ui/spotlight_debugger/spotlight_debugger_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/spotlight_debugger/spotlight_debugger_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/notreached.h"
#import "base/time/time.h"
#import "ios/chrome/app/spotlight/bookmarks_spotlight_manager.h"
@@ -261,7 +261,7 @@
+ (NSString*)timeSinceLastReindexAsString {
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
- NSDate* date = base::mac::ObjCCast<NSDate>(
+ NSDate* date = base::apple::ObjCCast<NSDate>(
[userDefaults objectForKey:@(spotlight::kSpotlightLastIndexingDateKey)]);
if (!date) {
return @"Never";
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller.mm
index 586a298b..6dbcaa9 100644
--- a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller.mm
+++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller.mm
@@ -7,11 +7,11 @@
#import <algorithm>
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/debug/dump_without_crashing.h"
#import "base/ios/block_types.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
@@ -439,7 +439,7 @@
// visible when using context menu.
for (UITableViewCell* cell in strongSelf.collectionView
.visibleCells) {
- GridCell* gridCell = base::mac::ObjCCast<GridCell>(cell);
+ GridCell* gridCell = base::apple::ObjCCast<GridCell>(cell);
gridCell.state = mode == TabGridModeSelection
? GridCellStateEditingUnselected
: GridCellStateNotEditing;
@@ -507,7 +507,7 @@
for (NSIndexPath* path in self.collectionView.indexPathsForVisibleItems) {
if (path.section != kOpenTabsSectionIndex)
continue;
- GridCell* cell = base::mac::ObjCCastStrict<GridCell>(
+ GridCell* cell = base::apple::ObjCCastStrict<GridCell>(
[self.collectionView cellForItemAtIndexPath:path]);
UICollectionViewLayoutAttributes* attributes =
[self.collectionView layoutAttributesForItemAtIndexPath:path];
@@ -606,7 +606,7 @@
NSIndexPath* indexPath = [NSIndexPath indexPathForItem:0
inSection:kOpenTabsSectionIndex];
InactiveTabsButtonHeader* header =
- base::mac::ObjCCast<InactiveTabsButtonHeader>([self.collectionView
+ base::apple::ObjCCast<InactiveTabsButtonHeader>([self.collectionView
supplementaryViewForElementKind:UICollectionElementKindSectionHeader
atIndexPath:indexPath]);
header.hidden = NO;
@@ -711,7 +711,7 @@
dequeueReusableCellWithReuseIdentifier:kSuggestedActionsCellIdentifier
forIndexPath:indexPath];
SuggestedActionsGridCell* suggestedActionsCell =
- base::mac::ObjCCastStrict<SuggestedActionsGridCell>(cell);
+ base::apple::ObjCCastStrict<SuggestedActionsGridCell>(cell);
suggestedActionsCell.suggestedActionsView =
self.suggestedActionsViewController.view;
} else {
@@ -731,7 +731,7 @@
cell =
[collectionView dequeueReusableCellWithReuseIdentifier:kCellIdentifier
forIndexPath:indexPath];
- GridCell* gridCell = base::mac::ObjCCastStrict<GridCell>(cell);
+ GridCell* gridCell = base::apple::ObjCCastStrict<GridCell>(cell);
[self configureCell:gridCell withItem:item atIndex:itemIndex];
}
@@ -1129,7 +1129,7 @@
return nil;
}
- GridCell* cell = base::mac::ObjCCastStrict<GridCell>(
+ GridCell* cell = base::apple::ObjCCastStrict<GridCell>(
[self.collectionView cellForItemAtIndexPath:indexPath]);
MenuScenarioHistogram scenario;
@@ -1170,7 +1170,7 @@
//
// See crbug.com//1427278
if ([cell isKindOfClass:[GridCell class]]) {
- GridCell* gridCell = base::mac::ObjCCastStrict<GridCell>(cell);
+ GridCell* gridCell = base::apple::ObjCCastStrict<GridCell>(cell);
BOOL isTabGridInSelectionMode = _mode == TabGridModeSelection;
BOOL isGridCellInSelectionMode = gridCell.state != GridCellStateNotEditing;
@@ -1190,7 +1190,7 @@
// This is important to prevent cells from animating indefinitely. This is
// safe because the animation state of GridCells is set in
// `configureCell:withItem:atIndex:` whenever a cell is used.
- [base::mac::ObjCCastStrict<GridCell>(cell) hideActivityIndicator];
+ [base::apple::ObjCCastStrict<GridCell>(cell) hideActivityIndicator];
}
}
@@ -1302,7 +1302,7 @@
return nil;
}
- GridCell* gridCell = base::mac::ObjCCastStrict<GridCell>(
+ GridCell* gridCell = base::apple::ObjCCastStrict<GridCell>(
[self.collectionView cellForItemAtIndexPath:indexPath]);
return gridCell.dragPreviewParameters;
}
@@ -1374,15 +1374,15 @@
reuseIdentifier:kCellIdentifier];
placeholder.cellUpdateHandler = ^(UICollectionViewCell* placeholderCell) {
GridCell* gridCell =
- base::mac::ObjCCastStrict<GridCell>(placeholderCell);
+ base::apple::ObjCCastStrict<GridCell>(placeholderCell);
gridCell.theme = self.theme;
};
placeholder.previewParametersProvider =
^UIDragPreviewParameters*(UICollectionViewCell* placeholderCell) {
- GridCell* gridCell =
- base::mac::ObjCCastStrict<GridCell>(placeholderCell);
- return gridCell.dragPreviewParameters;
- };
+ GridCell* gridCell =
+ base::apple::ObjCCastStrict<GridCell>(placeholderCell);
+ return gridCell.dragPreviewParameters;
+ };
id<UICollectionViewDropPlaceholderContext> context =
[coordinator dropItem:item.dragItem toPlaceholder:placeholder];
@@ -1630,7 +1630,7 @@
[self indexOfItemWithID:item.identifier] == NSNotFound);
NSUInteger index = [self indexOfItemWithID:itemID];
self.items[index] = item;
- GridCell* cell = base::mac::ObjCCastStrict<GridCell>(
+ GridCell* cell = base::apple::ObjCCastStrict<GridCell>(
[self.collectionView cellForItemAtIndexPath:CreateIndexPath(index)]);
// `cell` may be nil if it is scrolled offscreen.
if (cell) {
@@ -2320,7 +2320,7 @@
NSIndexPath* indexPath = [NSIndexPath indexPathForItem:0
inSection:kOpenTabsSectionIndex];
InactiveTabsButtonHeader* header =
- base::mac::ObjCCast<InactiveTabsButtonHeader>([self.collectionView
+ base::apple::ObjCCast<InactiveTabsButtonHeader>([self.collectionView
supplementaryViewForElementKind:UICollectionElementKindSectionHeader
atIndexPath:indexPath]);
if (!header) {
@@ -2377,7 +2377,7 @@
NSIndexPath* indexPath = [NSIndexPath indexPathForItem:0
inSection:kOpenTabsSectionIndex];
InactiveTabsButtonHeader* header =
- base::mac::ObjCCast<InactiveTabsButtonHeader>([self.collectionView
+ base::apple::ObjCCast<InactiveTabsButtonHeader>([self.collectionView
supplementaryViewForElementKind:UICollectionElementKindSectionHeader
atIndexPath:indexPath]);
// Note: At this point, `header` could be nil if not visible, or if the
@@ -2390,7 +2390,7 @@
NSIndexPath* indexPath = [NSIndexPath indexPathForItem:0
inSection:kOpenTabsSectionIndex];
InactiveTabsPreambleHeader* header =
- base::mac::ObjCCast<InactiveTabsPreambleHeader>([self.collectionView
+ base::apple::ObjCCast<InactiveTabsPreambleHeader>([self.collectionView
supplementaryViewForElementKind:UICollectionElementKindSectionHeader
atIndexPath:indexPath]);
// Note: At this point, `header` could be nil if not visible, or if the
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller_unittest.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller_unittest.mm
index dbe367e..94e38e5 100644
--- a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/numerics/safe_conversions.h"
#import "base/test/ios/wait_util.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller+private.h"
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/pinned_tabs/pinned_tabs_view_controller.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/pinned_tabs/pinned_tabs_view_controller.mm
index d01b8d4..a033dd9 100644
--- a/ios/chrome/browser/ui/tab_switcher/tab_grid/pinned_tabs/pinned_tabs_view_controller.mm
+++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/pinned_tabs/pinned_tabs_view_controller.mm
@@ -4,10 +4,10 @@
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/pinned_tabs/pinned_tabs_view_controller.h"
+#import "base/apple/foundation_util.h"
#import "base/dcheck_is_on.h"
#import "base/ios/block_types.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/notreached.h"
#import "base/numerics/safe_conversions.h"
@@ -214,7 +214,7 @@
NSIndexPath* selectedItemIndexPath =
self.collectionView.indexPathsForSelectedItems.firstObject;
- PinnedCell* selectedCell = base::mac::ObjCCastStrict<PinnedCell>(
+ PinnedCell* selectedCell = base::apple::ObjCCastStrict<PinnedCell>(
[self.collectionView cellForItemAtIndexPath:selectedItemIndexPath]);
if ([selectedCell hasIdentifier:_selectedItemID]) {
@@ -350,7 +350,7 @@
NSUInteger index = [self indexOfItemWithID:itemID];
_items[index] = item;
- PinnedCell* cell = base::mac::ObjCCastStrict<PinnedCell>(
+ PinnedCell* cell = base::apple::ObjCCastStrict<PinnedCell>(
[self.collectionView cellForItemAtIndexPath:CreateIndexPath(index)]);
// `cell` may be nil if it is scrolled offscreen.
if (cell) {
@@ -421,7 +421,7 @@
}
TabSwitcherItem* item = _items[itemIndex];
- PinnedCell* cell = base::mac::ObjCCastStrict<PinnedCell>([collectionView
+ PinnedCell* cell = base::apple::ObjCCastStrict<PinnedCell>([collectionView
dequeueReusableCellWithReuseIdentifier:kPinnedCellIdentifier
forIndexPath:indexPath]);
@@ -449,7 +449,7 @@
- (UIContextMenuConfiguration*)collectionView:(UICollectionView*)collectionView
contextMenuConfigurationForItemAtIndexPath:(NSIndexPath*)indexPath
point:(CGPoint)point {
- PinnedCell* cell = base::mac::ObjCCastStrict<PinnedCell>(
+ PinnedCell* cell = base::apple::ObjCCastStrict<PinnedCell>(
[self.collectionView cellForItemAtIndexPath:indexPath]);
return [self.menuProvider
contextMenuConfigurationForTabCell:cell
@@ -465,7 +465,7 @@
// view. This is important to prevent cells from animating indefinitely.
// This is safe because the animation state of GridCells is set in
// `configureCell:withItem:` whenever a cell is used.
- [base::mac::ObjCCastStrict<PinnedCell>(cell) hideActivityIndicator];
+ [base::apple::ObjCCastStrict<PinnedCell>(cell) hideActivityIndicator];
}
}
@@ -521,7 +521,7 @@
- (UIDragPreviewParameters*)collectionView:(UICollectionView*)collectionView
dragPreviewParametersForItemAtIndexPath:(NSIndexPath*)indexPath {
- PinnedCell* pinedCell = base::mac::ObjCCastStrict<PinnedCell>(
+ PinnedCell* pinedCell = base::apple::ObjCCastStrict<PinnedCell>(
[self.collectionView cellForItemAtIndexPath:indexPath]);
return pinedCell.dragPreviewParameters;
}
@@ -605,10 +605,10 @@
reuseIdentifier:kCellIdentifier];
placeholder.previewParametersProvider =
^UIDragPreviewParameters*(UICollectionViewCell* placeholderCell) {
- PinnedCell* pinnedCell =
- base::mac::ObjCCastStrict<PinnedCell>(placeholderCell);
- return pinnedCell.dragPreviewParameters;
- };
+ PinnedCell* pinnedCell =
+ base::apple::ObjCCastStrict<PinnedCell>(placeholderCell);
+ return pinnedCell.dragPreviewParameters;
+ };
id<UICollectionViewDropPlaceholderContext> context =
[coordinator dropItem:item.dragItem toPlaceholder:placeholder];
@@ -660,7 +660,7 @@
return;
}
- PinnedCell* pinnedCell = base::mac::ObjCCastStrict<PinnedCell>(
+ PinnedCell* pinnedCell = base::apple::ObjCCastStrict<PinnedCell>(
[self.collectionView cellForItemAtIndexPath:CreateIndexPath(itemIndex)]);
CGAffineTransform originalTransform = pinnedCell.transform;
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/suggested_actions/suggested_actions_view_controller.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/suggested_actions/suggested_actions_view_controller.mm
index 4b52bbd..1b2a3097c 100644
--- a/ios/chrome/browser/ui/tab_switcher/tab_grid/suggested_actions/suggested_actions_view_controller.mm
+++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/suggested_actions/suggested_actions_view_controller.mm
@@ -6,8 +6,8 @@
#import <utility>
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/shared/ui/symbols/symbols.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_image_item.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_item.h"
@@ -149,7 +149,7 @@
if (itemType == ItemTypeSuggestedActionSearchHistory &&
self.searchText.length) {
__weak TableViewTabsSearchSuggestedHistoryCell* weakCell =
- base::mac::ObjCCastStrict<TableViewTabsSearchSuggestedHistoryCell>(
+ base::apple::ObjCCastStrict<TableViewTabsSearchSuggestedHistoryCell>(
cell);
NSString* currentSearchText = self.searchText;
weakCell.searchTerm = currentSearchText;
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.mm
index 16f434f..6f7d779aa 100644
--- a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.mm
+++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.mm
@@ -5,7 +5,7 @@
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.h"
#import "base/apple/bundle_locations.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
@@ -374,7 +374,7 @@
// No-op if the BVC isn't being presented.
if (!self.bvcContainer)
return;
- [base::mac::ObjCCast<TabGridViewController>(self.baseViewController)
+ [base::apple::ObjCCast<TabGridViewController>(self.baseViewController)
prepareForAppearance];
}
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator_unittest.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator_unittest.mm
index 452be37..31f87b1 100644
--- a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator_unittest.mm
+++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator_unittest.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "base/test/metrics/histogram_tester.h"
@@ -93,7 +93,7 @@
for (UIScene* scene in UIApplication.sharedApplication.connectedScenes) {
UIWindowScene* windowScene =
- base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ base::apple::ObjCCastStrict<UIWindowScene>(scene);
UIWindow* window = [windowScene.windows firstObject];
if (window) {
scene_state_.window = window;
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_strip/tab_strip_view_controller.mm b/ios/chrome/browser/ui/tab_switcher/tab_strip/tab_strip_view_controller.mm
index e2822d7..c7e8156 100644
--- a/ios/chrome/browser/ui/tab_switcher/tab_strip/tab_strip_view_controller.mm
+++ b/ios/chrome/browser/ui/tab_switcher/tab_strip/tab_strip_view_controller.mm
@@ -5,8 +5,8 @@
#import "ios/chrome/browser/ui/tab_switcher/tab_strip/tab_strip_view_controller.h"
#import "base/allocator/partition_allocator/partition_alloc.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/numerics/safe_conversions.h"
#import "ios/chrome/browser/shared/public/features/features.h"
#import "ios/chrome/browser/shared/ui/symbols/symbols.h"
@@ -149,7 +149,7 @@
itemIndex = self.items.count - 1;
TabSwitcherItem* item = self.items[itemIndex];
- TabStripCell* cell = base::mac::ObjCCastStrict<TabStripCell>([collectionView
+ TabStripCell* cell = base::apple::ObjCCastStrict<TabStripCell>([collectionView
dequeueReusableCellWithReuseIdentifier:kReuseIdentifier
forIndexPath:indexPath]);
diff --git a/ios/chrome/browser/ui/tabs/tab_strip_controller.mm b/ios/chrome/browser/ui/tabs/tab_strip_controller.mm
index d281272..422f5cd 100644
--- a/ios/chrome/browser/ui/tabs/tab_strip_controller.mm
+++ b/ios/chrome/browser/ui/tabs/tab_strip_controller.mm
@@ -9,9 +9,9 @@
#import <vector>
#import "base/apple/bundle_locations.h"
+#import "base/apple/foundation_util.h"
#import "base/i18n/rtl.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
diff --git a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm
index ed91dfc..0031ffcae 100644
--- a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm
+++ b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/bookmarks/local_or_syncable_bookmark_model_factory.h"
#import "ios/chrome/browser/feature_engagement/tracker_factory.h"
#import "ios/chrome/browser/ntp/new_tab_page_util.h"
diff --git a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_mediator_unittest.mm b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_mediator_unittest.mm
index b27fdf2..dea70f8 100644
--- a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_mediator_unittest.mm
+++ b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_mediator_unittest.mm
@@ -6,8 +6,8 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/files/scoped_temp_dir.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "components/open_from_clipboard/clipboard_recent_content.h"
diff --git a/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.mm b/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.mm
index 47a4b1b..c8c16a0c 100644
--- a/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.mm
+++ b/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/user_metrics.h"
#import "base/metrics/user_metrics_action.h"
#import "components/feature_engagement/public/event_constants.h"
@@ -71,7 +71,7 @@
}
- (void)newTabAction:(id)sender {
- UIView* senderView = base::mac::ObjCCastStrict<UIView>(sender);
+ UIView* senderView = base::apple::ObjCCastStrict<UIView>(sender);
CGPoint center = [senderView.superview convertPoint:senderView.center
toView:nil];
OpenNewTabCommand* command =
diff --git a/ios/chrome/browser/ui/toolbar/primary_toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/primary_toolbar_coordinator.mm
index 22a7bec..3ba8dc90 100644
--- a/ios/chrome/browser/ui/toolbar/primary_toolbar_coordinator.mm
+++ b/ios/chrome/browser/ui/toolbar/primary_toolbar_coordinator.mm
@@ -8,7 +8,7 @@
#import <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/coordinator/layout_guide/layout_guide_util.h"
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/toolbar_coordinator.mm
index 578f1c3..b736da01 100644
--- a/ios/chrome/browser/ui/toolbar/toolbar_coordinator.mm
+++ b/ios/chrome/browser/ui/toolbar/toolbar_coordinator.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/toolbar/toolbar_coordinator.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "components/prefs/pref_service.h"
#import "ios/chrome/browser/ntp/new_tab_page_tab_helper.h"
#import "ios/chrome/browser/ntp/new_tab_page_util.h"
diff --git a/ios/chrome/browser/ui/voice/text_to_speech_notification_handler.mm b/ios/chrome/browser/ui/voice/text_to_speech_notification_handler.mm
index 2265b5f..14bb00a 100644
--- a/ios/chrome/browser/ui/voice/text_to_speech_notification_handler.mm
+++ b/ios/chrome/browser/ui/voice/text_to_speech_notification_handler.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/voice/text_to_speech_notification_handler.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/ui/voice/text_to_speech_player.h"
#import "ios/chrome/browser/ui/voice/voice_search_notification_names.h"
@@ -52,7 +52,7 @@
// Starts the TTS player sending `notification`.
- (void)audioReadyForPlayback:(NSNotification*)notification {
self.TTSPlayer =
- base::mac::ObjCCastStrict<TextToSpeechPlayer>(notification.object);
+ base::apple::ObjCCastStrict<TextToSpeechPlayer>(notification.object);
[self.TTSPlayer beginPlayback];
}
diff --git a/ios/chrome/browser/ui/voice/text_to_speech_player_unittest.mm b/ios/chrome/browser/ui/voice/text_to_speech_player_unittest.mm
index 609931b..0669ff9 100644
--- a/ios/chrome/browser/ui/voice/text_to_speech_player_unittest.mm
+++ b/ios/chrome/browser/ui/voice/text_to_speech_player_unittest.mm
@@ -7,7 +7,7 @@
#import <UIKit/UIKit.h>
#import "base/apple/bundle_locations.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/ios/wait_util.h"
#import "base/time/time.h"
#import "ios/chrome/browser/ui/voice/voice_search_notification_names.h"
diff --git a/ios/chrome/browser/ui/webui/userdefaults_internals_ui.mm b/ios/chrome/browser/ui/webui/userdefaults_internals_ui.mm
index cdabf8b..ba5a994 100644
--- a/ios/chrome/browser/ui/webui/userdefaults_internals_ui.mm
+++ b/ios/chrome/browser/ui/webui/userdefaults_internals_ui.mm
@@ -6,7 +6,7 @@
#import <Foundation/Foundation.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/memory/ref_counted_memory.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
@@ -70,9 +70,10 @@
} else if ([value isKindOfClass:[NSData class]]) {
valueString = [value description];
} else if ([value isKindOfClass:[NSString class]]) {
- valueString = base::mac::ObjCCastStrict<NSString>(value);
+ valueString = base::apple::ObjCCastStrict<NSString>(value);
} else if ([value isKindOfClass:[NSNumber class]]) {
- valueString = [base::mac::ObjCCastStrict<NSNumber>(value) stringValue];
+ valueString =
+ [base::apple::ObjCCastStrict<NSNumber>(value) stringValue];
} else if ([value isKindOfClass:[NSDate class]]) {
valueString = [value description];
}
diff --git a/ios/chrome/browser/ui/webui/web_ui_egtest.mm b/ios/chrome/browser/ui/webui/web_ui_egtest.mm
index 10d3d044..f82292b 100644
--- a/ios/chrome/browser/ui/webui/web_ui_egtest.mm
+++ b/ios/chrome/browser/ui/webui/web_ui_egtest.mm
@@ -4,7 +4,7 @@
#import <XCTest/XCTest.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/metrics/field_trial.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
diff --git a/ios/chrome/browser/ui/whats_new/cells/whats_new_table_view_item_unittest.mm b/ios/chrome/browser/ui/whats_new/cells/whats_new_table_view_item_unittest.mm
index ab3f858..c346984 100644
--- a/ios/chrome/browser/ui/whats_new/cells/whats_new_table_view_item_unittest.mm
+++ b/ios/chrome/browser/ui/whats_new/cells/whats_new_table_view_item_unittest.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/whats_new/cells/whats_new_table_view_item.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/symbols/chrome_icon.h"
#import "ios/chrome/browser/shared/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h"
@@ -33,7 +33,7 @@
ASSERT_TRUE([cell isMemberOfClass:[WhatsNewTableViewCell class]]);
WhatsNewTableViewCell* whats_new_cell =
- base::mac::ObjCCastStrict<WhatsNewTableViewCell>(cell);
+ base::apple::ObjCCastStrict<WhatsNewTableViewCell>(cell);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
[item configureCell:cell withStyler:styler];
@@ -61,7 +61,7 @@
// Check that the main background is set properly.
UIImageView* main_background_image_view =
- base::mac::ObjCCastStrict<UIImageView>(
+ base::apple::ObjCCastStrict<UIImageView>(
whats_new_cell.contentView.subviews[0]);
EXPECT_NSEQ([[UIImage imageNamed:@"whats_new_icon_tile"]
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate],
@@ -95,7 +95,7 @@
ASSERT_TRUE([cell isMemberOfClass:[WhatsNewTableViewCell class]]);
WhatsNewTableViewCell* whats_new_cell =
- base::mac::ObjCCastStrict<WhatsNewTableViewCell>(cell);
+ base::apple::ObjCCastStrict<WhatsNewTableViewCell>(cell);
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
[item configureCell:cell withStyler:styler];
@@ -124,7 +124,7 @@
// Check that the main background is set properly.
UIImageView* main_background_image_view =
- base::mac::ObjCCastStrict<UIImageView>(
+ base::apple::ObjCCastStrict<UIImageView>(
whats_new_cell.contentView.subviews[0]);
EXPECT_NSEQ([[UIImage imageNamed:@"whats_new_icon_tile"]
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate],
diff --git a/ios/chrome/browser/ui/whats_new/data_source/whats_new_data_source.mm b/ios/chrome/browser/ui/whats_new/data_source/whats_new_data_source.mm
index 689f538..5bbf15e 100644
--- a/ios/chrome/browser/ui/whats_new/data_source/whats_new_data_source.mm
+++ b/ios/chrome/browser/ui/whats_new/data_source/whats_new_data_source.mm
@@ -5,7 +5,7 @@
#import "ios/chrome/browser/ui/whats_new/data_source/whats_new_data_source.h"
#import "base/apple/bundle_locations.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/string_util.h"
#import "base/strings/sys_string_conversions.h"
@@ -81,7 +81,7 @@
NSMutableArray<NSString*>* localized_instructions =
[[NSMutableArray alloc] init];
for (NSObject* instruction in instructions) {
- NSNumber* instruction_id = base::mac::ObjCCast<NSNumber>(instruction);
+ NSNumber* instruction_id = base::apple::ObjCCast<NSNumber>(instruction);
if (!instruction_id) {
return nil;
}
@@ -115,7 +115,7 @@
}
for (NSObject* entry_key in keys) {
- NSDictionary* entry = base::mac::ObjCCast<NSDictionary>(entry_key);
+ NSDictionary* entry = base::apple::ObjCCast<NSDictionary>(entry_key);
if (!entry) {
continue;
}
@@ -160,7 +160,7 @@
WhatsNewItem* ConstructWhatsNewItem(NSDictionary* entry) {
// Load the entry type.
NSNumber* type_value =
- base::mac::ObjCCast<NSNumber>(entry[kDictionaryTypeKey]);
+ base::apple::ObjCCast<NSNumber>(entry[kDictionaryTypeKey]);
if (!type_value) {
return nil;
}
@@ -174,7 +174,7 @@
whats_new_item.type = type;
// Load the entry title.
- NSNumber* title = base::mac::ObjCCast<NSNumber>(entry[kDictionaryTitleKey]);
+ NSNumber* title = base::apple::ObjCCast<NSNumber>(entry[kDictionaryTitleKey]);
if (!title) {
return nil;
}
@@ -182,7 +182,7 @@
// Load the entry subtitle.
NSNumber* subtitle =
- base::mac::ObjCCast<NSNumber>(entry[kDictionarySubtitleKey]);
+ base::apple::ObjCCast<NSNumber>(entry[kDictionarySubtitleKey]);
if (!subtitle) {
return nil;
}
@@ -232,7 +232,7 @@
// Load the entry primary action title.
NSNumber* primary_action_title =
- base::mac::ObjCCast<NSNumber>(entry[kDictionaryPrimaryActionKey]);
+ base::apple::ObjCCast<NSNumber>(entry[kDictionaryPrimaryActionKey]);
if (!primary_action_title) {
whats_new_item.primaryActionTitle = nil;
} else {
@@ -260,7 +260,7 @@
[NSMutableDictionary dictionaryWithCapacity:screenshot_texts.count];
for (id key in screenshot_texts) {
NSNumber* val =
- base::mac::ObjCCast<NSNumber>([screenshot_texts objectForKey:key]);
+ base::apple::ObjCCast<NSNumber>([screenshot_texts objectForKey:key]);
[screenshot_text_provider setValue:l10n_util::GetNSString([val intValue])
forKey:key];
}
diff --git a/ios/chrome/browser/ui/whats_new/whats_new_coordinator.mm b/ios/chrome/browser/ui/whats_new/whats_new_coordinator.mm
index f88d7ed..f2ff7a1 100644
--- a/ios/chrome/browser/ui/whats_new/whats_new_coordinator.mm
+++ b/ios/chrome/browser/ui/whats_new/whats_new_coordinator.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/whats_new/whats_new_coordinator.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/user_metrics.h"
#import "base/time/time.h"
diff --git a/ios/chrome/browser/ui/whats_new/whats_new_detail_coordinator.mm b/ios/chrome/browser/ui/whats_new/whats_new_detail_coordinator.mm
index fe342bb..b7d4cc3 100644
--- a/ios/chrome/browser/ui/whats_new/whats_new_detail_coordinator.mm
+++ b/ios/chrome/browser/ui/whats_new/whats_new_detail_coordinator.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/whats_new/whats_new_detail_coordinator.h"
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/strings/strcat.h"
#import "base/time/time.h"
diff --git a/ios/chrome/browser/ui/whats_new/whats_new_util.mm b/ios/chrome/browser/ui/whats_new/whats_new_util.mm
index 7006a22..163d48b6 100644
--- a/ios/chrome/browser/ui/whats_new/whats_new_util.mm
+++ b/ios/chrome/browser/ui/whats_new/whats_new_util.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/whats_new/whats_new_util.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/promos_manager/constants.h"
#import "ios/chrome/browser/promos_manager/features.h"
#import "ios/chrome/browser/promos_manager/promos_manager.h"
diff --git a/ios/chrome/browser/upgrade/upgrade_center.mm b/ios/chrome/browser/upgrade/upgrade_center.mm
index 1857c35..23e2e08 100644
--- a/ios/chrome/browser/upgrade/upgrade_center.mm
+++ b/ios/chrome/browser/upgrade/upgrade_center.mm
@@ -9,7 +9,7 @@
#import <utility>
#import "base/apple/bundle_locations.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/scoped_observation.h"
#import "base/strings/sys_string_conversions.h"
#import "base/time/time.h"
@@ -264,7 +264,7 @@
- (BOOL)infoBarShownRecently {
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
- NSDate* lastDisplayDate = base::mac::ObjCCast<NSDate>(
+ NSDate* lastDisplayDate = base::apple::ObjCCast<NSDate>(
[defaults objectForKey:kLastInfobarDisplayTimeKey]);
if (!lastDisplayDate) {
return NO;
diff --git a/ios/chrome/browser/voice/speech_input_locale_config_impl.mm b/ios/chrome/browser/voice/speech_input_locale_config_impl.mm
index 6468d67..aea6575 100644
--- a/ios/chrome/browser/voice/speech_input_locale_config_impl.mm
+++ b/ios/chrome/browser/voice/speech_input_locale_config_impl.mm
@@ -7,9 +7,9 @@
#import <Foundation/Foundation.h>
#import "base/apple/bundle_locations.h"
+#import "base/apple/foundation_util.h"
#import "base/apple/scoped_cftyperef.h"
#import "base/containers/contains.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/string_split.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/voice/speech_input_locale_match.h"
diff --git a/ios/chrome/browser/voice/speech_input_locale_match.mm b/ios/chrome/browser/voice/speech_input_locale_match.mm
index 625469c..2080b26 100644
--- a/ios/chrome/browser/voice/speech_input_locale_match.mm
+++ b/ios/chrome/browser/voice/speech_input_locale_match.mm
@@ -5,7 +5,7 @@
#import "ios/chrome/browser/voice/speech_input_locale_match.h"
#import "base/apple/bundle_locations.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
namespace {
@@ -35,16 +35,16 @@
- (instancetype)initWithDictionary:(NSDictionary*)dict {
NSString* matchedLocale =
- base::mac::ObjCCastStrict<NSString>(dict[kMatchedLocaleKey]);
+ base::apple::ObjCCastStrict<NSString>(dict[kMatchedLocaleKey]);
NSArray* matchingLocales =
- base::mac::ObjCCastStrict<NSArray>(dict[kMatchingLocalesKey]);
+ base::apple::ObjCCastStrict<NSArray>(dict[kMatchingLocalesKey]);
for (id machingLocale : matchingLocales) {
DCHECK([machingLocale isKindOfClass:[NSString class]]);
}
NSArray* machingLanguages =
- base::mac::ObjCCastStrict<NSArray>(dict[kMatchingLanguagesKey]);
+ base::apple::ObjCCastStrict<NSArray>(dict[kMatchingLanguagesKey]);
for (id machingLanguage : machingLanguages) {
DCHECK([machingLanguage isKindOfClass:[NSString class]]);
}
@@ -64,7 +64,7 @@
NSMutableArray<SpeechInputLocaleMatch*>* matches = [NSMutableArray array];
for (id item in [NSArray arrayWithContentsOfFile:path]) {
- NSDictionary* dict = base::mac::ObjCCastStrict<NSDictionary>(item);
+ NSDictionary* dict = base::apple::ObjCCastStrict<NSDictionary>(item);
SpeechInputLocaleMatch* match =
[[SpeechInputLocaleMatch alloc] initWithDictionary:dict];
[matches addObject:match];
diff --git a/ios/chrome/browser/web/blocked_popup_tab_helper.mm b/ios/chrome/browser/web/blocked_popup_tab_helper.mm
index 1923f28..dbcc497 100644
--- a/ios/chrome/browser/web/blocked_popup_tab_helper.mm
+++ b/ios/chrome/browser/web/blocked_popup_tab_helper.mm
@@ -10,8 +10,8 @@
#import <utility>
#import "base/apple/bundle_locations.h"
+#import "base/apple/foundation_util.h"
#import "base/format_macros.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/stringprintf.h"
#import "base/strings/utf_string_conversions.h"
#import "components/content_settings/core/browser/host_content_settings_map.h"
diff --git a/ios/chrome/browser/web/java_script_console/java_script_console_feature.mm b/ios/chrome/browser/web/java_script_console/java_script_console_feature.mm
index 61492d5..2e23280 100644
--- a/ios/chrome/browser/web/java_script_console/java_script_console_feature.mm
+++ b/ios/chrome/browser/web/java_script_console/java_script_console_feature.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/web/java_script_console/java_script_console_feature.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/web/java_script_console/java_script_console_feature_delegate.h"
#import "ios/chrome/browser/web/java_script_console/java_script_console_message.h"
diff --git a/ios/chrome/browser/web/progress_indicator_app_interface.mm b/ios/chrome/browser/web/progress_indicator_app_interface.mm
index b25fc2e..da213b5 100644
--- a/ios/chrome/browser/web/progress_indicator_app_interface.mm
+++ b/ios/chrome/browser/web/progress_indicator_app_interface.mm
@@ -8,14 +8,15 @@
#import <MaterialComponents/MaterialProgressView.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/testing/earl_grey/earl_grey_app.h"
@implementation ProgressIndicatorAppInterface
+ (id<GREYMatcher>)progressViewWithProgress:(CGFloat)progress {
GREYMatchesBlock matches = ^BOOL(UIView* view) {
- MDCProgressView* progressView = base::mac::ObjCCast<MDCProgressView>(view);
+ MDCProgressView* progressView =
+ base::apple::ObjCCast<MDCProgressView>(view);
return progressView && progressView.progress == progress;
};
diff --git a/ios/chrome/browser/web/progress_indicator_egtest.mm b/ios/chrome/browser/web/progress_indicator_egtest.mm
index 420e2993..e71197c 100644
--- a/ios/chrome/browser/web/progress_indicator_egtest.mm
+++ b/ios/chrome/browser/web/progress_indicator_egtest.mm
@@ -4,7 +4,7 @@
#import <memory>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/run_loop.h"
#import "base/strings/stringprintf.h"
#import "base/synchronization/condition_variable.h"
diff --git a/ios/chrome/browser/web/session_state/web_session_state_cache.mm b/ios/chrome/browser/web/session_state/web_session_state_cache.mm
index 5608c1e..42613db2 100644
--- a/ios/chrome/browser/web/session_state/web_session_state_cache.mm
+++ b/ios/chrome/browser/web/session_state/web_session_state_cache.mm
@@ -6,6 +6,7 @@
#import <UIKit/UIKit.h>
+#import "base/apple/foundation_util.h"
#import "base/base_paths.h"
#import "base/containers/contains.h"
#import "base/files/file_enumerator.h"
@@ -13,7 +14,6 @@
#import "base/files/file_util.h"
#import "base/functional/bind.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/observer_list.h"
#import "base/path_service.h"
#import "base/sequence_checker.h"
@@ -71,7 +71,7 @@
NSDataWritingAtomic |
NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication;
- NSString* file_path_string = base::mac::FilePathToNSString(file_path);
+ NSString* file_path_string = base::apple::FilePathToNSString(file_path);
NSError* error = nil;
if (![session_data writeToFile:file_path_string
options:options
@@ -162,7 +162,7 @@
const base::FilePath filePath =
_cacheDirectory.Append(SessionIdentifierForWebState(webState));
NSData* data =
- [NSData dataWithContentsOfFile:base::mac::FilePathToNSString(filePath)];
+ [NSData dataWithContentsOfFile:base::apple::FilePathToNSString(filePath)];
if (!data) {
// Until M-115, the file name was derived from GetStableIdentifier()
@@ -177,7 +177,7 @@
const base::FilePath alternateFilePath = _cacheDirectory.Append(
base::SysNSStringToUTF8(webState->GetStableIdentifier()));
- data = [NSData dataWithContentsOfFile:base::mac::FilePathToNSString(
+ data = [NSData dataWithContentsOfFile:base::apple::FilePathToNSString(
alternateFilePath)];
if (data && _taskRunner) {
_taskRunner->PostTask(FROM_HERE,
diff --git a/ios/chrome/browser/web/session_state/web_session_state_cache_unittest.mm b/ios/chrome/browser/web/session_state/web_session_state_cache_unittest.mm
index 7c03c41..4481578b 100644
--- a/ios/chrome/browser/web/session_state/web_session_state_cache_unittest.mm
+++ b/ios/chrome/browser/web/session_state/web_session_state_cache_unittest.mm
@@ -6,8 +6,8 @@
#import <Foundation/Foundation.h>
+#import "base/apple/foundation_util.h"
#import "base/files/file_util.h"
-#import "base/mac/foundation_util.h"
#import "base/path_service.h"
#import "base/strings/stringprintf.h"
#import "base/strings/sys_string_conversions.h"
@@ -121,7 +121,7 @@
NSError* error = nil;
NSData* data = [NSData dataWithBytes:data_str length:strlen(data_str)];
NSString* legacy_file_path =
- base::mac::FilePathToNSString(session_cache_directory_.Append(
+ base::apple::FilePathToNSString(session_cache_directory_.Append(
base::SysNSStringToUTF8(web_state_->GetStableIdentifier())));
NSDataWritingOptions options =
NSDataWritingAtomic |
diff --git a/ios/chrome/browser/web/session_state/web_session_state_tab_helper.mm b/ios/chrome/browser/web/session_state/web_session_state_tab_helper.mm
index 76e54ec..3b52878 100644
--- a/ios/chrome/browser/web/session_state/web_session_state_tab_helper.mm
+++ b/ios/chrome/browser/web/session_state/web_session_state_tab_helper.mm
@@ -4,10 +4,10 @@
#import "ios/chrome/browser/web/session_state/web_session_state_tab_helper.h"
+#import "base/apple/foundation_util.h"
#import "base/files/file_path.h"
#import "base/files/file_util.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/memory/ptr_util.h"
#import "base/metrics/histogram_macros.h"
#import "base/path_service.h"
diff --git a/ios/chrome/browser/web_state_list/web_state_list_serialization.mm b/ios/chrome/browser/web_state_list/web_state_list_serialization.mm
index 5dffd05..06f3342 100644
--- a/ios/chrome/browser/web_state_list/web_state_list_serialization.mm
+++ b/ios/chrome/browser/web_state_list/web_state_list_serialization.mm
@@ -10,9 +10,9 @@
#import <memory>
#import <unordered_map>
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/functional/callback.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/sessions/session_window_ios.h"
#import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h"
@@ -59,7 +59,7 @@
bool GetPinnedStateForWebState(web::WebState* web_state) {
web::SerializableUserDataManager* user_data_manager =
web::SerializableUserDataManager::FromWebState(web_state);
- NSNumber* pinned_state = base::mac::ObjCCast<NSNumber>(
+ NSNumber* pinned_state = base::apple::ObjCCast<NSNumber>(
user_data_manager->GetValueForSerializationKey(kPinnedStateKey));
return [pinned_state boolValue];
}
@@ -208,10 +208,10 @@
web::SerializableUserDataManager* user_data_manager =
web::SerializableUserDataManager::FromWebState(web_state);
- NSNumber* boxed_opener_index = base::mac::ObjCCast<NSNumber>(
+ NSNumber* boxed_opener_index = base::apple::ObjCCast<NSNumber>(
user_data_manager->GetValueForSerializationKey(kOpenerIndexKey));
- NSNumber* boxed_opener_navigation_index = base::mac::ObjCCast<NSNumber>(
+ NSNumber* boxed_opener_navigation_index = base::apple::ObjCCast<NSNumber>(
user_data_manager->GetValueForSerializationKey(
kOpenerNavigationIndexKey));
@@ -254,7 +254,7 @@
web::SerializableUserDataManager* user_data_manager =
web::SerializableUserDataManager::FromWebState(web_state);
- NSNumber* pinned_state = base::mac::ObjCCast<NSNumber>(
+ NSNumber* pinned_state = base::apple::ObjCCast<NSNumber>(
user_data_manager->GetValueForSerializationKey(kPinnedStateKey));
web_state_list->SetWebStatePinnedAt(index, [pinned_state boolValue]);
}
diff --git a/ios/chrome/browser/window_activities/window_activity_helpers.mm b/ios/chrome/browser/window_activities/window_activity_helpers.mm
index 252aa39..11cc34c 100644
--- a/ios/chrome/browser/window_activities/window_activity_helpers.mm
+++ b/ios/chrome/browser/window_activities/window_activity_helpers.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/browser/window_activities/window_activity_helpers.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/model/url/chrome_url_constants.h"
#import "ios/chrome/browser/url_loading/url_loading_params.h"
@@ -113,16 +113,16 @@
BOOL incognito =
[activity.activityType isEqualToString:kLoadIncognitoURLActivityType];
- NSURL* passed_url = base::mac::ObjCCast<NSURL>(activity.userInfo[kURLKey]);
+ NSURL* passed_url = base::apple::ObjCCast<NSURL>(activity.userInfo[kURLKey]);
NSURL* referer_url =
- base::mac::ObjCCast<NSURL>(activity.userInfo[kReferrerURLKey]);
+ base::apple::ObjCCast<NSURL>(activity.userInfo[kReferrerURLKey]);
GURL url = net::GURLWithNSURL(passed_url);
UrlLoadParams params = UrlLoadParams::InNewTab(url);
params.in_incognito = incognito;
if (referer_url) {
NSNumber* policy_value =
- base::mac::ObjCCast<NSNumber>(activity.userInfo[kReferrerPolicyKey]);
+ base::apple::ObjCCast<NSNumber>(activity.userInfo[kReferrerPolicyKey]);
web::ReferrerPolicy policy =
static_cast<web::ReferrerPolicy>(policy_value.intValue);
params.web_params.referrer =
diff --git a/ios/chrome/common/app_group/app_group_command.mm b/ios/chrome/common/app_group/app_group_command.mm
index 7243ac0c..46f8f78 100644
--- a/ios/chrome/common/app_group/app_group_command.mm
+++ b/ios/chrome/common/app_group/app_group_command.mm
@@ -5,7 +5,7 @@
#import "ios/chrome/common/app_group/app_group_command.h"
#import "base/apple/bundle_locations.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/common/app_group/app_group_constants.h"
@@ -109,7 +109,7 @@
- (void)executeInApp {
NSString* scheme =
- base::mac::ObjCCast<NSString>([base::apple::FrameworkBundle()
+ base::apple::ObjCCast<NSString>([base::apple::FrameworkBundle()
objectForInfoDictionaryKey:@"KSChannelChromeScheme"]);
if (!scheme)
return;
diff --git a/ios/chrome/common/crash_report/crash_helper.mm b/ios/chrome/common/crash_report/crash_helper.mm
index 9f259aa6..9ddcfa2 100644
--- a/ios/chrome/common/crash_report/crash_helper.mm
+++ b/ios/chrome/common/crash_report/crash_helper.mm
@@ -6,8 +6,8 @@
#import <Foundation/Foundation.h>
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/crash/core/app/crashpad.h"
#import "ios/chrome/common/app_group/app_group_constants.h"
@@ -42,10 +42,10 @@
NSArray* cachesDirectories = NSSearchPathForDirectoriesInDomains(
NSCachesDirectory, NSUserDomainMask, YES);
NSString* cachePath = [cachesDirectories objectAtIndex:0];
- return base::mac::NSStringToFilePath(cachePath).Append(
+ return base::apple::NSStringToFilePath(cachePath).Append(
kCrashpadNoAppGroupFolder);
}
- return base::mac::NSStringToFilePath(path);
+ return base::apple::NSStringToFilePath(path);
}
bool StartCrashpad() {
diff --git a/ios/chrome/common/credential_provider/memory_credential_store.mm b/ios/chrome/common/credential_provider/memory_credential_store.mm
index 0cfbb0f..54d2bc0 100644
--- a/ios/chrome/common/credential_provider/memory_credential_store.mm
+++ b/ios/chrome/common/credential_provider/memory_credential_store.mm
@@ -4,8 +4,8 @@
#import "ios/chrome/common/credential_provider/memory_credential_store.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/common/credential_provider/archivable_credential.h"
@@ -59,7 +59,7 @@
<< "credential must have a record identifier";
dispatch_barrier_async(self.workingQueue, ^{
self.memoryStorage[credential.recordIdentifier] =
- base::mac::ObjCCastStrict<ArchivableCredential>(credential);
+ base::apple::ObjCCastStrict<ArchivableCredential>(credential);
});
}
diff --git a/ios/chrome/common/ui/elements/gradient_view.mm b/ios/chrome/common/ui/elements/gradient_view.mm
index f052738..c4dc8690 100644
--- a/ios/chrome/common/ui/elements/gradient_view.mm
+++ b/ios/chrome/common/ui/elements/gradient_view.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/common/ui/elements/gradient_view.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
@interface GradientView ()
@@ -49,7 +49,7 @@
}
- (CAGradientLayer*)gradientLayer {
- return base::mac::ObjCCastStrict<CAGradientLayer>(self.layer);
+ return base::apple::ObjCCastStrict<CAGradientLayer>(self.layer);
}
- (void)traitCollectionDidChange:(UITraitCollection*)previousTraitCollection {
diff --git a/ios/chrome/common/ui/util/ui_util.mm b/ios/chrome/common/ui/util/ui_util.mm
index ddc701d3..d28ee8e2 100644
--- a/ios/chrome/common/ui/util/ui_util.mm
+++ b/ios/chrome/common/ui/util/ui_util.mm
@@ -8,7 +8,7 @@
#import <cmath>
#import <limits>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ui/gfx/ios/uikit_util.h"
CGFloat DeviceCornerRadius() {
@@ -17,7 +17,7 @@
UIWindow* window = nil;
for (UIScene* scene in UIApplication.sharedApplication.connectedScenes) {
UIWindowScene* windowScene =
- base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ base::apple::ObjCCastStrict<UIWindowScene>(scene);
UIWindow* firstWindow = [windowScene.windows firstObject];
if (firstWindow) {
window = firstWindow;
diff --git a/ios/chrome/content_widget_extension/content_widget_view_controller.mm b/ios/chrome/content_widget_extension/content_widget_view_controller.mm
index 0bb201d..16a83d6 100644
--- a/ios/chrome/content_widget_extension/content_widget_view_controller.mm
+++ b/ios/chrome/content_widget_extension/content_widget_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/content_widget_extension/content_widget_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/common/app_group/app_group_command.h"
#import "ios/chrome/common/app_group/app_group_constants.h"
diff --git a/ios/chrome/credential_provider_extension/ui/credential_details_view_controller.mm b/ios/chrome/credential_provider_extension/ui/credential_details_view_controller.mm
index 38f2ff9..ec58d28 100644
--- a/ios/chrome/credential_provider_extension/ui/credential_details_view_controller.mm
+++ b/ios/chrome/credential_provider_extension/ui/credential_details_view_controller.mm
@@ -6,7 +6,7 @@
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/common/app_group/app_group_metrics.h"
#import "ios/chrome/common/constants.h"
#import "ios/chrome/common/credential_provider/credential.h"
diff --git a/ios/chrome/credential_provider_extension/ui/credential_list_view_controller.mm b/ios/chrome/credential_provider_extension/ui/credential_list_view_controller.mm
index b0c8880..f20668e 100644
--- a/ios/chrome/credential_provider_extension/ui/credential_list_view_controller.mm
+++ b/ios/chrome/credential_provider_extension/ui/credential_list_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/credential_provider_extension/ui/credential_list_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/numerics/safe_conversions.h"
#import "ios/chrome/common/app_group/app_group_constants.h"
#import "ios/chrome/common/app_group/app_group_metrics.h"
@@ -210,7 +210,7 @@
}
CredentialListCell* credentialCell =
- base::mac::ObjCCastStrict<CredentialListCell>(cell);
+ base::apple::ObjCCastStrict<CredentialListCell>(cell);
credentialCell.textLabel.text = credential.serviceName;
credentialCell.detailTextLabel.text = credential.user;
@@ -246,7 +246,7 @@
DCHECK(credential);
DCHECK(cell);
CredentialListCell* credentialCell =
- base::mac::ObjCCastStrict<CredentialListCell>(cell);
+ base::apple::ObjCCastStrict<CredentialListCell>(cell);
NSString* serviceIdentifier = credential.serviceIdentifier;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
@@ -375,9 +375,9 @@
// Called when info icon is tapped.
- (void)infoIconButtonTapped:(id)sender event:(id)event {
- CGPoint hitPoint =
- [base::mac::ObjCCastStrict<UIButton>(sender) convertPoint:CGPointZero
- toView:self.tableView];
+ CGPoint hitPoint = [base::apple::ObjCCastStrict<UIButton>(sender)
+ convertPoint:CGPointZero
+ toView:self.tableView];
NSIndexPath* indexPath = [self.tableView indexPathForRowAtPoint:hitPoint];
id<Credential> credential = [self credentialForIndexPath:indexPath];
if (!credential) {
diff --git a/ios/chrome/credential_provider_extension/ui/new_password_view_controller.mm b/ios/chrome/credential_provider_extension/ui/new_password_view_controller.mm
index cda5faea..f77aadf 100644
--- a/ios/chrome/credential_provider_extension/ui/new_password_view_controller.mm
+++ b/ios/chrome/credential_provider_extension/ui/new_password_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/credential_provider_extension/ui/new_password_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/string_number_conversions.h"
#import "base/strings/sys_string_conversions.h"
@@ -224,7 +224,7 @@
if (section == SectionIdentifierNote &&
[view isKindOfClass:[PasswordNoteFooterView class]]) {
PasswordNoteFooterView* footer =
- base::mac::ObjCCastStrict<PasswordNoteFooterView>(view);
+ base::apple::ObjCCastStrict<PasswordNoteFooterView>(view);
footer.textLabel.text = [self noteFooterText];
[tableView beginUpdates];
@@ -319,7 +319,7 @@
UITableViewHeaderFooterView* footerView =
[self.tableView footerViewForSection:SectionIdentifierNote];
PasswordNoteFooterView* noteFooter =
- base::mac::ObjCCastStrict<PasswordNoteFooterView>(footerView);
+ base::apple::ObjCCastStrict<PasswordNoteFooterView>(footerView);
noteFooter.textLabel.text = [self noteFooterText];
// Refresh the cell's height to make the note fully visible while typing or to
diff --git a/ios/chrome/credential_provider_extension/ui/tooltip_view.mm b/ios/chrome/credential_provider_extension/ui/tooltip_view.mm
index 465ed3a..e58cffd 100644
--- a/ios/chrome/credential_provider_extension/ui/tooltip_view.mm
+++ b/ios/chrome/credential_provider_extension/ui/tooltip_view.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/credential_provider_extension/ui/tooltip_view.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
namespace {
@@ -162,7 +162,7 @@
}
- (CAShapeLayer*)backgroundLayer {
- return base::mac::ObjCCastStrict<CAShapeLayer>(self.layer);
+ return base::apple::ObjCCastStrict<CAShapeLayer>(self.layer);
}
@end
diff --git a/ios/chrome/search_widget_extension/search_widget_view_controller.mm b/ios/chrome/search_widget_extension/search_widget_view_controller.mm
index 3f7e878..a3f3a06 100644
--- a/ios/chrome/search_widget_extension/search_widget_view_controller.mm
+++ b/ios/chrome/search_widget_extension/search_widget_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/search_widget_extension/search_widget_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/sys_string_conversions.h"
#import "components/open_from_clipboard/clipboard_recent_content_impl_ios.h"
diff --git a/ios/chrome/share_extension/share_view_controller.mm b/ios/chrome/share_extension/share_view_controller.mm
index 4d1a475..e984d75 100644
--- a/ios/chrome/share_extension/share_view_controller.mm
+++ b/ios/chrome/share_extension/share_view_controller.mm
@@ -7,8 +7,8 @@
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
#import "base/apple/bundle_locations.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/block_types.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/common/app_group/app_group_command.h"
#import "ios/chrome/common/app_group/app_group_constants.h"
@@ -224,7 +224,7 @@
if ([itemProvider hasItemConformingToTypeIdentifier:typeURL]) {
foundMatch = true;
ItemBlock URLCompletion = ^(id idURL, NSError* error) {
- NSURL* URL = base::mac::ObjCCast<NSURL>(idURL);
+ NSURL* URL = base::apple::ObjCCast<NSURL>(idURL);
if (!URL) {
[self displayErrorView];
return;
@@ -252,7 +252,7 @@
valueWithCGSize:CGSizeMake(kScreenShotWidth, kScreenShotHeight)]
};
ItemBlock imageCompletion = ^(id imageData, NSError* error) {
- self->_image = base::mac::ObjCCast<UIImage>(imageData);
+ self->_image = base::apple::ObjCCast<UIImage>(imageData);
if (self->_image && self.shareView) {
dispatch_async(dispatch_get_main_queue(), ^{
[self.shareView setScreenshot:self->_image];
diff --git a/ios/chrome/test/app/chrome_test_util.mm b/ios/chrome/test/app/chrome_test_util.mm
index 3b6b004..9da5777 100644
--- a/ios/chrome/test/app/chrome_test_util.mm
+++ b/ios/chrome/test/app/chrome_test_util.mm
@@ -4,9 +4,9 @@
#import "ios/chrome/test/app/chrome_test_util.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/test/ios/wait_util.h"
#import "components/crash/core/common/reporter_running_ios.h"
#import "components/metrics/metrics_pref_names.h"
@@ -124,7 +124,7 @@
if ([active_view_controller
isKindOfClass:[BVCContainerViewController class]]) {
active_view_controller =
- base::mac::ObjCCastStrict<BVCContainerViewController>(
+ base::apple::ObjCCastStrict<BVCContainerViewController>(
active_view_controller)
.currentBVC;
}
diff --git a/ios/chrome/test/app/password_test_util.mm b/ios/chrome/test/app/password_test_util.mm
index 11da1297..4da4966 100644
--- a/ios/chrome/test/app/password_test_util.mm
+++ b/ios/chrome/test/app/password_test_util.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/test/app/password_test_util.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/test/app/mock_reauthentication_module.h"
namespace chrome_test_util {
diff --git a/ios/chrome/test/app/stack_view_test_util.mm b/ios/chrome/test/app/stack_view_test_util.mm
index b6dc674..caca9f5 100644
--- a/ios/chrome/test/app/stack_view_test_util.mm
+++ b/ios/chrome/test/app/stack_view_test_util.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/test/app/stack_view_test_util.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/app/main_controller.h"
#import "ios/chrome/app/main_controller_private.h"
#import "ios/chrome/browser/ui/stack_view/stack_view_controller.h"
@@ -22,7 +22,7 @@
return nil;
MainController* mainController = chrome_test_util::GetMainController();
DCHECK(mainController);
- return base::mac::ObjCCastStrict<StackViewController>(
+ return base::apple::ObjCCastStrict<StackViewController>(
mainController.tabSwitcher);
}
diff --git a/ios/chrome/test/app/tab_test_util.mm b/ios/chrome/test/app/tab_test_util.mm
index 8068b46..6766098 100644
--- a/ios/chrome/test/app/tab_test_util.mm
+++ b/ios/chrome/test/app/tab_test_util.mm
@@ -6,7 +6,7 @@
#import <Foundation/Foundation.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/app/main_controller.h"
#import "ios/chrome/browser/metrics/tab_usage_recorder_browser_agent.h"
#import "ios/chrome/browser/sessions/session_restoration_browser_agent.h"
diff --git a/ios/chrome/test/earl_grey/accessibility_util.mm b/ios/chrome/test/earl_grey/accessibility_util.mm
index 7e34ce2..8012639 100644
--- a/ios/chrome/test/earl_grey/accessibility_util.mm
+++ b/ios/chrome/test/earl_grey/accessibility_util.mm
@@ -5,7 +5,7 @@
#import <GTXiLib/GTXiLib.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/test/earl_grey/accessibility_util.h"
namespace chrome_test_util {
@@ -20,7 +20,7 @@
for (UIScene* scene in UIApplication.sharedApplication.connectedScenes) {
UIWindowScene* windowScene =
- base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ base::apple::ObjCCastStrict<UIWindowScene>(scene);
if (windowScene) {
for (UIWindow* window in windowScene.windows) {
// Run the checks on all elements on the screen.
diff --git a/ios/chrome/test/earl_grey/chrome_actions.mm b/ios/chrome/test/earl_grey/chrome_actions.mm
index c17b23a..b5fb5a9 100644
--- a/ios/chrome/test/earl_grey/chrome_actions.mm
+++ b/ios/chrome/test/earl_grey/chrome_actions.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/test/earl_grey/chrome_actions.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/test/earl_grey/chrome_actions_app_interface.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
#import "ios/testing/earl_grey/earl_grey_test.h"
diff --git a/ios/chrome/test/earl_grey/chrome_actions_app_interface.mm b/ios/chrome/test/earl_grey/chrome_actions_app_interface.mm
index 0304ad6..bdbca6fe 100644
--- a/ios/chrome/test/earl_grey/chrome_actions_app_interface.mm
+++ b/ios/chrome/test/earl_grey/chrome_actions_app_interface.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/test/earl_grey/chrome_actions_app_interface.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_switch_cell.h"
#import "ios/chrome/browser/shared/ui/table_view/cells/table_view_switch_item.h"
#import "ios/chrome/test/app/tab_test_util.h"
@@ -70,7 +70,7 @@
__block BOOL success = NO;
grey_dispatch_sync_on_main_thread(^{
TableViewSwitchCell* switchCell =
- base::mac::ObjCCast<TableViewSwitchCell>(collectionViewCell);
+ base::apple::ObjCCast<TableViewSwitchCell>(collectionViewCell);
if (!switchCell) {
NSString* description = @"The element isn't of the expected type "
@"(TableViewSwitchCell).";
@@ -107,7 +107,7 @@
GREYPerformBlock scrollToTopBlock = ^BOOL(id element,
__strong NSError** error) {
grey_dispatch_sync_on_main_thread(^{
- UIScrollView* view = base::mac::ObjCCast<UIScrollView>(element);
+ UIScrollView* view = base::apple::ObjCCast<UIScrollView>(element);
if (!view) {
*error = [NSError
errorWithDomain:kChromeActionsErrorDomain
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.mm b/ios/chrome/test/earl_grey/chrome_earl_grey.mm
index 33b7ba4..96b577ea 100644
--- a/ios/chrome/test/earl_grey/chrome_earl_grey.mm
+++ b/ios/chrome/test/earl_grey/chrome_earl_grey.mm
@@ -7,10 +7,10 @@
#import <Foundation/Foundation.h>
#import <WebKit/WebKit.h>
+#import "base/apple/foundation_util.h"
#import "base/format_macros.h"
#import "base/json/json_string_value_serializer.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "ios/chrome/browser/shared/model/prefs/pref_names.h"
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm
index abac4c2..f423187 100644
--- a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm
+++ b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm
@@ -6,13 +6,13 @@
#import <WebKit/WebKit.h>
+#import "base/apple/foundation_util.h"
#import "base/command_line.h"
#import "base/containers/contains.h"
#import "base/files/file.h"
#import "base/files/file_util.h"
#import "base/ios/ios_util.h"
#import "base/json/json_string_value_serializer.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "base/test/scoped_feature_list.h"
@@ -559,7 +559,7 @@
NSSet<UIScene*>* scenes = UIApplication.sharedApplication.connectedScenes;
for (UIScene* scene in scenes) {
UIWindowScene* windowScene =
- base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ base::apple::ObjCCastStrict<UIWindowScene>(scene);
for (UIWindow* window in windowScene.windows) {
if (window.isKeyWindow) {
@@ -744,7 +744,7 @@
// Attempt to deflake WebKit sometimes still holding on to the browser cache
// with a larger hammer.
base::ScopedAllowBlockingForTesting allow_blocking;
- base::FilePath library_dir = base::mac::GetUserLibraryPath();
+ base::FilePath library_dir = base::apple::GetUserLibraryPath();
base::FilePath webkit_cache_dir = library_dir.Append("WebKit");
DeletePathRecursively(webkit_cache_dir);
@@ -1395,7 +1395,7 @@
for (UIScene* scene in UIApplication.sharedApplication
.connectedScenes) {
UIWindowScene* windowScene =
- base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ base::apple::ObjCCastStrict<UIWindowScene>(scene);
[windows addObjectsFromArray:windowScene.windows];
}
diff --git a/ios/chrome/test/earl_grey/chrome_matchers_app_interface.mm b/ios/chrome/test/earl_grey/chrome_matchers_app_interface.mm
index c72ab84..4c43bad 100644
--- a/ios/chrome/test/earl_grey/chrome_matchers_app_interface.mm
+++ b/ios/chrome/test/earl_grey/chrome_matchers_app_interface.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/test/earl_grey/chrome_matchers_app_interface.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "components/safe_browsing/core/common/features.h"
#import "components/strings/grit/components_strings.h"
@@ -98,7 +98,7 @@
id<GREYMatcher> TableViewSwitchIsToggledOn(BOOL is_toggled_on) {
GREYMatchesBlock matches = ^BOOL(id element) {
TableViewSwitchCell* switch_cell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(element);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(element);
UISwitch* switch_view = switch_cell.switchView;
return (switch_view.on && is_toggled_on) ||
(!switch_view.on && !is_toggled_on);
@@ -116,7 +116,7 @@
id<GREYMatcher> TableViewSwitchIsEnabled(BOOL is_enabled) {
GREYMatchesBlock matches = ^BOOL(id element) {
TableViewSwitchCell* switch_cell =
- base::mac::ObjCCastStrict<TableViewSwitchCell>(element);
+ base::apple::ObjCCastStrict<TableViewSwitchCell>(element);
UISwitch* switch_view = switch_cell.switchView;
return (switch_view.enabled && is_enabled) ||
(!switch_view.enabled && !is_enabled);
@@ -150,7 +150,7 @@
UIWindow* WindowWithAccessibilityIdentifier(NSString* accessibility_id) {
for (UIScene* scene in UIApplication.sharedApplication.connectedScenes) {
UIWindowScene* windowScene =
- base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ base::apple::ObjCCastStrict<UIWindowScene>(scene);
for (UIWindow* window in windowScene.windows) {
if ([window.accessibilityIdentifier isEqualToString:accessibility_id]) {
return window;
@@ -373,7 +373,7 @@
GREYElementMatcherBlock* matcher = [GREYElementMatcherBlock
matcherWithMatchesBlock:^BOOL(id element) {
OmniboxTextFieldIOS* omnibox =
- base::mac::ObjCCast<OmniboxTextFieldIOS>(element);
+ base::apple::ObjCCast<OmniboxTextFieldIOS>(element);
return [omnibox.text isEqualToString:text];
}
descriptionBlock:^void(id<GREYDescription> description) {
@@ -388,7 +388,7 @@
GREYElementMatcherBlock* matcher = [GREYElementMatcherBlock
matcherWithMatchesBlock:^BOOL(id element) {
OmniboxTextFieldIOS* omnibox =
- base::mac::ObjCCast<OmniboxTextFieldIOS>(element);
+ base::apple::ObjCCast<OmniboxTextFieldIOS>(element);
return [omnibox.text containsString:text];
}
descriptionBlock:^void(id<GREYDescription> description) {
@@ -521,7 +521,7 @@
}
+ (id<GREYMatcher>)bookmarksNavigationBarBackButton {
- UINavigationBar* navBar = base::mac::ObjCCastStrict<UINavigationBar>(
+ UINavigationBar* navBar = base::apple::ObjCCastStrict<UINavigationBar>(
SubviewWithAccessibilityIdentifier(kBookmarkNavigationBarIdentifier,
GetAnyKeyWindow()));
return grey_allOf(grey_buttonTitle(navBar.backItem.title),
@@ -726,7 +726,7 @@
}
+ (id<GREYMatcher>)settingsMenuBackButton {
- UINavigationBar* navBar = base::mac::ObjCCastStrict<UINavigationBar>(
+ UINavigationBar* navBar = base::apple::ObjCCastStrict<UINavigationBar>(
SubviewWithAccessibilityIdentifier(@"SettingNavigationBar",
GetAnyKeyWindow()));
return
@@ -734,7 +734,7 @@
}
+ (id<GREYMatcher>)settingsMenuBackButtonInWindowWithNumber:(int)windowNumber {
- UINavigationBar* navBar = base::mac::ObjCCastStrict<UINavigationBar>(
+ UINavigationBar* navBar = base::apple::ObjCCastStrict<UINavigationBar>(
SubviewWithAccessibilityIdentifier(
@"SettingNavigationBar", WindowWithAccessibilityIdentifier([NSString
stringWithFormat:@"%d", windowNumber])));
@@ -1075,7 +1075,7 @@
+ (id<GREYMatcher>)contentViewSmallerThanScrollView {
GREYMatchesBlock matches = ^BOOL(UIView* view) {
- UIScrollView* scrollView = base::mac::ObjCCast<UIScrollView>(view);
+ UIScrollView* scrollView = base::apple::ObjCCast<UIScrollView>(view);
return scrollView &&
scrollView.contentSize.height < scrollView.bounds.size.height;
};
@@ -1116,7 +1116,8 @@
if (![element isKindOfClass:UITableViewCell.class])
return NO;
- UITableViewCell* cell = base::mac::ObjCCastStrict<UITableViewCell>(element);
+ UITableViewCell* cell =
+ base::apple::ObjCCastStrict<UITableViewCell>(element);
// Try to find the TableView containing the cell.
UIView* potential_table_view = [cell superview];
@@ -1129,7 +1130,7 @@
return NO;
UITableView* table_view =
- base::mac::ObjCCastStrict<UITableView>(potential_table_view);
+ base::apple::ObjCCastStrict<UITableView>(potential_table_view);
NSIndexPath* index_path = [table_view indexPathForCell:cell];
diff --git a/ios/chrome/test/earl_grey/chrome_xcui_actions.mm b/ios/chrome/test/earl_grey/chrome_xcui_actions.mm
index e869d70e..4281214 100644
--- a/ios/chrome/test/earl_grey/chrome_xcui_actions.mm
+++ b/ios/chrome/test/earl_grey/chrome_xcui_actions.mm
@@ -4,7 +4,7 @@
#import "ios/chrome/test/earl_grey/chrome_xcui_actions.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
#import "ios/testing/earl_grey/earl_grey_test.h"
diff --git a/ios/chrome/test/providers/keyboard/test_keyboard.mm b/ios/chrome/test/providers/keyboard/test_keyboard.mm
index a52a22e..7f4370a 100644
--- a/ios/chrome/test/providers/keyboard/test_keyboard.mm
+++ b/ios/chrome/test/providers/keyboard/test_keyboard.mm
@@ -4,7 +4,7 @@
#import "ios/public/provider/chrome/browser/keyboard/keyboard_api.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
namespace ios {
namespace provider {
@@ -13,7 +13,7 @@
UIWindow* last_window = nil;
for (UIScene* scene in UIApplication.sharedApplication.connectedScenes) {
UIWindowScene* window_scene =
- base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ base::apple::ObjCCastStrict<UIWindowScene>(scene);
if (window_scene.windows.count) {
last_window = [window_scene.windows lastObject];
}
diff --git a/ios/chrome/tools/strings/generate_localizable_strings.mm b/ios/chrome/tools/strings/generate_localizable_strings.mm
index ce7e504..bd366ca 100644
--- a/ios/chrome/tools/strings/generate_localizable_strings.mm
+++ b/ios/chrome/tools/strings/generate_localizable_strings.mm
@@ -29,9 +29,9 @@
#import <utility>
#import <vector>
+#import "base/apple/foundation_util.h"
#import "base/files/file_path.h"
#import "base/files/file_util.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/string_piece.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/chrome/tools/strings/grit_header_parsing.h"
@@ -144,7 +144,7 @@
std::vector<base::FilePath> headers;
for (NSString* header in header_list) {
- headers.push_back(base::mac::NSStringToFilePath(
+ headers.push_back(base::apple::NSStringToFilePath(
[root_header_dir stringByAppendingPathComponent:header]));
}
diff --git a/ios/chrome/tools/strings/substitute_strings_identifier.mm b/ios/chrome/tools/strings/substitute_strings_identifier.mm
index 66deedb..6cb334c 100644
--- a/ios/chrome/tools/strings/substitute_strings_identifier.mm
+++ b/ios/chrome/tools/strings/substitute_strings_identifier.mm
@@ -9,10 +9,10 @@
#import <string>
+#import "base/apple/foundation_util.h"
#import "base/files/file.h"
#import "base/files/file_path.h"
#import "base/files/file_util.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/string_piece.h"
#import "base/strings/string_util.h"
#import "base/strings/sys_string_conversions.h"
@@ -75,17 +75,17 @@
NSObject* ConvertValue(NSObject* value, const ResourceMap& resource_map) {
if ([value isKindOfClass:[NSString class]]) {
- NSString* string = base::mac::ObjCCastStrict<NSString>(value);
+ NSString* string = base::apple::ObjCCastStrict<NSString>(value);
return ConvertString(string, resource_map);
}
if ([value isKindOfClass:[NSArray class]]) {
- NSArray<NSObject*>* array = base::mac::ObjCCastStrict<NSArray>(value);
+ NSArray<NSObject*>* array = base::apple::ObjCCastStrict<NSArray>(value);
return ConvertArray(array, resource_map);
}
if ([value isKindOfClass:[NSDictionary class]]) {
- PList* plist = base::mac::ObjCCastStrict<NSDictionary>(value);
+ PList* plist = base::apple::ObjCCastStrict<NSDictionary>(value);
return ConvertPlist(plist, resource_map);
}
@@ -95,8 +95,8 @@
bool ConvertFile(const base::FilePath& source_path,
const base::FilePath& output_path,
const ResourceMap& resource_map) {
- NSURL* source_url = base::mac::FilePathToNSURL(source_path);
- NSURL* output_url = base::mac::FilePathToNSURL(output_path);
+ NSURL* source_url = base::apple::FilePathToNSURL(source_path);
+ NSURL* output_url = base::apple::FilePathToNSURL(output_path);
NSError* error = nil;
PList* source_plist = [NSDictionary dictionaryWithContentsOfURL:source_url
diff --git a/ios/net/cookies/cookie_store_ios.mm b/ios/net/cookies/cookie_store_ios.mm
index 9f677f6..0fa3d54 100644
--- a/ios/net/cookies/cookie_store_ios.mm
+++ b/ios/net/cookies/cookie_store_ios.mm
@@ -8,12 +8,12 @@
#import <utility>
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/files/file_path.h"
#import "base/files/file_util.h"
#import "base/functional/bind.h"
#import "base/location.h"
-#import "base/mac/foundation_util.h"
#import "base/memory/weak_ptr.h"
#import "base/notreached.h"
#import "base/observer_list.h"
diff --git a/ios/net/crn_http_protocol_handler.mm b/ios/net/crn_http_protocol_handler.mm
index 2d8115e..533085c 100644
--- a/ios/net/crn_http_protocol_handler.mm
+++ b/ios/net/crn_http_protocol_handler.mm
@@ -10,11 +10,11 @@
#include <utility>
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
@@ -278,7 +278,7 @@
// TODO(crbug.com/738025): Dynamically change the size of the read buffer
// to improve the read (POST) performance, see AllocateReadBuffer(), &
// avoid unnecessary data copy.
- length = [base::mac::ObjCCastStrict<NSInputStream>(stream)
+ length = [base::apple::ObjCCastStrict<NSInputStream>(stream)
read:reinterpret_cast<unsigned char*>(read_buffer_.get())
maxLength:read_buffer_size_];
if (length > 0) {
diff --git a/ios/showcase/tab_grid/sc_grid_cell_view_controller.mm b/ios/showcase/tab_grid/sc_grid_cell_view_controller.mm
index 50ede00..4efa812 100644
--- a/ios/showcase/tab_grid/sc_grid_cell_view_controller.mm
+++ b/ios/showcase/tab_grid/sc_grid_cell_view_controller.mm
@@ -4,7 +4,7 @@
#import "ios/showcase/tab_grid/sc_grid_cell_view_controller.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/numerics/safe_conversions.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_cell.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_theme.h"
@@ -61,7 +61,7 @@
- (UICollectionViewCell*)collectionView:(UICollectionView*)collectionView
cellForItemAtIndexPath:(NSIndexPath*)indexPath {
- GridCell* cell = base::mac::ObjCCastStrict<GridCell>([collectionView
+ GridCell* cell = base::apple::ObjCCastStrict<GridCell>([collectionView
dequeueReusableCellWithReuseIdentifier:kCellIdentifier
forIndexPath:indexPath]);
cell.delegate = static_cast<id<GridCellDelegate>>(self.alerter);
diff --git a/ios/showcase/test/showcase_eg_utils.mm b/ios/showcase/test/showcase_eg_utils.mm
index ac9190b..efa722f 100644
--- a/ios/showcase/test/showcase_eg_utils.mm
+++ b/ios/showcase/test/showcase_eg_utils.mm
@@ -4,7 +4,7 @@
#import "ios/showcase/test/showcase_eg_utils.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/showcase/test/showcase_test_case.h"
#import "ios/testing/earl_grey/earl_grey_test.h"
#import "ios/web/common/uikit_ui_util.h"
@@ -31,7 +31,7 @@
// Returns the Showcase navigation controller.
UINavigationController* ShowcaseNavigationController() {
UINavigationController* showcaseNavigationController =
- base::mac::ObjCCastStrict<UINavigationController>(
+ base::apple::ObjCCastStrict<UINavigationController>(
[GetAnyKeyWindow() rootViewController]);
return showcaseNavigationController;
}
diff --git a/ios/showcase/test/showcase_test_case_app_interface.mm b/ios/showcase/test/showcase_test_case_app_interface.mm
index fe5570c..92e4aa66 100644
--- a/ios/showcase/test/showcase_test_case_app_interface.mm
+++ b/ios/showcase/test/showcase_test_case_app_interface.mm
@@ -4,13 +4,13 @@
#import "ios/showcase/test/showcase_test_case_app_interface.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/showcase/core/app_delegate.h"
@implementation ShowcaseTestCaseAppInterface
+ (void)setupUI {
- AppDelegate* delegate = base::mac::ObjCCastStrict<AppDelegate>(
+ AppDelegate* delegate = base::apple::ObjCCastStrict<AppDelegate>(
[UIApplication sharedApplication].delegate);
[delegate setupUI];
}
diff --git a/ios/testing/earl_grey/base_earl_grey_test_case_app_interface.mm b/ios/testing/earl_grey/base_earl_grey_test_case_app_interface.mm
index 43ad315..eb41c55 100644
--- a/ios/testing/earl_grey/base_earl_grey_test_case_app_interface.mm
+++ b/ios/testing/earl_grey/base_earl_grey_test_case_app_interface.mm
@@ -7,8 +7,8 @@
#import <UIKit/UIKit.h>
#import <objc/runtime.h>
+#import "base/apple/foundation_util.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
@interface UIApplication (Testing)
@@ -24,7 +24,7 @@
+ (void)enableFastAnimation {
for (UIScene* scene in UIApplication.sharedApplication.connectedScenes) {
UIWindowScene* windowScene =
- base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ base::apple::ObjCCastStrict<UIWindowScene>(scene);
for (UIWindow* window in windowScene.windows) {
[[window layer] setSpeed:100];
}
diff --git a/ios/testing/scoped_block_swizzler_unittest.mm b/ios/testing/scoped_block_swizzler_unittest.mm
index d4feccb..586412a4 100644
--- a/ios/testing/scoped_block_swizzler_unittest.mm
+++ b/ios/testing/scoped_block_swizzler_unittest.mm
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#import "ios/testing/scoped_block_swizzler.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
#import "testing/platform_test.h"
@@ -56,7 +56,7 @@
{
id block = ^NSString*(id self) {
- return base::mac::ObjCCastStrict<ScopedBlockSwizzlerTestClass>(self)
+ return base::apple::ObjCCastStrict<ScopedBlockSwizzlerTestClass>(self)
.value;
};
ScopedBlockSwizzler swizzler([ScopedBlockSwizzlerTestClass class],
diff --git a/ios/web/browser_state_web_view_partition_inttest.mm b/ios/web/browser_state_web_view_partition_inttest.mm
index 7c9ea233..3be7a651 100644
--- a/ios/web/browser_state_web_view_partition_inttest.mm
+++ b/ios/web/browser_state_web_view_partition_inttest.mm
@@ -7,7 +7,7 @@
#import <memory>
#import <string>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/test/ios/wait_util.h"
#import "ios/web/common/web_view_creation_util.h"
#import "ios/web/public/browser_state.h"
@@ -74,7 +74,7 @@
// Returns a csv list of all cookies from `web_view`.
NSString* GetCookies(WKWebView* web_view) {
id result = web::test::ExecuteJavaScript(web_view, @"document.cookie");
- return base::mac::ObjCCastStrict<NSString>(result);
+ return base::apple::ObjCCastStrict<NSString>(result);
}
// Sets a localstorage key, value pair on `web_view`.
diff --git a/ios/web/common/annotations_utils.mm b/ios/web/common/annotations_utils.mm
index 285fc3f..4f9fee5 100644
--- a/ios/web/common/annotations_utils.mm
+++ b/ios/web/common/annotations_utils.mm
@@ -4,8 +4,8 @@
#import "ios/web/common/annotations_utils.h"
+#import "base/apple/foundation_util.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/string_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
@@ -54,7 +54,7 @@
}
} else if (match.resultType == TCTextCheckingTypeParcelTracking) {
CustomTextCheckingResult* custom_match =
- base::mac::ObjCCastStrict<CustomTextCheckingResult>(match);
+ base::apple::ObjCCastStrict<CustomTextCheckingResult>(match);
[dict setObject:@"parcel" forKey:@"type"];
if (custom_match.carrier) {
[dict setObject:[NSNumber numberWithInt:custom_match.carrier]
@@ -65,7 +65,7 @@
}
} else if (match.resultType == TCTextCheckingTypeMeasurement) {
CustomTextCheckingResult* custom_match =
- base::mac::ObjCCastStrict<CustomTextCheckingResult>(match);
+ base::apple::ObjCCastStrict<CustomTextCheckingResult>(match);
[dict setObject:@"measurement" forKey:@"type"];
if (custom_match.measurement) {
[dict setObject:custom_match.measurement forKey:@"measurement"];
diff --git a/ios/web/common/uikit_ui_util.mm b/ios/web/common/uikit_ui_util.mm
index 87965e1..492eb157 100644
--- a/ios/web/common/uikit_ui_util.mm
+++ b/ios/web/common/uikit_ui_util.mm
@@ -6,12 +6,12 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
UIWindow* GetAnyKeyWindow() {
for (UIScene* scene in UIApplication.sharedApplication.connectedScenes) {
UIWindowScene* windowScene =
- base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ base::apple::ObjCCastStrict<UIWindowScene>(scene);
// Find a key window if it exists.
for (UIWindow* window in windowScene.windows) {
if (window.isKeyWindow)
diff --git a/ios/web/content/web_state/content_web_state.mm b/ios/web/content/web_state/content_web_state.mm
index 3ab9e49..135ed16 100644
--- a/ios/web/content/web_state/content_web_state.mm
+++ b/ios/web/content/web_state/content_web_state.mm
@@ -4,7 +4,7 @@
#import "ios/web/content/web_state/content_web_state.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/utf_string_conversions.h"
#import "content/public/browser/navigation_entry.h"
#import "content/public/browser/web_contents.h"
@@ -118,7 +118,7 @@
this, params.browser_state, web_contents_->GetController());
web_frames_manager_ = std::make_unique<ContentWebFramesManager>(this);
- UIScrollView* web_contents_view = base::mac::ObjCCastStrict<UIScrollView>(
+ UIScrollView* web_contents_view = base::apple::ObjCCastStrict<UIScrollView>(
web_contents_->GetNativeView().Get());
web_view_ = [[CRCWebViewportContainerView alloc] init];
@@ -662,7 +662,7 @@
if (top_control_scroll_in_progress_) {
return cached_shrink_controls_;
}
- UIScrollView* web_contents_view = base::mac::ObjCCastStrict<UIScrollView>(
+ UIScrollView* web_contents_view = base::apple::ObjCCastStrict<UIScrollView>(
web_contents->GetNativeView().Get());
if (web_contents_view.contentInset.top > [web_view_ minViewportInsets].top) {
return true;
diff --git a/ios/web/crw_navigation_item_storage_unittest.mm b/ios/web/crw_navigation_item_storage_unittest.mm
index feefcc48..f4e94e72 100644
--- a/ios/web/crw_navigation_item_storage_unittest.mm
+++ b/ios/web/crw_navigation_item_storage_unittest.mm
@@ -9,7 +9,7 @@
#import <utility>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "base/test/metrics/histogram_tester.h"
@@ -135,7 +135,7 @@
unarchiver.requiresSecureCoding = NO;
CRWNavigationItemStorage* item_storage =
- base::mac::ObjCCast<CRWNavigationItemStorage>(
+ base::apple::ObjCCast<CRWNavigationItemStorage>(
[unarchiver decodeObjectForKey:NSKeyedArchiveRootObjectKey]);
ASSERT_TRUE(item_storage);
diff --git a/ios/web/download/download_native_task_bridge.mm b/ios/web/download/download_native_task_bridge.mm
index 1a6a00f..a626e32 100644
--- a/ios/web/download/download_native_task_bridge.mm
+++ b/ios/web/download/download_native_task_bridge.mm
@@ -4,10 +4,10 @@
#import "ios/web/download/download_native_task_bridge.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
#import "base/files/file_util.h"
#import "base/functional/callback.h"
-#import "base/mac/foundation_util.h"
#import "base/task/thread_pool.h"
#import "ios/web/download/download_result.h"
#import "ios/web/web_view/error_translation_util.h"
@@ -119,7 +119,7 @@
_progressCallback = std::move(progressCallback);
_responseCallback = std::move(responseCallback);
_completeCallback = std::move(completeCallback);
- _urlForDownload = base::mac::FilePathToNSURL(path);
+ _urlForDownload = base::apple::FilePathToNSURL(path);
if (_resumeData) {
DCHECK(!_startDownloadBlock);
@@ -218,7 +218,7 @@
base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE, {base::TaskPriority::USER_VISIBLE, base::MayBlock()},
base::BindOnce(&FileSizeForFileAtPath,
- base::mac::NSStringToFilePath(_urlForDownload.path)),
+ base::apple::NSStringToFilePath(_urlForDownload.path)),
base::BindOnce(&DownloadDidFinishWithSize, std::move(_progressCallback),
std::move(_completeCallback)));
}
@@ -266,7 +266,7 @@
int http_error = -1;
if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
http_error =
- base::mac::ObjCCastStrict<NSHTTPURLResponse>(response).statusCode;
+ base::apple::ObjCCastStrict<NSHTTPURLResponse>(response).statusCode;
}
std::move(_responseCallback).Run(http_error, response.MIMEType);
diff --git a/ios/web/download/download_session_task_impl.mm b/ios/web/download/download_session_task_impl.mm
index fd066d8..01b1403 100644
--- a/ios/web/download/download_session_task_impl.mm
+++ b/ios/web/download/download_session_task_impl.mm
@@ -4,8 +4,8 @@
#import "ios/web/download/download_session_task_impl.h"
+#import "base/apple/foundation_util.h"
#import "base/check.h"
-#import "base/mac/foundation_util.h"
#import "base/sequence_checker.h"
#import "base/strings/sys_string_conversions.h"
#import "base/task/bind_post_task.h"
@@ -51,7 +51,7 @@
static TaskInfo FromTask(NSURLSessionTask* task) {
int http_code = -1;
if ([task.response isKindOfClass:[NSHTTPURLResponse class]]) {
- http_code = base::mac::ObjCCastStrict<NSHTTPURLResponse>(task.response)
+ http_code = base::apple::ObjCCastStrict<NSHTTPURLResponse>(task.response)
.statusCode;
}
diff --git a/ios/web/js_messaging/web_view_js_utils.mm b/ios/web/js_messaging/web_view_js_utils.mm
index fd0c073..d833d14 100644
--- a/ios/web/js_messaging/web_view_js_utils.mm
+++ b/ios/web/js_messaging/web_view_js_utils.mm
@@ -7,8 +7,8 @@
#import <CoreFoundation/CoreFoundation.h>
#import <WebKit/WebKit.h>
+#import "base/apple/foundation_util.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/sys_string_conversions.h"
#import "base/values.h"
@@ -45,7 +45,7 @@
} else if (result_type == CFDictionaryGetTypeID()) {
base::Value::Dict dictionary;
for (id key in wk_result) {
- NSString* obj_c_string = base::mac::ObjCCast<NSString>(key);
+ NSString* obj_c_string = base::apple::ObjCCast<NSString>(key);
const std::string path = base::SysNSStringToUTF8(obj_c_string);
std::unique_ptr<base::Value> value =
ValueResultFromWKResult(wk_result[obj_c_string], max_depth - 1);
diff --git a/ios/web/js_messaging/web_view_js_utils_unittest.mm b/ios/web/js_messaging/web_view_js_utils_unittest.mm
index 4837b1f..5df28a83 100644
--- a/ios/web/js_messaging/web_view_js_utils_unittest.mm
+++ b/ios/web/js_messaging/web_view_js_utils_unittest.mm
@@ -6,9 +6,9 @@
#import <WebKit/WebKit.h>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/functional/callback_helpers.h"
-#import "base/mac/foundation_util.h"
#import "base/test/ios/wait_util.h"
#import "base/values.h"
#import "ios/web/test/fakes/crw_fake_script_message_handler.h"
@@ -329,7 +329,7 @@
EXPECT_TRUE([wk_result isKindOfClass:[NSDictionary class]]);
NSDictionary* wk_result_dictionary =
- base::mac::ObjCCastStrict<NSDictionary>(wk_result);
+ base::apple::ObjCCastStrict<NSDictionary>(wk_result);
EXPECT_NSEQ(@"Value1", wk_result_dictionary[@"Key1"]);
NSDictionary* inner_dictionary = wk_result_dictionary[@"Key2"];
@@ -353,7 +353,7 @@
EXPECT_TRUE(wk_result);
EXPECT_TRUE([wk_result isKindOfClass:[NSArray class]]);
- NSArray* wk_result_array = base::mac::ObjCCastStrict<NSArray>(wk_result);
+ NSArray* wk_result_array = base::apple::ObjCCastStrict<NSArray>(wk_result);
EXPECT_EQ(3UL, wk_result_array.count);
EXPECT_NSEQ(@"Value1", wk_result_array[0]);
diff --git a/ios/web/navigation/crw_session_storage_unittest.mm b/ios/web/navigation/crw_session_storage_unittest.mm
index d58c300a..eec501d 100644
--- a/ios/web/navigation/crw_session_storage_unittest.mm
+++ b/ios/web/navigation/crw_session_storage_unittest.mm
@@ -4,8 +4,8 @@
#import "ios/web/public/session/crw_session_storage.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/ios_util.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
#import "base/test/scoped_feature_list.h"
@@ -116,7 +116,7 @@
NSKeyedUnarchiver* unarchiver =
[[NSKeyedUnarchiver alloc] initForReadingFromData:data error:nil];
unarchiver.requiresSecureCoding = NO;
- return base::mac::ObjCCast<CRWSessionStorage>(
+ return base::apple::ObjCCast<CRWSessionStorage>(
[unarchiver decodeObjectForKey:NSKeyedArchiveRootObjectKey]);
}
diff --git a/ios/web/navigation/crw_wk_navigation_handler.mm b/ios/web/navigation/crw_wk_navigation_handler.mm
index 3557e211..24b6778 100644
--- a/ios/web/navigation/crw_wk_navigation_handler.mm
+++ b/ios/web/navigation/crw_wk_navigation_handler.mm
@@ -4,9 +4,9 @@
#import "ios/web/navigation/crw_wk_navigation_handler.h"
+#import "base/apple/foundation_util.h"
#import "base/feature_list.h"
#import "base/ios/ns_error_util.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/strings/sys_string_conversions.h"
@@ -1659,7 +1659,7 @@
base::ScopedCFTypeRef<CFArrayRef> certificateChain(
SecTrustCopyCertificateChain(trust));
SecCertificateRef secCertificate =
- base::mac::CFCastStrict<SecCertificateRef>(
+ base::apple::CFCastStrict<SecCertificateRef>(
CFArrayGetValueAtIndex(certificateChain, 0));
leafCert = net::x509_util::CreateX509CertificateFromSecCertificate(
base::ScopedCFTypeRef<SecCertificateRef>(secCertificate,
diff --git a/ios/web/navigation/navigation_manager_impl_unittest.mm b/ios/web/navigation/navigation_manager_impl_unittest.mm
index 394dc62b..c01b1fccc 100644
--- a/ios/web/navigation/navigation_manager_impl_unittest.mm
+++ b/ios/web/navigation/navigation_manager_impl_unittest.mm
@@ -7,8 +7,8 @@
#import <array>
#import <string>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/escape.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
@@ -3047,7 +3047,7 @@
~NavigationManagerSerialisationTest() override {}
CRWFakeWebViewNavigationProxy* fake_web_view() {
- return base::mac::ObjCCastStrict<CRWFakeWebViewNavigationProxy>(
+ return base::apple::ObjCCastStrict<CRWFakeWebViewNavigationProxy>(
web_state_->GetWebViewNavigationProxy());
}
diff --git a/ios/web/navigation/serializable_user_data_manager_impl.mm b/ios/web/navigation/serializable_user_data_manager_impl.mm
index 623b2c8f..d6e3bce0 100644
--- a/ios/web/navigation/serializable_user_data_manager_impl.mm
+++ b/ios/web/navigation/serializable_user_data_manager_impl.mm
@@ -4,7 +4,7 @@
#import "ios/web/navigation/serializable_user_data_manager_impl.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/web/public/session/crw_session_user_data.h"
#import "ios/web/public/web_state.h"
diff --git a/ios/web/navigation/window_location_inttest.mm b/ios/web/navigation/window_location_inttest.mm
index 94224f4..ea16c51 100644
--- a/ios/web/navigation/window_location_inttest.mm
+++ b/ios/web/navigation/window_location_inttest.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/memory/ptr_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
diff --git a/ios/web/public/test/earl_grey/web_view_actions.mm b/ios/web/public/test/earl_grey/web_view_actions.mm
index 628f8cb..0d29525 100644
--- a/ios/web/public/test/earl_grey/web_view_actions.mm
+++ b/ios/web/public/test/earl_grey/web_view_actions.mm
@@ -6,9 +6,9 @@
#import <WebKit/WebKit.h>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/stringprintf.h"
#import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
@@ -228,7 +228,7 @@
constraints:WebViewInWebState(state)
performBlock:^BOOL(id element, __strong NSError** error_or_nil) {
// Checks that the element is indeed a WKWebView.
- WKWebView* web_view = base::mac::ObjCCast<WKWebView>(element);
+ WKWebView* web_view = base::apple::ObjCCast<WKWebView>(element);
if (!web_view) {
*error_or_nil = error_block(@"WebView not found.");
return NO;
diff --git a/ios/web/public/test/http_server/delayed_response_provider.mm b/ios/web/public/test/http_server/delayed_response_provider.mm
index dd03aed5..dd384a7b 100644
--- a/ios/web/public/test/http_server/delayed_response_provider.mm
+++ b/ios/web/public/test/http_server/delayed_response_provider.mm
@@ -6,8 +6,8 @@
#import <Foundation/Foundation.h>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "net/test/embedded_test_server/http_response.h"
namespace web {
diff --git a/ios/web/security/crw_cert_verification_controller.mm b/ios/web/security/crw_cert_verification_controller.mm
index 85d8aef..8a8cb40 100644
--- a/ios/web/security/crw_cert_verification_controller.mm
+++ b/ios/web/security/crw_cert_verification_controller.mm
@@ -6,10 +6,10 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/check_op.h"
#import "base/functional/bind.h"
#import "base/ios/block_types.h"
-#import "base/mac/foundation_util.h"
#import "base/memory/ref_counted.h"
#import "base/strings/sys_string_conversions.h"
#import "base/task/thread_pool.h"
@@ -232,7 +232,7 @@
base::ScopedCFTypeRef<CFArrayRef> certificateChain(
SecTrustCopyCertificateChain(trust));
SecCertificateRef secCertificate =
- base::mac::CFCastStrict<SecCertificateRef>(
+ base::apple::CFCastStrict<SecCertificateRef>(
CFArrayGetValueAtIndex(certificateChain, 0));
leafCert = net::x509_util::CreateX509CertificateFromSecCertificate(
base::ScopedCFTypeRef<SecCertificateRef>(secCertificate,
diff --git a/ios/web/security/wk_web_view_security_util.mm b/ios/web/security/wk_web_view_security_util.mm
index c08e2e0..99db7fe 100644
--- a/ios/web/security/wk_web_view_security_util.mm
+++ b/ios/web/security/wk_web_view_security_util.mm
@@ -4,8 +4,8 @@
#import "ios/web/security/wk_web_view_security_util.h"
+#import "base/apple/foundation_util.h"
#import "base/apple/scoped_cftyperef.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "base/strings/sys_string_conversions.h"
#import "net/cert/x509_certificate.h"
@@ -80,12 +80,12 @@
SecTrustCopyCertificateChain(trust));
for (CFIndex i = 1; i < cert_count; i++) {
SecCertificateRef secCertificate =
- base::mac::CFCastStrict<SecCertificateRef>(
+ base::apple::CFCastStrict<SecCertificateRef>(
CFArrayGetValueAtIndex(certificateChain, i));
intermediates.emplace_back(secCertificate, base::scoped_policy::RETAIN);
}
SecCertificateRef secCertificate =
- base::mac::CFCastStrict<SecCertificateRef>(
+ base::apple::CFCastStrict<SecCertificateRef>(
CFArrayGetValueAtIndex(certificateChain, 0));
return net::x509_util::CreateX509CertificateFromSecCertificate(
base::ScopedCFTypeRef<SecCertificateRef>(secCertificate,
diff --git a/ios/web/security/wk_web_view_security_util_unittest.mm b/ios/web/security/wk_web_view_security_util_unittest.mm
index 6a41bcc4..13e129f 100644
--- a/ios/web/security/wk_web_view_security_util_unittest.mm
+++ b/ios/web/security/wk_web_view_security_util_unittest.mm
@@ -10,8 +10,8 @@
#import <memory>
#import "base/apple/bridging.h"
+#import "base/apple/foundation_util.h"
#import "base/apple/scoped_cftyperef.h"
-#import "base/mac/foundation_util.h"
#import "crypto/rsa_private_key.h"
#import "net/cert/x509_certificate.h"
#import "net/cert/x509_util.h"
@@ -134,7 +134,7 @@
if (@available(iOS 15.0, *)) {
base::ScopedCFTypeRef<CFArrayRef> certificateChain(
SecTrustCopyCertificateChain(server_trust.get()));
- secCertificate = base::mac::CFCastStrict<SecCertificateRef>(
+ secCertificate = base::apple::CFCastStrict<SecCertificateRef>(
CFArrayGetValueAtIndex(certificateChain, static_cast<CFIndex>(i)));
}
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_15_0
diff --git a/ios/web/session/crw_session_certificate_policy_cache_storage.mm b/ios/web/session/crw_session_certificate_policy_cache_storage.mm
index adb78ab..5a3c239 100644
--- a/ios/web/session/crw_session_certificate_policy_cache_storage.mm
+++ b/ios/web/session/crw_session_certificate_policy_cache_storage.mm
@@ -4,7 +4,7 @@
#import "ios/web/public/session/crw_session_certificate_policy_cache_storage.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/web/public/session/proto/session.pb.h"
#import "ios/web/session/hash_util.h"
@@ -133,7 +133,7 @@
- (BOOL)isEqual:(NSObject*)object {
CRWSessionCertificateStorage* other =
- base::mac::ObjCCast<CRWSessionCertificateStorage>(object);
+ base::apple::ObjCCast<CRWSessionCertificateStorage>(object);
return [other cr_isEqualSameClass:self];
}
@@ -237,7 +237,7 @@
- (BOOL)isEqual:(NSObject*)object {
CRWSessionCertificatePolicyCacheStorage* other =
- base::mac::ObjCCast<CRWSessionCertificatePolicyCacheStorage>(object);
+ base::apple::ObjCCast<CRWSessionCertificatePolicyCacheStorage>(object);
return [other cr_isEqualSameClass:self];
}
diff --git a/ios/web/session/crw_session_storage.mm b/ios/web/session/crw_session_storage.mm
index 67fe0ec..bf62c6b 100644
--- a/ios/web/session/crw_session_storage.mm
+++ b/ios/web/session/crw_session_storage.mm
@@ -4,7 +4,7 @@
#import "ios/web/public/session/crw_session_storage.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/memory/ptr_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/strings/utf_string_conversions.h"
@@ -162,14 +162,14 @@
id<NSCoding, NSObject> userData =
[decoder decodeObjectForKey:kSerializedUserDataKey];
if ([userData isKindOfClass:[CRWSessionUserData class]]) {
- _userData = base::mac::ObjCCastStrict<CRWSessionUserData>(userData);
+ _userData = base::apple::ObjCCastStrict<CRWSessionUserData>(userData);
} else if ([userData isKindOfClass:[NSDictionary class]]) {
// Before M99, the user data was serialized by a C++ class that did
// serialize a NSDictionary<NSString*, id<NSCoding>>* directly.
// TODO(crbug.com/1278308): Remove this deprecated logic when we remove
// support for loading legacy sessions.
NSDictionary<NSString*, id<NSCoding>>* dictionary =
- base::mac::ObjCCastStrict<NSDictionary>(userData);
+ base::apple::ObjCCastStrict<NSDictionary>(userData);
_userData = [[CRWSessionUserData alloc] init];
for (NSString* key in dictionary) {
@@ -204,7 +204,7 @@
// If the value is not an NSString or is empty, a random identifier
// will be generated below.
- _stableIdentifier = base::mac::ObjCCast<NSString>(tabIdValue);
+ _stableIdentifier = base::apple::ObjCCast<NSString>(tabIdValue);
}
}
diff --git a/ios/web/session/crw_session_user_data.mm b/ios/web/session/crw_session_user_data.mm
index 706c6416..75389a9 100644
--- a/ios/web/session/crw_session_user_data.mm
+++ b/ios/web/session/crw_session_user_data.mm
@@ -4,7 +4,7 @@
#import "ios/web/public/session/crw_session_user_data.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
@implementation CRWSessionUserData {
NSMutableDictionary<NSString*, id<NSCoding>>* _data;
@@ -54,7 +54,7 @@
return NO;
CRWSessionUserData* other =
- base::mac::ObjCCastStrict<CRWSessionUserData>(object);
+ base::apple::ObjCCastStrict<CRWSessionUserData>(object);
return [_data isEqual:other->_data];
}
diff --git a/ios/web/shell/test/app/web_shell_test_util.mm b/ios/web/shell/test/app/web_shell_test_util.mm
index 552bb1d..ab10e2a 100644
--- a/ios/web/shell/test/app/web_shell_test_util.mm
+++ b/ios/web/shell/test/app/web_shell_test_util.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "ios/web/shell/view_controller.h"
namespace web {
@@ -15,7 +15,7 @@
UIWindow* GetAnyKeyWindow() {
for (UIScene* scene in UIApplication.sharedApplication.connectedScenes) {
UIWindowScene* windowScene =
- base::mac::ObjCCastStrict<UIWindowScene>(scene);
+ base::apple::ObjCCastStrict<UIWindowScene>(scene);
// Find a key window if it exists.
for (UIWindow* window in windowScene.windows) {
if (window.isKeyWindow) {
diff --git a/ios/web/test/web_int_test.mm b/ios/web/test/web_int_test.mm
index a397cb6..785a195 100644
--- a/ios/web/test/web_int_test.mm
+++ b/ios/web/test/web_int_test.mm
@@ -4,8 +4,8 @@
#import "ios/web/test/web_int_test.h"
+#import "base/apple/foundation_util.h"
#import "base/ios/block_types.h"
-#import "base/mac/foundation_util.h"
#import "base/memory/ptr_util.h"
#import "base/scoped_observation.h"
#import "base/strings/sys_string_conversions.h"
@@ -86,7 +86,7 @@
// network process via private APIs.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
- WKWebView* web_view = base::mac::ObjCCast<WKWebView>(
+ WKWebView* web_view = base::apple::ObjCCast<WKWebView>(
web::WebStateImpl::FromWebState(web_state())
->GetWebViewNavigationProxy());
[web_view performSelector:@selector(_close)];
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index 6f7f132..dc812d425 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -6,11 +6,11 @@
#import <WebKit/WebKit.h>
+#import "base/apple/foundation_util.h"
#import "base/functional/bind.h"
#import "base/ios/block_types.h"
#import "base/ios/ios_util.h"
#import "base/json/string_escape.h"
-#import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h"
#import "base/metrics/user_metrics.h"
@@ -1329,7 +1329,7 @@
web::NavigationItem* item = [weakSelf currentNavItem];
if (item && item->GetUniqueID() == itemID) {
web::PageViewportState viewportState(
- base::mac::ObjCCast<NSString>(viewportContent));
+ base::apple::ObjCCast<NSString>(viewportContent));
completion(&viewportState);
} else {
completion(nullptr);
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm
index 518db72..c5c22c83 100644
--- a/ios/web/web_state/ui/crw_web_controller_unittest.mm
+++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -9,7 +9,7 @@
#import <memory>
#import <utility>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/scoped_observation.h"
#import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h"
diff --git a/ios/web/web_state/ui/crw_web_view_scroll_view_proxy.mm b/ios/web/web_state/ui/crw_web_view_scroll_view_proxy.mm
index 53407200c..0428102 100644
--- a/ios/web/web_state/ui/crw_web_view_scroll_view_proxy.mm
+++ b/ios/web/web_state/ui/crw_web_view_scroll_view_proxy.mm
@@ -7,9 +7,9 @@
#import <objc/runtime.h>
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/auto_reset.h"
#import "base/ios/crb_protocol_observers.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/web/common/features.h"
#import "ios/web/web_state/ui/crw_web_view_scroll_view_delegate_proxy.h"
@@ -386,9 +386,9 @@
if ([keyPath isEqualToString:@"contentSize"]) {
if (!base::FeatureList::IsEnabled(web::features::kSmoothScrollingDefault)) {
NSValue* oldValue =
- base::mac::ObjCCast<NSValue>(change[NSKeyValueChangeOldKey]);
+ base::apple::ObjCCast<NSValue>(change[NSKeyValueChangeOldKey]);
NSValue* newValue =
- base::mac::ObjCCast<NSValue>(change[NSKeyValueChangeNewKey]);
+ base::apple::ObjCCast<NSValue>(change[NSKeyValueChangeNewKey]);
// If the value is unchanged -- if the old and new values are equal --
// then return without notifying observers.
if (oldValue && newValue && [newValue isEqualToValue:oldValue]) {
diff --git a/ios/web/web_state/web_state_impl_unittest.mm b/ios/web/web_state/web_state_impl_unittest.mm
index 9efd7d9..cffe048 100644
--- a/ios/web/web_state/web_state_impl_unittest.mm
+++ b/ios/web/web_state/web_state_impl_unittest.mm
@@ -8,10 +8,10 @@
#import <memory>
+#import "base/apple/foundation_util.h"
#import "base/base64.h"
#import "base/functional/bind.h"
#import "base/logging.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "base/task/sequenced_task_runner.h"
#import "base/test/gmock_callback_support.h"
@@ -824,7 +824,7 @@
extracted_session_storage);
web::SerializableUserDataManager* restored_user_data_manager =
web::SerializableUserDataManager::FromWebState(&restored_web_state);
- NSNumber* user_data_value = base::mac::ObjCCast<NSNumber>(
+ NSNumber* user_data_value = base::apple::ObjCCast<NSNumber>(
restored_user_data_manager->GetValueForSerializationKey(
@"user_data_key"));
EXPECT_EQ(@(1), user_data_value);
diff --git a/ios/web/web_state/web_state_observer_inttest.mm b/ios/web/web_state/web_state_observer_inttest.mm
index 19cf0270..b390a4b 100644
--- a/ios/web/web_state/web_state_observer_inttest.mm
+++ b/ios/web/web_state/web_state_observer_inttest.mm
@@ -5,12 +5,12 @@
#import <memory>
#import <string>
+#import "base/apple/foundation_util.h"
#import "base/base_paths.h"
#import "base/files/file_path.h"
#import "base/functional/bind.h"
#import "base/ios/ios_util.h"
#import "base/ios/ns_error_util.h"
-#import "base/mac/foundation_util.h"
#import "base/path_service.h"
#import "base/scoped_observation.h"
#import "base/strings/string_number_conversions.h"
diff --git a/ios/web_view/internal/autofill/cwv_autofill_controller.mm b/ios/web_view/internal/autofill/cwv_autofill_controller.mm
index dbf8df94..65607ae 100644
--- a/ios/web_view/internal/autofill/cwv_autofill_controller.mm
+++ b/ios/web_view/internal/autofill/cwv_autofill_controller.mm
@@ -8,8 +8,8 @@
#import <string>
#import <vector>
+#import "base/apple/foundation_util.h"
#import "base/functional/callback.h"
-#import "base/mac/foundation_util.h"
#import "base/notreached.h"
#import "base/ranges/algorithm.h"
#import "base/strings/sys_string_conversions.h"
diff --git a/ios/web_view/internal/cwv_back_forward_list_item.mm b/ios/web_view/internal/cwv_back_forward_list_item.mm
index b78ba7e..9c65f8c 100644
--- a/ios/web_view/internal/cwv_back_forward_list_item.mm
+++ b/ios/web_view/internal/cwv_back_forward_list_item.mm
@@ -4,7 +4,7 @@
#import "ios/web_view/internal/cwv_back_forward_list_item_internal.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/web/public/navigation/navigation_item.h"
#import "net/base/mac/url_conversions.h"
@@ -36,7 +36,7 @@
}
return self.uniqueID ==
- base::mac::ObjCCastStrict<CWVBackForwardListItem>(other).uniqueID;
+ base::apple::ObjCCastStrict<CWVBackForwardListItem>(other).uniqueID;
}
- (NSUInteger)hash {
diff --git a/ios/web_view/internal/cwv_download_task.mm b/ios/web_view/internal/cwv_download_task.mm
index 641db19..3c4ece6 100644
--- a/ios/web_view/internal/cwv_download_task.mm
+++ b/ios/web_view/internal/cwv_download_task.mm
@@ -4,8 +4,8 @@
#import "ios/web_view/internal/cwv_download_task_internal.h"
+#import "base/apple/foundation_util.h"
#include "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
@@ -55,7 +55,7 @@
@synthesize delegate = _delegate;
- (NSString*)suggestedFileName {
- return base::mac::FilePathToNSString(_internalTask->GenerateFileName());
+ return base::apple::FilePathToNSString(_internalTask->GenerateFileName());
}
- (NSString*)MIMEType {
@@ -96,7 +96,7 @@
}
- (void)startDownloadToLocalFileAtPath:(NSString*)path {
- _internalTask->Start(base::mac::NSStringToFilePath(path));
+ _internalTask->Start(base::apple::NSStringToFilePath(path));
}
- (void)cancel {
diff --git a/ios/web_view/internal/cwv_user_content_controller.mm b/ios/web_view/internal/cwv_user_content_controller.mm
index 62caa533..cfcc4dc 100644
--- a/ios/web_view/internal/cwv_user_content_controller.mm
+++ b/ios/web_view/internal/cwv_user_content_controller.mm
@@ -5,8 +5,8 @@
#import "ios/web_view/public/cwv_user_content_controller.h"
#import "ios/web_view/internal/cwv_user_content_controller_internal.h"
+#import "base/apple/foundation_util.h"
#import "base/json/json_writer.h"
-#import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h"
#import "ios/web_view/internal/cwv_web_view_configuration_internal.h"
#include "ios/web_view/internal/web_view_browser_state.h"
@@ -23,7 +23,7 @@
DCHECK(success) << "Failed to convert base::Value to JSON";
NSData* json_data = [NSData dataWithBytes:json.c_str() length:json.length()];
- NSDictionary* ns_dictionary = base::mac::ObjCCastStrict<NSDictionary>(
+ NSDictionary* ns_dictionary = base::apple::ObjCCastStrict<NSDictionary>(
[NSJSONSerialization JSONObjectWithData:json_data
options:kNilOptions
error:nil]);
diff --git a/ios/web_view/internal/cwv_web_view.mm b/ios/web_view/internal/cwv_web_view.mm
index 8f6c3a6..b476306 100644
--- a/ios/web_view/internal/cwv_web_view.mm
+++ b/ios/web_view/internal/cwv_web_view.mm
@@ -10,9 +10,9 @@
#import <WebKit/WebKit.h>
+#include "base/apple/foundation_util.h"
#include "base/functional/bind.h"
#include "base/json/json_writer.h"
-#include "base/mac/foundation_util.h"
#import "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
#import "components/autofill/ios/browser/autofill_agent.h"
@@ -139,7 +139,7 @@
DCHECK(success) << "Failed to convert base::Value to JSON";
NSData* json_data = [NSData dataWithBytes:json.c_str() length:json.length()];
- NSDictionary* ns_dictionary = base::mac::ObjCCastStrict<NSDictionary>(
+ NSDictionary* ns_dictionary = base::apple::ObjCCastStrict<NSDictionary>(
[NSJSONSerialization JSONObjectWithData:json_data
options:kNilOptions
error:nil]);
@@ -308,10 +308,11 @@
// To support partial rollout and roll back of the feature, try to load
// the data from `coder` in either the legacy or optimised format. This
// also allow migrating the storage in-place.
- _cachedProtobufStorage = base::mac::ObjCCastStrict<CWVWebViewProtobufStorage>(
- [coder decodeObjectForKey:kProtobufStorageKey]);
+ _cachedProtobufStorage =
+ base::apple::ObjCCastStrict<CWVWebViewProtobufStorage>(
+ [coder decodeObjectForKey:kProtobufStorageKey]);
- _cachedSessionStorage = base::mac::ObjCCastStrict<CRWSessionStorage>(
+ _cachedSessionStorage = base::apple::ObjCCastStrict<CRWSessionStorage>(
[coder decodeObjectForKey:kSessionStorageKey]);
// If data can't be loaded in either format, return a brand new WebState.
diff --git a/ios/web_view/shell/test/earl_grey/web_view_shell_matchers.mm b/ios/web_view/shell/test/earl_grey/web_view_shell_matchers.mm
index 9a1d89aa..5d5f777 100644
--- a/ios/web_view/shell/test/earl_grey/web_view_shell_matchers.mm
+++ b/ios/web_view/shell/test/earl_grey/web_view_shell_matchers.mm
@@ -6,7 +6,7 @@
#import "ios/testing/earl_grey/earl_grey_test.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "ios/web_view/shell/shell_view_controller.h"
@@ -22,7 +22,7 @@
isEqualToString:kWebViewShellAddressFieldAccessibilityLabel]) {
return NO;
}
- UITextField* text_field = base::mac::ObjCCastStrict<UITextField>(view);
+ UITextField* text_field = base::apple::ObjCCastStrict<UITextField>(view);
NSString* error_message = [NSString
stringWithFormat:
@"Address field text did not match. expected: %@, actual: %@",
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
index dc193fb..2e7d75d 100644
--- a/media/audio/mac/audio_low_latency_input_mac.cc
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
@@ -9,12 +9,12 @@
#include <memory>
#include <string>
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/apple/scoped_mach_port.h"
#include "base/functional/bind.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
@@ -146,7 +146,7 @@
const CFIndex count = CFArrayGetCount(subdevices);
for (CFIndex i = 0; i != count; ++i) {
CFStringRef value =
- base::mac::CFCast<CFStringRef>(CFArrayGetValueAtIndex(subdevices, i));
+ base::apple::CFCast<CFStringRef>(CFArrayGetValueAtIndex(subdevices, i));
if (value) {
std::string uid = base::SysCFStringRefToUTF8(value);
output_subdevice_id = AudioManagerMac::GetAudioDeviceIdByUId(false, uid);
diff --git a/media/base/mac/color_space_util_mac.mm b/media/base/mac/color_space_util_mac.mm
index 22d374b7..d309f83 100644
--- a/media/base/mac/color_space_util_mac.mm
+++ b/media/base/mac/color_space_util_mac.mm
@@ -9,8 +9,8 @@
#include <simd/simd.h>
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/scoped_policy.h"
#include "base/no_destructor.h"
#include "third_party/skia/modules/skcms/skcms.h"
@@ -26,7 +26,7 @@
bool GetImageBufferProperty(CFTypeRef value_untyped,
const std::vector<StringIdPair>& cfstr_id_pairs,
IdType* value_as_id) {
- CFStringRef value_as_string = base::mac::CFCast<CFStringRef>(value_untyped);
+ CFStringRef value_as_string = base::apple::CFCast<CFStringRef>(value_untyped);
if (!value_as_string)
return false;
@@ -166,7 +166,7 @@
if (transfer_id != gfx::ColorSpace::TransferID::CUSTOM)
return transfer_id;
- CFNumberRef gamma_number = base::mac::CFCast<CFNumberRef>(gamma_untyped);
+ CFNumberRef gamma_number = base::apple::CFCast<CFNumberRef>(gamma_untyped);
if (!gamma_number) {
DLOG(ERROR) << "Failed to get gamma level.";
return gfx::ColorSpace::TransferID::INVALID;
diff --git a/media/capture/video/apple/video_capture_device_avfoundation.mm b/media/capture/video/apple/video_capture_device_avfoundation.mm
index ea941c037..2d422acda 100644
--- a/media/capture/video/apple/video_capture_device_avfoundation.mm
+++ b/media/capture/video/apple/video_capture_device_avfoundation.mm
@@ -11,9 +11,9 @@
#include <stdint.h>
#include <sstream>
+#include "base/apple/foundation_util.h"
#include "base/debug/dump_without_crashing.h"
#include "base/location.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.h"
@@ -1172,7 +1172,7 @@
}
- (void)onVideoError:(NSNotification*)errorNotification {
- NSError* error = base::mac::ObjCCast<NSError>(
+ NSError* error = base::apple::ObjCCast<NSError>(
errorNotification.userInfo[AVCaptureSessionErrorKey]);
[self
sendErrorString:[NSString stringWithFormat:@"%@: %@",
diff --git a/media/capture/video/mac/uvc_control_mac.mm b/media/capture/video/mac/uvc_control_mac.mm
index c506466..0e2b8d7b 100644
--- a/media/capture/video/mac/uvc_control_mac.mm
+++ b/media/capture/video/mac/uvc_control_mac.mm
@@ -7,10 +7,10 @@
#include <IOKit/IOCFPlugIn.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/containers/fixed_flat_map.h"
#include "base/feature_list.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_ioobject.h"
#include "base/strings/string_number_conversions.h"
diff --git a/media/gpu/mac/vt_config_util_unittest.cc b/media/gpu/mac/vt_config_util_unittest.cc
index 191e03f9..a9d3afd1 100644
--- a/media/gpu/mac/vt_config_util_unittest.cc
+++ b/media/gpu/mac/vt_config_util_unittest.cc
@@ -6,8 +6,8 @@
#include <CoreMedia/CoreMedia.h>
+#include "base/apple/foundation_util.h"
#include "base/containers/span.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/sys_string_conversions.h"
@@ -20,28 +20,29 @@
std::string GetStrValue(CFDictionaryRef dict, CFStringRef key) {
return base::SysCFStringRefToUTF8(
- base::mac::CFCastStrict<CFStringRef>(CFDictionaryGetValue(dict, key)));
+ base::apple::CFCastStrict<CFStringRef>(CFDictionaryGetValue(dict, key)));
}
CFStringRef GetCFStrValue(CFDictionaryRef dict, CFStringRef key) {
- return base::mac::CFCastStrict<CFStringRef>(CFDictionaryGetValue(dict, key));
+ return base::apple::CFCastStrict<CFStringRef>(
+ CFDictionaryGetValue(dict, key));
}
int GetIntValue(CFDictionaryRef dict, CFStringRef key) {
CFNumberRef value =
- base::mac::CFCastStrict<CFNumberRef>(CFDictionaryGetValue(dict, key));
+ base::apple::CFCastStrict<CFNumberRef>(CFDictionaryGetValue(dict, key));
int result;
return CFNumberGetValue(value, kCFNumberIntType, &result) ? result : -1;
}
bool GetBoolValue(CFDictionaryRef dict, CFStringRef key) {
return CFBooleanGetValue(
- base::mac::CFCastStrict<CFBooleanRef>(CFDictionaryGetValue(dict, key)));
+ base::apple::CFCastStrict<CFBooleanRef>(CFDictionaryGetValue(dict, key)));
}
base::span<const uint8_t> GetDataValue(CFDictionaryRef dict, CFStringRef key) {
CFDataRef data =
- base::mac::CFCastStrict<CFDataRef>(CFDictionaryGetValue(dict, key));
+ base::apple::CFCastStrict<CFDataRef>(CFDictionaryGetValue(dict, key));
return data ? base::span<const uint8_t>(
reinterpret_cast<const uint8_t*>(CFDataGetBytePtr(data)),
base::checked_cast<size_t>(CFDataGetLength(data)))
@@ -51,7 +52,7 @@
base::span<const uint8_t> GetNestedDataValue(CFDictionaryRef dict,
CFStringRef key1,
CFStringRef key2) {
- CFDictionaryRef nested_dict = base::mac::CFCastStrict<CFDictionaryRef>(
+ CFDictionaryRef nested_dict = base::apple::CFCastStrict<CFDictionaryRef>(
CFDictionaryGetValue(dict, key1));
return GetDataValue(nested_dict, key2);
}
diff --git a/media/gpu/mac/vt_video_encode_accelerator_mac.cc b/media/gpu/mac/vt_video_encode_accelerator_mac.cc
index 4444632..d7a8c46 100644
--- a/media/gpu/mac/vt_video_encode_accelerator_mac.cc
+++ b/media/gpu/mac/vt_video_encode_accelerator_mac.cc
@@ -6,10 +6,10 @@
#include <memory>
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/containers/contains.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/shared_memory_mapping.h"
#include "base/memory/unsafe_shared_memory_region.h"
@@ -664,8 +664,10 @@
const bool keyframe = !CFDictionaryContainsKey(
sample_attachments, kCMSampleAttachmentKey_NotSync);
bool belongs_to_base_layer = true;
- if (CFBooleanRef value_ptr = base::mac::GetValueFromDictionary<CFBooleanRef>(
- sample_attachments, kCMSampleAttachmentKey_IsDependedOnByOthers)) {
+ if (CFBooleanRef value_ptr =
+ base::apple::GetValueFromDictionary<CFBooleanRef>(
+ sample_attachments,
+ kCMSampleAttachmentKey_IsDependedOnByOthers)) {
belongs_to_base_layer = static_cast<bool>(CFBooleanGetValue(value_ptr));
}
diff --git a/mojo/public/cpp/platform/named_platform_channel_mac.cc b/mojo/public/cpp/platform/named_platform_channel_mac.cc
index b1505ac..ee71eb9 100644
--- a/mojo/public/cpp/platform/named_platform_channel_mac.cc
+++ b/mojo/public/cpp/platform/named_platform_channel_mac.cc
@@ -7,9 +7,9 @@
#include <mach/port.h>
#include <servers/bootstrap.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/mach_logging.h"
#include "base/apple/scoped_mach_port.h"
-#include "base/mac/foundation_util.h"
#include "base/rand_util.h"
#include "base/strings/stringprintf.h"
#include "mojo/public/cpp/platform/platform_channel.h"
@@ -20,7 +20,7 @@
std::string GetBootstrapName(const std::string& name) {
if (name.empty()) {
- return base::StringPrintf("%s.mojo.%llu", base::mac::BaseBundleID(),
+ return base::StringPrintf("%s.mojo.%llu", base::apple::BaseBundleID(),
base::RandUint64());
}
return name;
diff --git a/net/base/platform_mime_util_mac.mm b/net/base/platform_mime_util_mac.mm
index 459be5b..111c659 100644
--- a/net/base/platform_mime_util_mac.mm
+++ b/net/base/platform_mime_util_mac.mm
@@ -10,8 +10,8 @@
#include <string>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
#include "build/build_config.h"
@@ -175,7 +175,7 @@
if (types) {
for (CFIndex i = 0; i < CFArrayGetCount(types); i++) {
base::ScopedCFTypeRef<CFArrayRef> extensions_list(
- UTTypeCopyAllTagsWithClass(base::mac::CFCast<CFStringRef>(
+ UTTypeCopyAllTagsWithClass(base::apple::CFCast<CFStringRef>(
CFArrayGetValueAtIndex(types, i)),
kUTTagClassFilenameExtension));
if (!extensions_list) {
diff --git a/net/base/proxy_string_util_mac.cc b/net/base/proxy_string_util_mac.cc
index c41b52e..415c83f9 100644
--- a/net/base/proxy_string_util_mac.cc
+++ b/net/base/proxy_string_util_mac.cc
@@ -7,8 +7,8 @@
#include <CoreFoundation/CoreFoundation.h>
#include <string>
+#include "base/apple/foundation_util.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "net/base/host_port_pair.h"
#include "net/base/proxy_server.h"
@@ -26,7 +26,7 @@
}
CFStringRef host_ref =
- base::mac::GetValueFromDictionary<CFStringRef>(dict, host_key);
+ base::apple::GetValueFromDictionary<CFStringRef>(dict, host_key);
if (!host_ref) {
LOG(WARNING) << "Could not find expected key "
<< base::SysCFStringRefToUTF8(host_key)
@@ -36,7 +36,7 @@
std::string host = base::SysCFStringRefToUTF8(host_ref);
CFNumberRef port_ref =
- base::mac::GetValueFromDictionary<CFNumberRef>(dict, port_key);
+ base::apple::GetValueFromDictionary<CFNumberRef>(dict, port_key);
int port;
if (port_ref) {
CFNumberGetValue(port_ref, kCFNumberIntType, &port);
diff --git a/net/cert/cert_verify_proc_ios.cc b/net/cert/cert_verify_proc_ios.cc
index fc1c568..853b7b6 100644
--- a/net/cert/cert_verify_proc_ios.cc
+++ b/net/cert/cert_verify_proc_ios.cc
@@ -6,10 +6,10 @@
#include <CommonCrypto/CommonDigest.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/notreached.h"
#include "crypto/sha2.h"
#include "net/base/net_errors.h"
diff --git a/net/cert/internal/trust_store_mac.cc b/net/cert/internal/trust_store_mac.cc
index 2d31e5d1..f19f49e 100644
--- a/net/cert/internal/trust_store_mac.cc
+++ b/net/cert/internal/trust_store_mac.cc
@@ -6,6 +6,7 @@
#include <Security/Security.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/atomicops.h"
#include "base/callback_list.h"
@@ -13,7 +14,6 @@
#include "base/containers/flat_map.h"
#include "base/functional/bind.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
#include "base/numerics/safe_conversions.h"
@@ -126,7 +126,7 @@
// |target_policy_oid|. If there is no kSecTrustSettingsPolicy key, it's
// considered a match for all policies.
if (CFDictionaryContainsKey(trust_dict, kSecTrustSettingsPolicy)) {
- SecPolicyRef policy_ref = base::mac::GetValueFromDictionary<SecPolicyRef>(
+ SecPolicyRef policy_ref = base::apple::GetValueFromDictionary<SecPolicyRef>(
trust_dict, kSecTrustSettingsPolicy);
if (!policy_ref) {
*debug_info |= TrustStoreMac::TRUST_SETTINGS_DICT_INVALID_POLICY_TYPE;
@@ -136,7 +136,7 @@
SecPolicyCopyProperties(policy_ref));
// kSecPolicyOid is guaranteed to be present in the policy dictionary.
- CFStringRef policy_oid = base::mac::GetValueFromDictionary<CFStringRef>(
+ CFStringRef policy_oid = base::apple::GetValueFromDictionary<CFStringRef>(
policy_dict, kSecPolicyOid);
if (!CFEqual(policy_oid, target_policy_oid))
@@ -148,8 +148,8 @@
int trust_settings_result = kSecTrustSettingsResultTrustRoot;
if (CFDictionaryContainsKey(trust_dict, kSecTrustSettingsResult)) {
CFNumberRef trust_settings_result_ref =
- base::mac::GetValueFromDictionary<CFNumberRef>(trust_dict,
- kSecTrustSettingsResult);
+ base::apple::GetValueFromDictionary<CFNumberRef>(
+ trust_dict, kSecTrustSettingsResult);
if (!trust_settings_result_ref ||
!CFNumberGetValue(trust_settings_result_ref, kCFNumberIntType,
&trust_settings_result)) {
@@ -810,11 +810,11 @@
return;
}
CFArrayRef matching_items_array =
- base::mac::CFCastStrict<CFArrayRef>(matching_items);
+ base::apple::CFCastStrict<CFArrayRef>(matching_items);
for (CFIndex i = 0, item_count = CFArrayGetCount(matching_items_array);
i < item_count; ++i) {
SecCertificateRef match_cert_handle =
- base::mac::CFCastStrict<SecCertificateRef>(
+ base::apple::CFCastStrict<SecCertificateRef>(
CFArrayGetValueAtIndex(matching_items_array, i));
// If cert is already in the trust domain certs cache, don't bother
@@ -992,11 +992,11 @@
return;
}
CFArrayRef matching_items_array =
- base::mac::CFCastStrict<CFArrayRef>(matching_items);
+ base::apple::CFCastStrict<CFArrayRef>(matching_items);
std::vector<std::pair<SHA256HashValue, TrustStatus>> trust_status_vector;
for (CFIndex i = 0, item_count = CFArrayGetCount(matching_items_array);
i < item_count; ++i) {
- SecCertificateRef sec_cert = base::mac::CFCastStrict<SecCertificateRef>(
+ SecCertificateRef sec_cert = base::apple::CFCastStrict<SecCertificateRef>(
CFArrayGetValueAtIndex(matching_items_array, i));
base::ScopedCFTypeRef<CFDataRef> der_data(
diff --git a/net/proxy_resolution/proxy_config_service_ios.cc b/net/proxy_resolution/proxy_config_service_ios.cc
index 32fee3b..1547de7 100644
--- a/net/proxy_resolution/proxy_config_service_ios.cc
+++ b/net/proxy_resolution/proxy_config_service_ios.cc
@@ -7,8 +7,8 @@
#include <CoreFoundation/CoreFoundation.h>
#include <CFNetwork/CFProxySupport.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "net/base/proxy_server.h"
#include "net/base/proxy_string_util.h"
@@ -26,7 +26,7 @@
CFStringRef key,
bool default_value) {
CFNumberRef number =
- base::mac::GetValueFromDictionary<CFNumberRef>(dict, key);
+ base::apple::GetValueFromDictionary<CFNumberRef>(dict, key);
if (!number)
return default_value;
@@ -51,7 +51,7 @@
if (GetBoolFromDictionary(config_dict.get(),
kCFNetworkProxiesProxyAutoConfigEnable,
false)) {
- CFStringRef pac_url_ref = base::mac::GetValueFromDictionary<CFStringRef>(
+ CFStringRef pac_url_ref = base::apple::GetValueFromDictionary<CFStringRef>(
config_dict.get(), kCFNetworkProxiesProxyAutoConfigURLString);
if (pac_url_ref)
proxy_config.set_pac_url(GURL(base::SysCFStringRefToUTF8(pac_url_ref)));
diff --git a/net/proxy_resolution/proxy_config_service_mac.cc b/net/proxy_resolution/proxy_config_service_mac.cc
index bbe86f6..df67d961 100644
--- a/net/proxy_resolution/proxy_config_service_mac.cc
+++ b/net/proxy_resolution/proxy_config_service_mac.cc
@@ -9,10 +9,10 @@
#include <memory>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/functional/bind.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
@@ -30,8 +30,8 @@
bool GetBoolFromDictionary(CFDictionaryRef dict,
CFStringRef key,
bool default_value) {
- CFNumberRef number = base::mac::GetValueFromDictionary<CFNumberRef>(dict,
- key);
+ CFNumberRef number =
+ base::apple::GetValueFromDictionary<CFNumberRef>(dict, key);
if (!number)
return default_value;
@@ -63,7 +63,7 @@
if (GetBoolFromDictionary(config_dict.get(),
kSCPropNetProxiesProxyAutoConfigEnable,
false)) {
- CFStringRef pac_url_ref = base::mac::GetValueFromDictionary<CFStringRef>(
+ CFStringRef pac_url_ref = base::apple::GetValueFromDictionary<CFStringRef>(
config_dict.get(), kSCPropNetProxiesProxyAutoConfigURLString);
if (pac_url_ref)
proxy_config.set_pac_url(GURL(base::SysCFStringRefToUTF8(pac_url_ref)));
@@ -126,12 +126,12 @@
// proxy bypass list
- CFArrayRef bypass_array_ref = base::mac::GetValueFromDictionary<CFArrayRef>(
+ CFArrayRef bypass_array_ref = base::apple::GetValueFromDictionary<CFArrayRef>(
config_dict.get(), kSCPropNetProxiesExceptionsList);
if (bypass_array_ref) {
CFIndex bypass_array_count = CFArrayGetCount(bypass_array_ref);
for (CFIndex i = 0; i < bypass_array_count; ++i) {
- CFStringRef bypass_item_ref = base::mac::CFCast<CFStringRef>(
+ CFStringRef bypass_item_ref = base::apple::CFCast<CFStringRef>(
CFArrayGetValueAtIndex(bypass_array_ref, i));
if (!bypass_item_ref) {
LOG(WARNING) << "Expected value for item " << i
diff --git a/net/proxy_resolution/proxy_resolver_mac.cc b/net/proxy_resolution/proxy_resolver_mac.cc
index 659a8b3e0..45fcfda 100644
--- a/net/proxy_resolution/proxy_resolver_mac.cc
+++ b/net/proxy_resolution/proxy_resolver_mac.cc
@@ -8,10 +8,10 @@
#include <memory>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/check.h"
#include "base/lazy_instance.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/synchronization/lock.h"
@@ -320,15 +320,16 @@
return ERR_FAILED;
}
base::ScopedCFTypeRef<CFArrayRef> proxy_array_ref(
- base::mac::CFCastStrict<CFArrayRef>(result));
+ base::apple::CFCastStrict<CFArrayRef>(result));
DCHECK(proxy_array_ref != nullptr);
ProxyList proxy_list;
CFIndex proxy_array_count = CFArrayGetCount(proxy_array_ref.get());
for (CFIndex i = 0; i < proxy_array_count; ++i) {
- CFDictionaryRef proxy_dictionary = base::mac::CFCastStrict<CFDictionaryRef>(
- CFArrayGetValueAtIndex(proxy_array_ref.get(), i));
+ CFDictionaryRef proxy_dictionary =
+ base::apple::CFCastStrict<CFDictionaryRef>(
+ CFArrayGetValueAtIndex(proxy_array_ref.get(), i));
DCHECK(proxy_dictionary != nullptr);
// The dictionary may have the following keys:
@@ -345,7 +346,7 @@
// - kCFProxyAutoConfigurationURLKey : If the PAC file specifies another
// PAC file, I'm going home.
- CFStringRef proxy_type = base::mac::GetValueFromDictionary<CFStringRef>(
+ CFStringRef proxy_type = base::apple::GetValueFromDictionary<CFStringRef>(
proxy_dictionary, kCFProxyTypeKey);
ProxyServer proxy_server = ProxyDictionaryToProxyServer(
GetProxyServerScheme(proxy_type), proxy_dictionary, kCFProxyHostNameKey,
diff --git a/net/ssl/ssl_platform_key_mac.cc b/net/ssl/ssl_platform_key_mac.cc
index d77e5bd..81029fe 100644
--- a/net/ssl/ssl_platform_key_mac.cc
+++ b/net/ssl/ssl_platform_key_mac.cc
@@ -14,11 +14,11 @@
#include <utility>
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/containers/span.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/scoped_policy.h"
#include "base/numerics/safe_conversions.h"
diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm
index 21fd16be..fd057c4 100644
--- a/printing/printing_context_mac.mm
+++ b/printing/printing_context_mac.mm
@@ -13,9 +13,9 @@
#import <numeric>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/check.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/string_piece.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/remoting/host/desktop_resizer_mac.cc b/remoting/host/desktop_resizer_mac.cc
index 0910b0f..64f8966 100644
--- a/remoting/host/desktop_resizer_mac.cc
+++ b/remoting/host/desktop_resizer_mac.cc
@@ -7,8 +7,8 @@
#include <Carbon/Carbon.h>
#include <stdint.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/ptr_util.h"
#include "base/notreached.h"
diff --git a/remoting/host/file_transfer/file_chooser_mac.mm b/remoting/host/file_transfer/file_chooser_mac.mm
index 7f1b4b0..aba405ea 100644
--- a/remoting/host/file_transfer/file_chooser_mac.mm
+++ b/remoting/host/file_transfer/file_chooser_mac.mm
@@ -8,8 +8,8 @@
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/weak_ptr.h"
#import "base/task/sequenced_task_runner.h"
#include "base/task/sequenced_task_runner.h"
@@ -119,7 +119,7 @@
RunCallback(protocol::MakeFileTransferError(
FROM_HERE, protocol::FileTransfer_Error_Type_UNEXPECTED_ERROR));
}
- RunCallback(base::mac::NSStringToFilePath([url path]));
+ RunCallback(base::apple::NSStringToFilePath([url path]));
} else {
RunCallback(protocol::MakeFileTransferError(
FROM_HERE, protocol::FileTransfer_Error_Type_CANCELED));
diff --git a/remoting/host/mac/permission_utils.mm b/remoting/host/mac/permission_utils.mm
index 94dac61b..20bd8d8 100644
--- a/remoting/host/mac/permission_utils.mm
+++ b/remoting/host/mac/permission_utils.mm
@@ -7,11 +7,11 @@
#import <AVFoundation/AVFoundation.h>
#import <Cocoa/Cocoa.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/sys_string_conversions.h"
diff --git a/remoting/host/setup/daemon_controller_delegate_mac.mm b/remoting/host/setup/daemon_controller_delegate_mac.mm
index 03d12ea6..4040b8e 100644
--- a/remoting/host/setup/daemon_controller_delegate_mac.mm
+++ b/remoting/host/setup/daemon_controller_delegate_mac.mm
@@ -9,6 +9,7 @@
#include <utility>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
@@ -16,7 +17,6 @@
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/mac/authorization_util.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/launchd.h"
#include "base/mac/scoped_authorizationref.h"
#include "base/mac/scoped_launch_data.h"
diff --git a/rlz/mac/lib/machine_id_mac.cc b/rlz/mac/lib/machine_id_mac.cc
index bcb1bd0..9dc4845 100644
--- a/rlz/mac/lib/machine_id_mac.cc
+++ b/rlz/mac/lib/machine_id_mac.cc
@@ -12,8 +12,8 @@
#include <string>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_ioobject.h"
#include "base/strings/stringprintf.h"
@@ -77,7 +77,7 @@
CFSTR(kIOMACAddress),
kCFAllocatorDefault,
0));
- CFDataRef mac_data_data = base::mac::CFCast<CFDataRef>(mac_data);
+ CFDataRef mac_data_data = base::apple::CFCast<CFDataRef>(mac_data);
if (mac_data_data) {
CFDataGetBytes(
mac_data_data, CFRangeMake(0, kIOEthernetAddressSize), buffer);
diff --git a/rlz/mac/lib/rlz_value_store_mac.mm b/rlz/mac/lib/rlz_value_store_mac.mm
index ab11c01..908319c 100644
--- a/rlz/mac/lib/rlz_value_store_mac.mm
+++ b/rlz/mac/lib/rlz_value_store_mac.mm
@@ -8,9 +8,9 @@
#include <tuple>
+#include "base/apple/foundation_util.h"
#include "base/check.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
#include "rlz/lib/assert.h"
@@ -18,7 +18,7 @@
#include "rlz/lib/recursive_cross_process_lock_posix.h"
#include "rlz/lib/supplementary_branding.h"
-using base::mac::ObjCCast;
+using base::apple::ObjCCast;
namespace rlz_lib {
@@ -271,7 +271,7 @@
ScopedRlzValueStoreLock::ScopedRlzValueStoreLock() {
bool got_distributed_lock = g_recursive_lock.TryGetCrossProcessLock(
- base::mac::NSStringToFilePath(RlzLockFilename()));
+ base::apple::NSStringToFilePath(RlzLockFilename()));
// At this point, we hold the in-process lock, no matter the value of
// |got_distributed_lock|.
@@ -352,7 +352,7 @@
if (directory.empty()) {
g_test_folder = nil;
} else {
- g_test_folder = base::mac::FilePathToNSString(directory);
+ g_test_folder = base::apple::FilePathToNSString(directory);
}
}
}
diff --git a/services/device/battery/battery_status_manager_mac.cc b/services/device/battery/battery_status_manager_mac.cc
index 585c193..f6e7129 100644
--- a/services/device/battery/battery_status_manager_mac.cc
+++ b/services/device/battery/battery_status_manager_mac.cc
@@ -11,8 +11,8 @@
#include <memory>
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/time/time.h"
namespace device {
@@ -28,7 +28,7 @@
CFStringRef key,
SInt64 default_value) {
CFNumberRef number =
- base::mac::GetValueFromDictionary<CFNumberRef>(description, key);
+ base::apple::GetValueFromDictionary<CFNumberRef>(description, key);
SInt64 value;
if (number && CFNumberGetValue(number, kCFNumberSInt64Type, &value))
@@ -41,7 +41,7 @@
CFStringRef key,
bool default_value) {
CFBooleanRef boolean =
- base::mac::GetValueFromDictionary<CFBooleanRef>(description, key);
+ base::apple::GetValueFromDictionary<CFBooleanRef>(description, key);
return boolean ? CFBooleanGetValue(boolean) : default_value;
}
@@ -54,7 +54,7 @@
void FetchBatteryStatus(CFDictionaryRef description,
mojom::BatteryStatus* status) {
- CFStringRef current_state = base::mac::GetValueFromDictionary<CFStringRef>(
+ CFStringRef current_state = base::apple::GetValueFromDictionary<CFStringRef>(
description, CFSTR(kIOPSPowerSourceStateKey));
bool on_battery_power =
@@ -121,8 +121,9 @@
if (!description)
continue;
- CFStringRef transport_type = base::mac::GetValueFromDictionary<CFStringRef>(
- description, CFSTR(kIOPSTransportTypeKey));
+ CFStringRef transport_type =
+ base::apple::GetValueFromDictionary<CFStringRef>(
+ description, CFSTR(kIOPSTransportTypeKey));
bool internal_source =
CFStringsAreEqual(transport_type, CFSTR(kIOPSInternalType));
diff --git a/services/device/hid/hid_connection_mac.cc b/services/device/hid/hid_connection_mac.cc
index 9951c88..5f88d2d 100644
--- a/services/device/hid/hid_connection_mac.cc
+++ b/services/device/hid/hid_connection_mac.cc
@@ -4,9 +4,9 @@
#include "services/device/hid/hid_connection_mac.h"
+#include "base/apple/foundation_util.h"
#include "base/functional/bind.h"
#include "base/location.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/ref_counted_memory.h"
#include "base/numerics/safe_math.h"
#include "base/strings/stringprintf.h"
diff --git a/services/device/hid/hid_connection_mac.h b/services/device/hid/hid_connection_mac.h
index 005479f..2f572a9 100644
--- a/services/device/hid/hid_connection_mac.h
+++ b/services/device/hid/hid_connection_mac.h
@@ -10,8 +10,8 @@
#include <stddef.h>
#include <stdint.h>
+#include "base/apple/foundation_util.h"
#include "base/containers/queue.h"
-#include "base/mac/foundation_util.h"
#include "services/device/hid/hid_connection.h"
namespace base {
diff --git a/services/device/hid/hid_service_mac.cc b/services/device/hid/hid_service_mac.cc
index f9408ebf..ee25b7ea 100644
--- a/services/device/hid/hid_service_mac.cc
+++ b/services/device/hid/hid_service_mac.cc
@@ -11,10 +11,10 @@
#include <string>
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/sys_string_conversions.h"
@@ -31,7 +31,7 @@
bool TryGetHidDataProperty(io_service_t service,
CFStringRef key,
std::vector<uint8_t>* result) {
- base::ScopedCFTypeRef<CFDataRef> ref(base::mac::CFCast<CFDataRef>(
+ base::ScopedCFTypeRef<CFDataRef> ref(base::apple::CFCast<CFDataRef>(
IORegistryEntryCreateCFProperty(service, key, kCFAllocatorDefault, 0)));
if (!ref)
return false;
diff --git a/services/device/hid/hid_service_mac.h b/services/device/hid/hid_service_mac.h
index 160ca67bf..358fdd8 100644
--- a/services/device/hid/hid_service_mac.h
+++ b/services/device/hid/hid_service_mac.h
@@ -11,7 +11,7 @@
#include <string>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/mac/scoped_ionotificationportref.h"
#include "base/mac/scoped_ioobject.h"
#include "base/memory/scoped_refptr.h"
diff --git a/services/device/usb/usb_device_mac.cc b/services/device/usb/usb_device_mac.cc
index 54e916f..6b21fc7 100644
--- a/services/device/usb/usb_device_mac.cc
+++ b/services/device/usb/usb_device_mac.cc
@@ -11,7 +11,7 @@
#include <utility>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/mac/scoped_ionotificationportref.h"
#include "base/mac/scoped_ioobject.h"
#include "base/mac/scoped_ioplugininterface.h"
diff --git a/services/device/usb/usb_service_mac.cc b/services/device/usb/usb_service_mac.cc
index 1cbf585..eb48fa5 100644
--- a/services/device/usb/usb_service_mac.cc
+++ b/services/device/usb/usb_service_mac.cc
@@ -14,7 +14,7 @@
#include <utility>
#include <vector>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/mac/scoped_ioplugininterface.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/services/device/usb/usb_service_mac.h b/services/device/usb/usb_service_mac.h
index d01f198..1b17758 100644
--- a/services/device/usb/usb_service_mac.h
+++ b/services/device/usb/usb_service_mac.h
@@ -11,7 +11,7 @@
#include <unordered_map>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/mac/scoped_ionotificationportref.h"
#include "base/mac/scoped_ioobject.h"
#include "base/memory/weak_ptr.h"
diff --git a/services/device/utils/mac_utils.h b/services/device/utils/mac_utils.h
index 7df3521..db17d01 100644
--- a/services/device/utils/mac_utils.h
+++ b/services/device/utils/mac_utils.h
@@ -5,7 +5,7 @@
#ifndef SERVICES_DEVICE_UTILS_MAC_UTILS_H_
#define SERVICES_DEVICE_UTILS_MAC_UTILS_H_
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
@@ -22,7 +22,7 @@
"Unsupported template type");
base::ScopedCFTypeRef<CFNumberRef> cf_number(
- base::mac::CFCast<CFNumberRef>(IORegistryEntryCreateCFProperty(
+ base::apple::CFCast<CFNumberRef>(IORegistryEntryCreateCFProperty(
service, property, kCFAllocatorDefault, 0)));
if (!cf_number)
@@ -57,7 +57,7 @@
"Unsupported template type");
base::ScopedCFTypeRef<CFStringRef> ref(
- base::mac::CFCast<CFStringRef>(IORegistryEntryCreateCFProperty(
+ base::apple::CFCast<CFStringRef>(IORegistryEntryCreateCFProperty(
service, property, kCFAllocatorDefault, 0)));
if (!ref)
diff --git a/services/preferences/tracked/device_id_mac.cc b/services/preferences/tracked/device_id_mac.cc
index 3610564d..0a60fb6 100644
--- a/services/preferences/tracked/device_id_mac.cc
+++ b/services/preferences/tracked/device_id_mac.cc
@@ -6,8 +6,8 @@
#include <IOKit/IOKitLib.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/scoped_ioobject.h"
#include "base/strings/sys_string_conversions.h"
@@ -23,7 +23,7 @@
if (!uuid.get())
return MachineIdStatus::FAILURE;
- CFStringRef uuid_string = base::mac::CFCast<CFStringRef>(uuid);
+ CFStringRef uuid_string = base::apple::CFCast<CFStringRef>(uuid);
if (!uuid_string)
return MachineIdStatus::FAILURE;
diff --git a/services/shape_detection/detection_utils_mac.mm b/services/shape_detection/detection_utils_mac.mm
index 99f53a1..135ac19 100644
--- a/services/shape_detection/detection_utils_mac.mm
+++ b/services/shape_detection/detection_utils_mac.mm
@@ -8,10 +8,10 @@
#include <vector>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/functional/bind.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/ptr_util.h"
#include "base/numerics/checked_math.h"
#include "base/strings/sys_string_conversions.h"
@@ -85,7 +85,7 @@
// Pass symbology hints to request. Only valid for VNDetectBarcodesRequest.
if ([symbology_hints count] > 0) {
VNDetectBarcodesRequest* barcode_request =
- base::mac::ObjCCastStrict<VNDetectBarcodesRequest>(request_);
+ base::apple::ObjCCastStrict<VNDetectBarcodesRequest>(request_);
barcode_request.symbologies = symbology_hints;
}
}
diff --git a/skia/ext/skia_utils_mac_unittest.mm b/skia/ext/skia_utils_mac_unittest.mm
index 77731de..1470ba6 100644
--- a/skia/ext/skia_utils_mac_unittest.mm
+++ b/skia/ext/skia_utils_mac_unittest.mm
@@ -6,7 +6,7 @@
#import <AppKit/AppKit.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/mac/mac_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkColorSpace.h"
@@ -163,7 +163,7 @@
EXPECT_TRUE(image.representations.count == 1);
EXPECT_TRUE([image.representations.lastObject
isKindOfClass:[NSBitmapImageRep class]]);
- TestImageRep(base::mac::ObjCCastStrict<NSBitmapImageRep>(
+ TestImageRep(base::apple::ObjCCastStrict<NSBitmapImageRep>(
image.representations.lastObject),
test_color);
}
@@ -200,7 +200,7 @@
NSImage* image = CreateNSImage(width, height);
EXPECT_EQ(1u, image.representations.count);
- NSBitmapImageRep* imageRep = base::mac::ObjCCastStrict<NSBitmapImageRep>(
+ NSBitmapImageRep* imageRep = base::apple::ObjCCastStrict<NSBitmapImageRep>(
image.representations.lastObject);
SkBitmap bitmap(skia::NSImageRepToSkBitmapWithColorSpace(
imageRep, image.size, false, base::mac::GetSRGBColorSpace()));
diff --git a/skia/ext/test_fonts_mac.mm b/skia/ext/test_fonts_mac.mm
index c6a6181..a752bc1 100644
--- a/skia/ext/test_fonts_mac.mm
+++ b/skia/ext/test_fonts_mac.mm
@@ -8,9 +8,9 @@
#include <Foundation/Foundation.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
namespace skia {
@@ -21,8 +21,8 @@
NSMutableArray* font_urls = [NSMutableArray array];
for (auto* font_file_name : kFontFileNames) {
- NSURL* font_url = base::mac::FilePathToNSURL(
- base::mac::PathForFrameworkBundleResource(font_file_name));
+ NSURL* font_url = base::apple::FilePathToNSURL(
+ base::apple::PathForFrameworkBundleResource(font_file_name));
[font_urls addObject:font_url.absoluteURL];
}
diff --git a/third_party/blink/renderer/core/DEPS b/third_party/blink/renderer/core/DEPS
index fc0ca43f..6aa37450 100644
--- a/third_party/blink/renderer/core/DEPS
+++ b/third_party/blink/renderer/core/DEPS
@@ -7,7 +7,7 @@
"+base/memory/values_equivalent.h",
"+base/files/file.h",
"+base/files/file_path.h",
- "+base/mac/foundation_util.h",
+ "+base/apple/foundation_util.h",
"+base/memory/scoped_refptr.h",
"+base/profiler/sample_metadata.h",
"+base/strings/stringprintf.h",
diff --git a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
index 0a8ebe8..fe7f19e 100644
--- a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
+++ b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
@@ -74,7 +74,7 @@
#include "third_party/blink/renderer/platform/widget/frame_widget.h"
#if BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "third_party/blink/renderer/core/editing/substring_util.h"
#include "third_party/blink/renderer/platform/fonts/mac/attributed_string_type_converter.h"
#include "ui/base/mojom/attributed_string.mojom-blink.h"
diff --git a/third_party/blink/renderer/platform/fonts/mac/attributed_string_type_converter.mm b/third_party/blink/renderer/platform/fonts/mac/attributed_string_type_converter.mm
index 0f8d2a2..04850e6 100644
--- a/third_party/blink/renderer/platform/fonts/mac/attributed_string_type_converter.mm
+++ b/third_party/blink/renderer/platform/fonts/mac/attributed_string_type_converter.mm
@@ -7,7 +7,7 @@
#include <AppKit/AppKit.h>
#include "base/apple/bridging.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "ui/gfx/range/range.h"
diff --git a/third_party/blink/renderer/platform/fonts/mac/font_matcher_mac.mm b/third_party/blink/renderer/platform/fonts/mac/font_matcher_mac.mm
index 504c3df..7f69c26 100644
--- a/third_party/blink/renderer/platform/fonts/mac/font_matcher_mac.mm
+++ b/third_party/blink/renderer/platform/fonts/mac/font_matcher_mac.mm
@@ -34,8 +34,8 @@
#import <math.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
#import "third_party/blink/renderer/platform/wtf/hash_set.h"
#import "third_party/blink/renderer/platform/wtf/text/atomic_string_hash.h"
diff --git a/third_party/blink/renderer/platform/fonts/mac/font_platform_data_mac.mm b/third_party/blink/renderer/platform/fonts/mac/font_platform_data_mac.mm
index d4f5162..5ec9feb 100644
--- a/third_party/blink/renderer/platform/fonts/mac/font_platform_data_mac.mm
+++ b/third_party/blink/renderer/platform/fonts/mac/font_platform_data_mac.mm
@@ -27,7 +27,7 @@
#import <AvailabilityMacros.h>
#include "base/apple/bridging.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#include "third_party/blink/renderer/platform/fonts/font.h"
#include "third_party/blink/renderer/platform/fonts/font_platform_data.h"
#include "third_party/blink/renderer/platform/fonts/opentype/font_settings.h"
diff --git a/third_party/blink/renderer/platform/fonts/mac/font_platform_data_mac_test.mm b/third_party/blink/renderer/platform/fonts/mac/font_platform_data_mac_test.mm
index 62651d6..14ef1119 100644
--- a/third_party/blink/renderer/platform/fonts/mac/font_platform_data_mac_test.mm
+++ b/third_party/blink/renderer/platform/fonts/mac/font_platform_data_mac_test.mm
@@ -5,7 +5,7 @@
#include "third_party/blink/renderer/platform/fonts/mac/font_platform_data_mac.h"
#include "base/apple/bridging.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/font_family_names.h"
#include "third_party/blink/renderer/platform/fonts/mac/font_matcher_mac.h"
diff --git a/third_party/blink/renderer/platform/wtf/DEPS b/third_party/blink/renderer/platform/wtf/DEPS
index b69a194..0d49912 100644
--- a/third_party/blink/renderer/platform/wtf/DEPS
+++ b/third_party/blink/renderer/platform/wtf/DEPS
@@ -9,7 +9,7 @@
"+base/compiler_specific.h",
"+base/functional/bind.h",
"+base/logging.h",
- "+base/mac/foundation_util.h",
+ "+base/apple/foundation_util.h",
"+base/memory/ptr_util.h",
"+base/memory/ref_counted.h",
"+base/memory/weak_ptr.h",
diff --git a/tools/mac/power/power_sampler/battery_sampler.mm b/tools/mac/power/power_sampler/battery_sampler.mm
index 6365321..4078459 100644
--- a/tools/mac/power/power_sampler/battery_sampler.mm
+++ b/tools/mac/power/power_sampler/battery_sampler.mm
@@ -9,10 +9,10 @@
#include <IOKit/ps/IOPSKeys.h>
#include <cstdint>
+#include "base/apple/foundation_util.h"
#include "base/apple/mach_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/scoped_ioobject.h"
#include "base/memory/ptr_util.h"
#include "base/time/time.h"
@@ -26,7 +26,7 @@
absl::optional<SInt64> GetValueAsSInt64(CFDictionaryRef description,
CFStringRef key) {
CFNumberRef number_ref =
- base::mac::GetValueFromDictionary<CFNumberRef>(description, key);
+ base::apple::GetValueFromDictionary<CFNumberRef>(description, key);
SInt64 value;
if (number_ref && CFNumberGetValue(number_ref, kCFNumberSInt64Type, &value))
@@ -38,7 +38,7 @@
absl::optional<bool> GetValueAsBoolean(CFDictionaryRef description,
CFStringRef key) {
CFBooleanRef boolean =
- base::mac::GetValueFromDictionary<CFBooleanRef>(description, key);
+ base::apple::GetValueFromDictionary<CFBooleanRef>(description, key);
if (!boolean)
return absl::nullopt;
return CFBooleanGetValue(boolean);
diff --git a/ui/accelerated_widget_mac/ca_renderer_layer_tree.mm b/ui/accelerated_widget_mac/ca_renderer_layer_tree.mm
index d0e01f6..4767f09 100644
--- a/ui/accelerated_widget_mac/ca_renderer_layer_tree.mm
+++ b/ui/accelerated_widget_mac/ca_renderer_layer_tree.mm
@@ -12,10 +12,10 @@
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/command_line.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/sys_string_conversions.h"
#include "base/trace_event/trace_event.h"
diff --git a/ui/accessibility/platform/ax_platform_node_cocoa.mm b/ui/accessibility/platform/ax_platform_node_cocoa.mm
index b875e84..a367ba3 100644
--- a/ui/accessibility/platform/ax_platform_node_cocoa.mm
+++ b/ui/accessibility/platform/ax_platform_node_cocoa.mm
@@ -7,8 +7,8 @@
#import <Cocoa/Cocoa.h>
#include <Foundation/Foundation.h>
+#include "base/apple/foundation_util.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/no_destructor.h"
@@ -1362,15 +1362,16 @@
if ([attribute isEqualToString:NSAccessibilityValueAttribute]) {
[self setAccessibilityValue:value];
} else if ([attribute isEqualToString:NSAccessibilitySelectedTextAttribute]) {
- [self setAccessibilitySelectedText:base::mac::ObjCCastStrict<NSString>(
+ [self setAccessibilitySelectedText:base::apple::ObjCCastStrict<NSString>(
value)];
} else if ([attribute
isEqualToString:NSAccessibilitySelectedTextRangeAttribute]) {
- [self setAccessibilitySelectedTextRange:base::mac::ObjCCastStrict<NSValue>(
- value)
- .rangeValue];
+ [self
+ setAccessibilitySelectedTextRange:base::apple::ObjCCastStrict<NSValue>(
+ value)
+ .rangeValue];
} else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) {
- [self setAccessibilityFocused:base::mac::ObjCCastStrict<NSNumber>(value)
+ [self setAccessibilityFocused:base::apple::ObjCCastStrict<NSNumber>(value)
.boolValue];
}
}
diff --git a/ui/accessibility/platform/inspect/ax_event_recorder_mac.mm b/ui/accessibility/platform/inspect/ax_event_recorder_mac.mm
index 3d1ab90..9df34057 100644
--- a/ui/accessibility/platform/inspect/ax_event_recorder_mac.mm
+++ b/ui/accessibility/platform/inspect/ax_event_recorder_mac.mm
@@ -10,9 +10,9 @@
#include <string>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"
@@ -162,7 +162,7 @@
NSDictionary* ns_user_info = base::apple::CFToNSPtrCast(user_info);
std::vector<std::string> serialized_info;
for (NSString* key in ns_user_info) {
- NSNumber* value = base::mac::ObjCCast<NSNumber>(ns_user_info[key]);
+ NSNumber* value = base::apple::ObjCCast<NSNumber>(ns_user_info[key]);
std::string value_string;
if ([key isEqual:NSAccessibilityTextStateChangeTypeKey]) {
value_string =
diff --git a/ui/accessibility/platform/inspect/ax_inspect_utils_mac.mm b/ui/accessibility/platform/inspect/ax_inspect_utils_mac.mm
index f01acbc..64086279 100644
--- a/ui/accessibility/platform/inspect/ax_inspect_utils_mac.mm
+++ b/ui/accessibility/platform/inspect/ax_inspect_utils_mac.mm
@@ -9,11 +9,11 @@
#include <ostream>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/containers/fixed_flat_set.h"
#include "base/debug/stack_trace.h"
#include "base/functional/callback.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/scoped_policy.h"
#include "base/strings/pattern.h"
#include "base/strings/sys_string_conversions.h"
@@ -146,10 +146,10 @@
kCGNullWindowID));
for (NSDictionary* window_info in windows) {
- int pid = base::mac::ObjCCast<NSNumber>(window_info[@"kCGWindowOwnerPID"])
+ int pid = base::apple::ObjCCast<NSNumber>(window_info[@"kCGWindowOwnerPID"])
.intValue;
std::string window_name = base::SysNSStringToUTF8(
- base::mac::ObjCCast<NSString>(window_info[@"kCGWindowOwnerName"]));
+ base::apple::ObjCCast<NSString>(window_info[@"kCGWindowOwnerName"]));
base::ScopedCFTypeRef<AXUIElementRef> node;
diff --git a/ui/accessibility/platform/inspect/ax_transform_mac.mm b/ui/accessibility/platform/inspect/ax_transform_mac.mm
index 701b592..c737a2ca1 100644
--- a/ui/accessibility/platform/inspect/ax_transform_mac.mm
+++ b/ui/accessibility/platform/inspect/ax_transform_mac.mm
@@ -4,7 +4,7 @@
#include "ui/accessibility/platform/inspect/ax_transform_mac.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "ui/accessibility/ax_range.h"
#include "ui/accessibility/platform/ax_platform_node.h"
@@ -31,30 +31,30 @@
}
// NSArray
- if (NSArray* array = base::mac::ObjCCast<NSArray>(value)) {
+ if (NSArray* array = base::apple::ObjCCast<NSArray>(value)) {
return base::Value(AXNSArrayToBaseValue(value, indexer));
}
// AXCustomContent
if (@available(macOS 11.0, *)) {
if (AXCustomContent* custom_content =
- base::mac::ObjCCast<AXCustomContent>(value)) {
+ base::apple::ObjCCast<AXCustomContent>(value)) {
return base::Value(AXCustomContentToBaseValue(custom_content));
}
}
// NSDictionary
- if (NSDictionary* dictionary = base::mac::ObjCCast<NSDictionary>(value)) {
+ if (NSDictionary* dictionary = base::apple::ObjCCast<NSDictionary>(value)) {
return base::Value(AXNSDictionaryToBaseValue(dictionary, indexer));
}
// NSNumber
- if (NSNumber* number = base::mac::ObjCCast<NSNumber>(value)) {
+ if (NSNumber* number = base::apple::ObjCCast<NSNumber>(value)) {
return base::Value(number.intValue);
}
// NSRange, NSSize
- if (NSValue* ns_value = base::mac::ObjCCast<NSValue>(value)) {
+ if (NSValue* ns_value = base::apple::ObjCCast<NSValue>(value)) {
if (0 == strcmp(ns_value.objCType, @encode(NSRange))) {
return base::Value(AXNSRangeToBaseValue(ns_value.rangeValue));
}
@@ -65,7 +65,7 @@
// NSAttributedString
if (NSAttributedString* attr_string =
- base::mac::ObjCCast<NSAttributedString>(value)) {
+ base::apple::ObjCCast<NSAttributedString>(value)) {
return NSAttributedStringToBaseValue(attr_string, indexer);
}
diff --git a/ui/base/clipboard/clipboard_format_type_mac.mm b/ui/base/clipboard/clipboard_format_type_mac.mm
index 2bcdf73..0120492 100644
--- a/ui/base/clipboard/clipboard_format_type_mac.mm
+++ b/ui/base/clipboard/clipboard_format_type_mac.mm
@@ -9,7 +9,7 @@
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h> // macOS 11
#include "base/apple/bridging.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/no_destructor.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
diff --git a/ui/base/clipboard/clipboard_ios.mm b/ui/base/clipboard/clipboard_ios.mm
index e255717..71038ee 100644
--- a/ui/base/clipboard/clipboard_ios.mm
+++ b/ui/base/clipboard/clipboard_ios.mm
@@ -6,7 +6,7 @@
#import <UIKit/UIKit.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "skia/ext/skia_utils_base.h"
@@ -293,8 +293,8 @@
encoding:NSUTF8StringEncoding];
NSURL* file_url = [NSURL URLWithString:file_str];
files.emplace_back(
- base::mac::NSURLToFilePath(file_url),
- base::mac::NSStringToFilePath(file_url.lastPathComponent));
+ base::apple::NSURLToFilePath(file_url),
+ base::apple::NSStringToFilePath(file_url.lastPathComponent));
}
}
base::ranges::move(files, std::back_inserter(*result));
@@ -405,7 +405,7 @@
NSMutableArray<NSDictionary<NSString*, id>*>* items =
[NSMutableArray arrayWithCapacity:filenames.size()];
for (const auto& file : filenames) {
- NSURL* url = base::mac::FilePathToNSURL(file.path);
+ NSURL* url = base::apple::FilePathToNSURL(file.path);
NSString* fileURLType = ClipboardFormatType::FilenamesType().ToNSString();
NSDictionary<NSString*, id>* item = @{fileURLType : url.absoluteString};
[items addObject:item];
diff --git a/ui/base/clipboard/clipboard_mac.h b/ui/base/clipboard/clipboard_mac.h
index df594ed2..575b9384 100644
--- a/ui/base/clipboard/clipboard_mac.h
+++ b/ui/base/clipboard/clipboard_mac.h
@@ -8,9 +8,9 @@
#include <stddef.h>
#include <stdint.h>
+#include "base/apple/foundation_util.h"
#include "base/component_export.h"
#include "base/gtest_prod_util.h"
-#include "base/mac/foundation_util.h"
#include "ui/base/clipboard/clipboard.h"
@class NSPasteboard;
diff --git a/ui/base/clipboard/clipboard_mac.mm b/ui/base/clipboard/clipboard_mac.mm
index 7d1b4c1..7cae355 100644
--- a/ui/base/clipboard/clipboard_mac.mm
+++ b/ui/base/clipboard/clipboard_mac.mm
@@ -9,11 +9,11 @@
#include <limits>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/ref_counted_memory.h"
#include "base/notreached.h"
diff --git a/ui/base/clipboard/clipboard_util_mac.mm b/ui/base/clipboard/clipboard_util_mac.mm
index c951793..bf87f5a 100644
--- a/ui/base/clipboard/clipboard_util_mac.mm
+++ b/ui/base/clipboard/clipboard_util_mac.mm
@@ -11,8 +11,8 @@
#include <string>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
-#include "base/mac/foundation_util.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
#include "ui/base/clipboard/clipboard_constants.h"
@@ -50,7 +50,7 @@
// Reads the "WebKitWebURLsWithTitles" type put onto the pasteboard by Safari
// and returns the URLs/titles found within.
NSArray<URLAndTitle*>* ReadWebURLsWithTitlesPboardType(NSPasteboard* pboard) {
- NSArray* bookmark_pairs = base::mac::ObjCCast<NSArray>(
+ NSArray* bookmark_pairs = base::apple::ObjCCast<NSArray>(
[pboard propertyListForType:kUTTypeWebKitWebURLsWithTitles]);
if (!bookmark_pairs) {
return [NSArray array];
@@ -60,9 +60,9 @@
}
NSArray<NSString*>* urls_array =
- base::mac::ObjCCast<NSArray>(bookmark_pairs[0]);
+ base::apple::ObjCCast<NSArray>(bookmark_pairs[0]);
NSArray<NSString*>* titles_array =
- base::mac::ObjCCast<NSArray>(bookmark_pairs[1]);
+ base::apple::ObjCCast<NSArray>(bookmark_pairs[1]);
if (!urls_array || !titles_array) {
return [NSArray array];
@@ -429,8 +429,8 @@
// filename because deep in Blink it's used to determine the file's type.
// See https://crbug.com/1412205.
results.emplace_back(
- base::mac::NSURLToFilePath(file_url),
- base::mac::NSStringToFilePath(file_url.lastPathComponent));
+ base::apple::NSURLToFilePath(file_url),
+ base::apple::NSStringToFilePath(file_url.lastPathComponent));
}
return results;
@@ -445,7 +445,7 @@
NSMutableArray<NSPasteboardItem*>* items =
[NSMutableArray arrayWithCapacity:files.size()];
for (const auto& file : files) {
- NSURL* url = base::mac::FilePathToNSURL(file.path);
+ NSURL* url = base::apple::FilePathToNSURL(file.path);
NSPasteboardItem* item = [[NSPasteboardItem alloc] init];
[item setString:url.absoluteString forType:NSPasteboardTypeFileURL];
[items addObject:item];
diff --git a/ui/base/cocoa/constrained_window/constrained_window_animation.mm b/ui/base/cocoa/constrained_window/constrained_window_animation.mm
index a52da16..cf45bec 100644
--- a/ui/base/cocoa/constrained_window/constrained_window_animation.mm
+++ b/ui/base/cocoa/constrained_window/constrained_window_animation.mm
@@ -7,9 +7,9 @@
#include <stdint.h>
#include <stdlib.h>
+#import "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/location.h"
-#import "base/mac/foundation_util.h"
#include "base/native_library.h"
#include "base/notreached.h"
#include "ui/gfx/animation/tween.h"
diff --git a/ui/base/cocoa/menu_controller.mm b/ui/base/cocoa/menu_controller.mm
index 988bc97..a75c8fd2 100644
--- a/ui/base/cocoa/menu_controller.mm
+++ b/ui/base/cocoa/menu_controller.mm
@@ -5,10 +5,10 @@
#import "ui/base/cocoa/menu_controller.h"
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/owned_objc.h"
#include "base/check_op.h"
#include "base/functional/bind.h"
-#include "base/mac/foundation_util.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/sys_string_conversions.h"
#include "ui/base/accelerators/accelerator.h"
@@ -66,7 +66,7 @@
}
+ (ui::MenuModel*)getFrom:(id)instance {
- return [base::mac::ObjCCastStrict<WeakPtrToMenuModelAsNSObject>(instance)
+ return [base::apple::ObjCCastStrict<WeakPtrToMenuModelAsNSObject>(instance)
menuModel];
}
@@ -276,7 +276,7 @@
}
- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item {
- NSMenuItem* menuItem = base::mac::ObjCCastStrict<NSMenuItem>(item);
+ NSMenuItem* menuItem = base::apple::ObjCCastStrict<NSMenuItem>(item);
SEL action = menuItem.action;
if (action != @selector(itemSelected:))
@@ -314,7 +314,7 @@
}
- (void)itemSelected:(id)sender {
- NSMenuItem* menuItem = base::mac::ObjCCastStrict<NSMenuItem>(sender);
+ NSMenuItem* menuItem = base::apple::ObjCCastStrict<NSMenuItem>(sender);
ui::MenuModel* model =
[WeakPtrToMenuModelAsNSObject getFrom:menuItem.representedObject];
diff --git a/ui/base/cocoa/nsmenuitem_additions.mm b/ui/base/cocoa/nsmenuitem_additions.mm
index 3d6df02..ddfe5546 100644
--- a/ui/base/cocoa/nsmenuitem_additions.mm
+++ b/ui/base/cocoa/nsmenuitem_additions.mm
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#import "ui/base/cocoa/nsmenuitem_additions.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include <Carbon/Carbon.h>
@@ -107,7 +107,7 @@
base::ScopedCFTypeRef<TISInputSourceRef> inputSource(
TISCopyCurrentKeyboardInputSource());
NSString* layoutId = base::apple::CFToNSPtrCast(
- base::mac::CFCast<CFStringRef>(TISGetInputSourceProperty(
+ base::apple::CFCast<CFStringRef>(TISGetInputSourceProperty(
inputSource.get(), kTISPropertyInputSourceID)));
ui::cocoa::g_is_input_source_command_qwerty =
ui::cocoa::IsKeyboardLayoutCommandQwerty(layoutId);
diff --git a/ui/base/cocoa/nsmenuitem_additions_unittest.mm b/ui/base/cocoa/nsmenuitem_additions_unittest.mm
index dbd94ac..53102fa 100644
--- a/ui/base/cocoa/nsmenuitem_additions_unittest.mm
+++ b/ui/base/cocoa/nsmenuitem_additions_unittest.mm
@@ -10,8 +10,8 @@
#include <ostream>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/keycodes/keyboard_code_conversion_mac.h"
@@ -546,7 +546,7 @@
// The layout generates an event with a capital W. We have to force the
// characters because the regular NSEvent machinery insists on converting
// the string to lower case.
- [base::mac::ObjCCastStrict<NSEventForTesting>(cmdWWithCapsLock)
+ [base::apple::ObjCCastStrict<NSEventForTesting>(cmdWWithCapsLock)
setCharacters:capitalW];
ExpectKeyFiresItem(cmdWWithCapsLock, closeTabItem, /*compare_cocoa=*/false);
@@ -554,7 +554,7 @@
NSEvent* shiftCmdW =
KeyEvent(NSEventModifierFlagCommand | NSEventModifierFlagShift, capitalW,
@"\u1612", kVK_ANSI_W);
- [base::mac::ObjCCastStrict<NSEventForTesting>(shiftCmdW)
+ [base::apple::ObjCCastStrict<NSEventForTesting>(shiftCmdW)
setCharacters:capitalW];
ExpectKeyFiresItem(shiftCmdW, closeWindowItem, /*compare_cocoa=*/false);
@@ -563,7 +563,7 @@
KeyEvent(NSEventModifierFlagCommand | NSEventModifierFlagShift |
NSEventModifierFlagCapsLock,
capitalW, @"\u1612", kVK_ANSI_W);
- [base::mac::ObjCCastStrict<NSEventForTesting>(shiftCmdWWithCapsLock)
+ [base::apple::ObjCCastStrict<NSEventForTesting>(shiftCmdWWithCapsLock)
setCharacters:capitalW];
ExpectKeyFiresItem(shiftCmdWWithCapsLock, closeWindowItem,
/*compare_cocoa=*/false);
@@ -606,7 +606,7 @@
// On a few layouts, "m" has a different key code.
NSString* layout_id =
- base::apple::CFToNSPtrCast(base::mac::CFCast<CFStringRef>(
+ base::apple::CFToNSPtrCast(base::apple::CFCast<CFStringRef>(
TISGetInputSourceProperty(ref, kTISPropertyInputSourceID)));
ASSERT_TRUE(layout_id);
if ([layout_id isEqualToString:@"com.apple.keylayout.Belgian"] ||
diff --git a/ui/base/cocoa/permissions_utils.mm b/ui/base/cocoa/permissions_utils.mm
index 9cbf1a1..7bbbfdc8 100644
--- a/ui/base/cocoa/permissions_utils.mm
+++ b/ui/base/cocoa/permissions_utils.mm
@@ -8,8 +8,8 @@
#include <Foundation/Foundation.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/wrap_cg_display.h"
#include "base/task/thread_pool.h"
diff --git a/ui/base/cocoa/touch_bar_util.mm b/ui/base/cocoa/touch_bar_util.mm
index 6e29829..cdfdf79 100644
--- a/ui/base/cocoa/touch_bar_util.mm
+++ b/ui/base/cocoa/touch_bar_util.mm
@@ -4,14 +4,14 @@
#import "ui/base/cocoa/touch_bar_util.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
namespace ui {
NSString* GetTouchBarId(NSString* touch_bar_id) {
NSString* chrome_bundle_id =
- base::SysUTF8ToNSString(base::mac::BaseBundleID());
+ base::SysUTF8ToNSString(base::apple::BaseBundleID());
return [NSString stringWithFormat:@"%@.%@", chrome_bundle_id, touch_bar_id];
}
diff --git a/ui/base/cocoa/touch_bar_util_unittest.mm b/ui/base/cocoa/touch_bar_util_unittest.mm
index fe32052..5a1e928 100644
--- a/ui/base/cocoa/touch_bar_util_unittest.mm
+++ b/ui/base/cocoa/touch_bar_util_unittest.mm
@@ -4,7 +4,7 @@
#import "ui/base/cocoa/touch_bar_util.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
#import "ui/base/test/cocoa_helper.h"
@@ -25,7 +25,7 @@
};
TEST_F(TouchBarUtilTest, TouchBarIdentifiers) {
- base::mac::SetBaseBundleID(kTestChromeBundleId);
+ base::apple::SetBaseBundleID(kTestChromeBundleId);
EXPECT_TRUE([ui::GetTouchBarId(kTestTouchBarId)
isEqualToString:@"test.bundleid.test-touch-bar"]);
EXPECT_TRUE([ui::GetTouchBarItemId(kTestTouchBarId, kTestTouchBarItemId)
diff --git a/ui/base/dragdrop/os_exchange_data_provider_mac.mm b/ui/base/dragdrop/os_exchange_data_provider_mac.mm
index 19449a55..a081aac 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_mac.mm
+++ b/ui/base/dragdrop/os_exchange_data_provider_mac.mm
@@ -6,8 +6,8 @@
#import <Cocoa/Cocoa.h>
+#include "base/apple/foundation_util.h"
#include "base/check_op.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/ptr_util.h"
#include "base/notreached.h"
#include "base/pickle.h"
diff --git a/ui/base/interaction/interaction_test_util_mac.mm b/ui/base/interaction/interaction_test_util_mac.mm
index 14b4007b..d25c61c 100644
--- a/ui/base/interaction/interaction_test_util_mac.mm
+++ b/ui/base/interaction/interaction_test_util_mac.mm
@@ -4,7 +4,7 @@
#include "ui/base/interaction/interaction_test_util_mac.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "ui/base/cocoa/menu_controller.h"
#include "ui/base/interaction/element_tracker_mac.h"
#include "ui/base/models/menu_model.h"
@@ -33,7 +33,7 @@
}
MenuControllerCocoa* controller =
- base::mac::ObjCCastStrict<MenuControllerCocoa>([menu delegate]);
+ base::apple::ObjCCastStrict<MenuControllerCocoa>([menu delegate]);
if (!controller) {
LOG(ERROR) << "Cannot retrieve MenuControllerCocoa from menu.";
return ActionResult::kFailed;
diff --git a/ui/base/resource/resource_bundle_ios.mm b/ui/base/resource/resource_bundle_ios.mm
index be6263b..2ed9596 100644
--- a/ui/base/resource/resource_bundle_ios.mm
+++ b/ui/base/resource/resource_bundle_ios.mm
@@ -8,9 +8,9 @@
#import <UIKit/UIKit.h>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/ref_counted_memory.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
diff --git a/ui/base/resource/resource_bundle_mac.mm b/ui/base/resource/resource_bundle_mac.mm
index b812234..dfad5e9 100644
--- a/ui/base/resource/resource_bundle_mac.mm
+++ b/ui/base/resource/resource_bundle_mac.mm
@@ -8,10 +8,10 @@
#include <stddef.h>
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/memory/ref_counted_memory.h"
#include "base/notreached.h"
#include "base/numerics/safe_conversions.h"
@@ -46,7 +46,7 @@
return base::FilePath(base::SysNSStringToUTF8(name) + ".pak");
}
- return base::mac::NSStringToFilePath(resource_path);
+ return base::apple::NSStringToFilePath(resource_path);
}
} // namespace
diff --git a/ui/base/test/scoped_fake_nswindow_focus.mm b/ui/base/test/scoped_fake_nswindow_focus.mm
index 8be6cfa..0d634d5 100644
--- a/ui/base/test/scoped_fake_nswindow_focus.mm
+++ b/ui/base/test/scoped_fake_nswindow_focus.mm
@@ -6,8 +6,8 @@
#import <Cocoa/Cocoa.h>
+#import "base/apple/foundation_util.h"
#import "base/apple/scoped_objc_class_swizzler.h"
-#import "base/mac/foundation_util.h"
using base::apple::ScopedObjCClassSwizzler;
@@ -47,17 +47,17 @@
@implementation FakeNSWindowFocusDonor
- (BOOL)isKeyWindow {
- NSWindow* selfAsWindow = base::mac::ObjCCastStrict<NSWindow>(self);
+ NSWindow* selfAsWindow = base::apple::ObjCCastStrict<NSWindow>(self);
return selfAsWindow == g_fake_focused_window;
}
- (BOOL)isMainWindow {
- NSWindow* selfAsWindow = base::mac::ObjCCastStrict<NSWindow>(self);
+ NSWindow* selfAsWindow = base::apple::ObjCCastStrict<NSWindow>(self);
return selfAsWindow == g_fake_focused_window;
}
- (void)makeKeyWindow {
- NSWindow* selfAsWindow = base::mac::ObjCCastStrict<NSWindow>(self);
+ NSWindow* selfAsWindow = base::apple::ObjCCastStrict<NSWindow>(self);
if (selfAsWindow == g_fake_focused_window ||
![selfAsWindow canBecomeKeyWindow])
return;
@@ -71,7 +71,7 @@
}
- (void)orderOut:(id)sender {
- NSWindow* selfAsWindow = base::mac::ObjCCastStrict<NSWindow>(self);
+ NSWindow* selfAsWindow = base::apple::ObjCCastStrict<NSWindow>(self);
if (selfAsWindow == g_fake_focused_window)
ClearFocus();
g_order_out_swizzler->InvokeOriginal<void, id>(self, _cmd, sender);
diff --git a/ui/base/test/scoped_fake_nswindow_fullscreen.mm b/ui/base/test/scoped_fake_nswindow_fullscreen.mm
index f70f8c24..76f1a34 100644
--- a/ui/base/test/scoped_fake_nswindow_fullscreen.mm
+++ b/ui/base/test/scoped_fake_nswindow_fullscreen.mm
@@ -6,9 +6,9 @@
#import <Cocoa/Cocoa.h>
+#import "base/apple/foundation_util.h"
#import "base/apple/scoped_objc_class_swizzler.h"
#include "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "base/mac/mac_util.h"
#include "base/run_loop.h"
#include "base/task/current_thread.h"
diff --git a/ui/base/test/ui_controls_mac.mm b/ui/base/test/ui_controls_mac.mm
index cc12e34..6178d352 100644
--- a/ui/base/test/ui_controls_mac.mm
+++ b/ui/base/test/ui_controls_mac.mm
@@ -8,10 +8,10 @@
#include <vector>
+#import "base/apple/foundation_util.h"
#import "base/apple/scoped_objc_class_swizzler.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
-#import "base/mac/foundation_util.h"
#include "base/task/current_thread.h"
#import "base/task/single_thread_task_runner.h"
#include "base/task/single_thread_task_runner.h"
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
index 43e82e1..eb6e483 100644
--- a/ui/display/mac/screen_mac.mm
+++ b/ui/display/mac/screen_mac.mm
@@ -14,11 +14,11 @@
#include <memory>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/functional/bind.h"
#include "base/i18n/rtl.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/timer/timer.h"
diff --git a/ui/events/keycodes/dom/dom_keyboard_layout_map_mac.mm b/ui/events/keycodes/dom/dom_keyboard_layout_map_mac.mm
index a9cfa34..b38f45e 100644
--- a/ui/events/keycodes/dom/dom_keyboard_layout_map_mac.mm
+++ b/ui/events/keycodes/dom/dom_keyboard_layout_map_mac.mm
@@ -7,8 +7,8 @@
#include <cstdint>
#include <string>
+#include "base/apple/foundation_util.h"
#include "base/check_op.h"
-#include "base/mac/foundation_util.h"
#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/keycodes/dom/dom_key.h"
#include "ui/events/keycodes/dom/dom_keyboard_layout_map_base.h"
diff --git a/ui/events/keycodes/keyboard_code_conversion_mac.mm b/ui/events/keycodes/keyboard_code_conversion_mac.mm
index 395bb2ca..c3beb78 100644
--- a/ui/events/keycodes/keyboard_code_conversion_mac.mm
+++ b/ui/events/keycodes/keyboard_code_conversion_mac.mm
@@ -8,10 +8,10 @@
#include <algorithm>
+#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/check_op.h"
-#include "base/mac/foundation_util.h"
#include "base/notreached.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversion_utils.h"
@@ -948,7 +948,7 @@
DCHECK(dead_key_state);
CFDataRef layout_data =
- base::mac::CFCast<CFDataRef>(TISGetInputSourceProperty(
+ base::apple::CFCast<CFDataRef>(TISGetInputSourceProperty(
input_source, kTISPropertyUnicodeKeyLayoutData));
if (!layout_data)
return 0xFFFD; // REPLACEMENT CHARACTER
diff --git a/ui/gfx/decorated_text_mac.mm b/ui/gfx/decorated_text_mac.mm
index 357887be..014b6bc7 100644
--- a/ui/gfx/decorated_text_mac.mm
+++ b/ui/gfx/decorated_text_mac.mm
@@ -8,7 +8,7 @@
#include <CoreText/CoreText.h>
#include "base/apple/bridging.h"
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "ui/gfx/decorated_text.h"
diff --git a/ui/gfx/font_fallback_mac.mm b/ui/gfx/font_fallback_mac.mm
index f0b52355..5763e81 100644
--- a/ui/gfx/font_fallback_mac.mm
+++ b/ui/gfx/font_fallback_mac.mm
@@ -8,9 +8,9 @@
#import <Foundation/Foundation.h>
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/i18n/char_iterator.h"
-#include "base/mac/foundation_util.h"
#import "base/mac/mac_util.h"
#include "base/strings/string_piece.h"
#import "base/strings/sys_string_conversions.h"
@@ -53,7 +53,7 @@
const CFIndex fallback_count = CFArrayGetCount(cascade_list);
for (CFIndex i = 0; i < fallback_count; ++i) {
CTFontDescriptorRef descriptor =
- base::mac::CFCastStrict<CTFontDescriptorRef>(
+ base::apple::CFCastStrict<CTFontDescriptorRef>(
CFArrayGetValueAtIndex(cascade_list, i));
base::ScopedCFTypeRef<CTFontRef> fallback_font(
CTFontCreateWithFontDescriptor(descriptor, 0.0, nullptr));
diff --git a/ui/gfx/image/image.cc b/ui/gfx/image/image.cc
index f03a3534..3d831e9d 100644
--- a/ui/gfx/image/image.cc
+++ b/ui/gfx/image/image.cc
@@ -23,10 +23,10 @@
#include "ui/gfx/image/image_skia.h"
#if BUILDFLAG(IS_IOS)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "ui/gfx/image/image_skia_util_ios.h"
#elif BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/mac/mac_util.h"
#include "ui/gfx/image/image_skia_util_mac.h"
#endif
diff --git a/ui/gfx/image/image_platform.h b/ui/gfx/image/image_platform.h
index 7cec0d0..766b927 100644
--- a/ui/gfx/image/image_platform.h
+++ b/ui/gfx/image/image_platform.h
@@ -22,10 +22,10 @@
#include "ui/gfx/image/image_skia.h"
#if BUILDFLAG(IS_IOS)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "ui/gfx/image/image_skia_util_ios.h"
#elif BUILDFLAG(IS_MAC)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/mac/mac_util.h"
#include "ui/gfx/image/image_skia_util_mac.h"
#endif
diff --git a/ui/gfx/image/image_unittest.cc b/ui/gfx/image/image_unittest.cc
index 81c150d..d456a80f 100644
--- a/ui/gfx/image/image_unittest.cc
+++ b/ui/gfx/image/image_unittest.cc
@@ -20,13 +20,13 @@
#include "ui/gfx/image/image_unittest_util.h"
#if BUILDFLAG(IS_IOS)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "skia/ext/skia_utils_ios.h"
#elif BUILDFLAG(IS_MAC)
#include <CoreGraphics/CoreGraphics.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "skia/ext/skia_utils_mac.h"
#endif
diff --git a/ui/gfx/platform_font_ios.mm b/ui/gfx/platform_font_ios.mm
index 3205e36..5a89229 100644
--- a/ui/gfx/platform_font_ios.mm
+++ b/ui/gfx/platform_font_ios.mm
@@ -9,7 +9,7 @@
#include <cmath>
#include "base/apple/bridging.h"
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#include "base/notreached.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/ui/gfx/platform_font_mac.mm b/ui/gfx/platform_font_mac.mm
index 9acd276..b51f376 100644
--- a/ui/gfx/platform_font_mac.mm
+++ b/ui/gfx/platform_font_mac.mm
@@ -11,8 +11,8 @@
#include <CoreText/CoreText.h>
#include "base/apple/bridging.h"
+#import "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#import "base/mac/foundation_util.h"
#include "base/memory/scoped_policy.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
@@ -96,7 +96,7 @@
base::ScopedCFTypeRef<CFDictionaryRef> traits(CTFontCopyTraits(font));
DCHECK(traits);
- CFNumberRef cf_weight = base::mac::GetValueFromDictionary<CFNumberRef>(
+ CFNumberRef cf_weight = base::apple::GetValueFromDictionary<CFNumberRef>(
traits, kCTFontWeightTrait);
// A missing weight attribute just means 0 -> NORMAL.
if (!cf_weight)
@@ -105,7 +105,7 @@
// macOS 13.0 bug: For non-system fonts with 0-valued traits,
// `kCFBooleanFalse` is used instead of a `CFNumberRef` of 0. See
// https://crbug.com/1372420. Filed as FB11673021, fixed in macOS 13.1. In
- // this code path, the `base::mac::GetValueFromDictionary` call above will
+ // this code path, the `base::apple::GetValueFromDictionary` call above will
// DLOG for this case and return a null `CFNumberRef`, which will cause this
// function to return `Weight::NORMAL`, which happens to be the correct thing
// to do for a trait with value 0.
diff --git a/ui/gfx/platform_font_mac_unittest.mm b/ui/gfx/platform_font_mac_unittest.mm
index 9ea3fc1..ae53a18 100644
--- a/ui/gfx/platform_font_mac_unittest.mm
+++ b/ui/gfx/platform_font_mac_unittest.mm
@@ -9,8 +9,8 @@
#include <stddef.h>
#include "base/apple/bridging.h"
+#import "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#import "base/mac/foundation_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/font.h"
@@ -36,7 +36,7 @@
}
}
- return base::mac::GetValueFromDictionary<CFNumberRef>(dict, key);
+ return base::apple::GetValueFromDictionary<CFNumberRef>(dict, key);
};
// |weight_tri| is either -1, 0, or 1 meaning "light", "normal", or "bold".
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index c559cca..9a64b38 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -55,7 +55,7 @@
#include "ui/gfx/utf16_indexing.h"
#if BUILDFLAG(IS_APPLE)
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/mac/mac_util.h"
#include "third_party/skia/include/ports/SkTypeface_mac.h"
#endif
diff --git a/ui/gl/init/gl_initializer_mac.cc b/ui/gl/init/gl_initializer_mac.cc
index 49418ea..f636588 100644
--- a/ui/gl/init/gl_initializer_mac.cc
+++ b/ui/gl/init/gl_initializer_mac.cc
@@ -5,10 +5,10 @@
#include "ui/gl/init/gl_initializer.h"
#include "base/apple/bundle_locations.h"
+#include "base/apple/foundation_util.h"
#include "base/base_paths.h"
#include "base/files/file_path.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#include "base/native_library.h"
#include "base/path_service.h"
#include "base/threading/thread_restrictions.h"
@@ -43,7 +43,7 @@
// Some unit test targets depend on Angle/SwiftShader but aren't built
// as app bundles. In that case, the .dylib is next to the executable.
base::FilePath base_dir;
- if (base::mac::AmIBundled()) {
+ if (base::apple::AmIBundled()) {
base_dir = base::apple::FrameworkBundlePath().Append("Libraries");
} else {
if (!base::PathService::Get(base::FILE_EXE, &base_dir)) {
diff --git a/ui/native_theme/caption_style_mac.mm b/ui/native_theme/caption_style_mac.mm
index 455e8a2..2144161 100644
--- a/ui/native_theme/caption_style_mac.mm
+++ b/ui/native_theme/caption_style_mac.mm
@@ -5,8 +5,8 @@
#include <AppKit/AppKit.h>
#include <MediaAccessibility/MediaAccessibility.h>
+#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
-#include "base/mac/foundation_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"
#include "skia/ext/skia_utils_mac.h"
@@ -132,13 +132,13 @@
kUserDomain, nullptr, kMACaptionAppearanceFontStyleDefault));
base::ScopedCFTypeRef<CFStringRef> ct_font_family_name(
- base::mac::CFCast<CFStringRef>(CTFontDescriptorCopyAttribute(
+ base::apple::CFCast<CFStringRef>(CTFontDescriptorCopyAttribute(
ct_font_desc, kCTFontFamilyNameAttribute)));
if (ct_font_family_name)
*font_family = base::SysCFStringRefToUTF8(ct_font_family_name);
base::ScopedCFTypeRef<CFStringRef> ct_font_face_name(
- base::mac::CFCast<CFStringRef>(
+ base::apple::CFCast<CFStringRef>(
CTFontDescriptorCopyAttribute(ct_font_desc, kCTFontNameAttribute)));
if (ct_font_face_name)
*font_variant = base::SysCFStringRefToUTF8(ct_font_face_name);
diff --git a/ui/shell_dialogs/select_file_dialog_ios.mm b/ui/shell_dialogs/select_file_dialog_ios.mm
index ea4ba30b..50d36f2 100644
--- a/ui/shell_dialogs/select_file_dialog_ios.mm
+++ b/ui/shell_dialogs/select_file_dialog_ios.mm
@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
#include "base/ranges/algorithm.h"
@@ -91,7 +91,7 @@
continue;
}
NSString* path = url.path;
- paths.push_back(base::mac::NSStringToFilePath(path));
+ paths.push_back(base::apple::NSStringToFilePath(path));
}
_dialog->FileWasSelected(_params, _allowMultipleFiles, false, paths, 0);
}
diff --git a/ui/shell_dialogs/select_file_dialog_mac_unittest.mm b/ui/shell_dialogs/select_file_dialog_mac_unittest.mm
index 273fced8d..5f03ffe 100644
--- a/ui/shell_dialogs/select_file_dialog_mac_unittest.mm
+++ b/ui/shell_dialogs/select_file_dialog_mac_unittest.mm
@@ -6,9 +6,9 @@
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
+#import "base/apple/foundation_util.h"
#include "base/files/file_util.h"
#include "base/functional/callback_forward.h"
-#import "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
@@ -414,7 +414,7 @@
EXPECT_EQ(test_cases[i].prompt, base::SysNSStringToUTF8([panel prompt]));
if (args.type != SelectFileDialog::SELECT_SAVEAS_FILE) {
- NSOpenPanel* open_panel = base::mac::ObjCCast<NSOpenPanel>(panel);
+ NSOpenPanel* open_panel = base::apple::ObjCCast<NSOpenPanel>(panel);
// Verify that for types other than save file dialogs, an NSOpenPanel is
// created.
ASSERT_TRUE(open_panel);
@@ -474,9 +474,9 @@
panel.extensionHidden = NO;
EXPECT_EQ(args.default_path.DirName(),
- base::mac::NSStringToFilePath(panel.directoryURL.path));
+ base::apple::NSStringToFilePath(panel.directoryURL.path));
EXPECT_EQ(args.default_path.BaseName(),
- base::mac::NSStringToFilePath(panel.nameFieldStringValue));
+ base::apple::NSStringToFilePath(panel.nameFieldStringValue));
}
// Verify that the file dialog does not hide extension for filenames with
diff --git a/ui/views/cocoa/bridged_native_widget_unittest.mm b/ui/views/cocoa/bridged_native_widget_unittest.mm
index 2d5214f..e4f828b 100644
--- a/ui/views/cocoa/bridged_native_widget_unittest.mm
+++ b/ui/views/cocoa/bridged_native_widget_unittest.mm
@@ -10,9 +10,9 @@
#include <memory>
#include <string>
+#import "base/apple/foundation_util.h"
#import "base/apple/scoped_objc_class_swizzler.h"
#include "base/functional/bind.h"
-#import "base/mac/foundation_util.h"
#import "base/mac/mac_util.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/stringprintf.h"
@@ -496,9 +496,8 @@
}
bool BridgeWindowHasShadow() {
- return
- [base::mac::ObjCCast<NativeWidgetMacNSWindowForTesting>(bridge_window())
- hasShadowForTesting];
+ return [base::apple::ObjCCast<NativeWidgetMacNSWindowForTesting>(
+ bridge_window()) hasShadowForTesting];
}
protected:
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
index 42b7016..5981bfa 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
@@ -7,9 +7,9 @@
#include <tuple>
#include <utility>
+#include "base/apple/foundation_util.h"
#include "base/base64.h"
#include "base/containers/contains.h"
-#include "base/mac/foundation_util.h"
#include "base/no_destructor.h"
#include "base/numerics/safe_conversions.h"
#include "base/ranges/algorithm.h"
@@ -232,7 +232,7 @@
NSWindow* full_screen_window) {
if ([full_screen_window.delegate
conformsToProtocol:@protocol(ImmersiveModeDelegate)]) {
- return base::mac::ObjCCastStrict<NSObject<ImmersiveModeDelegate>>(
+ return base::apple::ObjCCastStrict<NSObject<ImmersiveModeDelegate>>(
full_screen_window.delegate)
.originalHostingWindow;
}
@@ -247,7 +247,7 @@
NSWindow* window = native_window.GetNativeNSWindow();
if (NativeWidgetMacNSWindow* widget_window =
- base::mac::ObjCCast<NativeWidgetMacNSWindow>(window)) {
+ base::apple::ObjCCast<NativeWidgetMacNSWindow>(window)) {
return GetFromId([widget_window bridgedNativeWidgetId]);
}
@@ -258,7 +258,7 @@
if (remote_cocoa::IsNSToolbarFullScreenWindow(window)) {
NSWindow* original = OriginalHostingWindowFromFullScreenWindow(window);
if (NativeWidgetMacNSWindow* widget_window =
- base::mac::ObjCCast<NativeWidgetMacNSWindow>(original)) {
+ base::apple::ObjCCast<NativeWidgetMacNSWindow>(original)) {
return GetFromId([widget_window bridgedNativeWidgetId]);
}
}
diff --git a/ui/views/controls/menu/menu_controller_cocoa_delegate_impl.mm b/ui/views/controls/menu/menu_controller_cocoa_delegate_impl.mm
index 94ab201..30b2366 100644
--- a/ui/views/controls/menu/menu_controller_cocoa_delegate_impl.mm
+++ b/ui/views/controls/menu/menu_controller_cocoa_delegate_impl.mm
@@ -5,8 +5,8 @@
#import "ui/views/controls/menu/menu_controller_cocoa_delegate_impl.h"
#include "base/apple/bridging.h"
+#include "base/apple/foundation_util.h"
#include "base/logging.h"
-#include "base/mac/foundation_util.h"
#import "base/message_loop/message_pump_apple.h"
#import "skia/ext/skia_utils_mac.h"
#import "ui/base/cocoa/cocoa_base_utils.h"
diff --git a/ui/views/controls/native/native_view_host_mac.mm b/ui/views/controls/native/native_view_host_mac.mm
index 8f1982d..7352b7e 100644
--- a/ui/views/controls/native/native_view_host_mac.mm
+++ b/ui/views/controls/native/native_view_host_mac.mm
@@ -6,7 +6,7 @@
#import <Cocoa/Cocoa.h>
-#include "base/mac/foundation_util.h"
+#include "base/apple/foundation_util.h"
#import "ui/accessibility/platform/ax_platform_node_mac.h"
#include "ui/compositor/layer.h"
#import "ui/views/cocoa/native_widget_mac_ns_window_host.h"
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane_accessibility_mac_unittest.mm b/ui/views/controls/tabbed_pane/tabbed_pane_accessibility_mac_unittest.mm
index e4c1e6bb..8685cdcd 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane_accessibility_mac_unittest.mm
+++ b/ui/views/controls/tabbed_pane/tabbed_pane_accessibility_mac_unittest.mm
@@ -6,7 +6,7 @@
#import <Cocoa/Cocoa.h>
-#import "base/mac/foundation_util.h"
+#import "base/apple/foundation_util.h"
#import "base/mac/mac_util.h"
#include "base/strings/utf_string_conversions.h"
#import "testing/gtest_mac.h"
@@ -26,7 +26,7 @@
// Unboxes an accessibilityValue into an int via NSNumber.
int IdToInt(id value) {
- return base::mac::ObjCCastStrict<NSNumber>(value).intValue;
+ return base::apple::ObjCCastStrict<NSNumber>(value).intValue;
}
// TODO(https://crbug.com/936990): NSTabItemView is not an NSView (despite the
diff --git a/ui/views/widget/native_widget_mac_unittest.mm b/ui/views/widget/native_widget_mac_unittest.mm
index f7a02135..3812741 100644
--- a/ui/views/widget/native_widget_mac_unittest.mm
+++ b/ui/views/widget/native_widget_mac_unittest.mm
@@ -6,10 +6,10 @@
#import <Cocoa/Cocoa.h>
+#import "base/apple/foundation_util.h"
#import "base/apple/scoped_objc_class_swizzler.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
-#import "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
@@ -111,7 +111,7 @@
}
NSAnimation* show_animation() {
- return base::mac::ObjCCastStrict<NSAnimation>(bridge_->show_animation_);
+ return base::apple::ObjCCastStrict<NSAnimation>(bridge_->show_animation_);
}
bool HasWindowRestorationData() {
@@ -193,7 +193,7 @@
params.native_widget = new TestWindowNativeWidgetMac(widget);
widget->Init(std::move(params));
widget->Show();
- *window = base::mac::ObjCCastStrict<NativeWidgetMacTestWindow>(
+ *window = base::apple::ObjCCastStrict<NativeWidgetMacTestWindow>(
widget->GetNativeWindow().GetNativeNSWindow());
EXPECT_TRUE(*window);
return widget;
@@ -2335,7 +2335,7 @@
NSTouchBar* touch_bar = [view touchBar];
NSTouchBarItemIdentifier principal = [touch_bar principalItemIdentifier];
EXPECT_TRUE(principal);
- NSGroupTouchBarItem* group = base::mac::ObjCCastStrict<NSGroupTouchBarItem>(
+ NSGroupTouchBarItem* group = base::apple::ObjCCastStrict<NSGroupTouchBarItem>(
[[touch_bar delegate] touchBar:touch_bar
makeItemForIdentifier:principal]);
EXPECT_TRUE(group);