diff options
Diffstat (limited to 'chrome/browser')
408 files changed, 1621 insertions, 1604 deletions
diff --git a/chrome/browser/app_controller_mac.h b/chrome/browser/app_controller_mac.h index cea9bfd..5928e17 100644 --- a/chrome/browser/app_controller_mac.h +++ b/chrome/browser/app_controller_mac.h @@ -10,7 +10,7 @@ #import <Cocoa/Cocoa.h> #include <vector> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/prefs/pref_change_registrar.h" @@ -46,7 +46,7 @@ class WorkAreaWatcherObserver; // The profile menu, which appears right before the Help menu. It is only // available when multiple profiles is enabled. - scoped_nsobject<ProfileMenuController> profileMenuController_; + base::scoped_nsobject<ProfileMenuController> profileMenuController_; // If we're told to open URLs (in particular, via |-application:openFiles:| by // Launch Services) before we've launched the browser, we queue them up in diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 9ceb463..b826354 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -1226,7 +1226,7 @@ void RecordLastRunAppBundlePath() { [dockMenu addItem:[NSMenuItem separatorItem]]; NSString* titleStr = l10n_util::GetNSStringWithFixup(IDS_NEW_WINDOW_MAC); - scoped_nsobject<NSMenuItem> item( + base::scoped_nsobject<NSMenuItem> item( [[NSMenuItem alloc] initWithTitle:titleStr action:@selector(commandFromDock:) keyEquivalent:@""]); @@ -1255,7 +1255,8 @@ void RecordLastRunAppBundlePath() { int position = 0; NSString* menuStr = l10n_util::GetNSStringWithFixup(IDS_BACKGROUND_APPS_MAC); - scoped_nsobject<NSMenu> appMenu([[NSMenu alloc] initWithTitle:menuStr]); + base::scoped_nsobject<NSMenu> appMenu( + [[NSMenu alloc] initWithTitle:menuStr]); for (extensions::ExtensionList::const_iterator cursor = applications.begin(); cursor != applications.end(); @@ -1263,10 +1264,10 @@ void RecordLastRunAppBundlePath() { DCHECK_EQ(applications.GetPosition(*cursor), position); NSString* itemStr = base::SysUTF16ToNSString(UTF8ToUTF16((*cursor)->name())); - scoped_nsobject<NSMenuItem> appItem([[NSMenuItem alloc] - initWithTitle:itemStr - action:@selector(executeApplication:) - keyEquivalent:@""]); + base::scoped_nsobject<NSMenuItem> appItem( + [[NSMenuItem alloc] initWithTitle:itemStr + action:@selector(executeApplication:) + keyEquivalent:@""]); [appItem setTarget:self]; [appItem setTag:position]; [appMenu addItem:appItem]; diff --git a/chrome/browser/app_controller_mac_browsertest.mm b/chrome/browser/app_controller_mac_browsertest.mm index 62d2680..a0d199e 100644 --- a/chrome/browser/app_controller_mac_browsertest.mm +++ b/chrome/browser/app_controller_mac_browsertest.mm @@ -5,7 +5,7 @@ #import <Cocoa/Cocoa.h> #include "base/command_line.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/app/chrome_command_ids.h" #import "chrome/browser/app_controller_mac.h" #include "chrome/browser/ui/browser.h" @@ -39,7 +39,7 @@ class AppControllerPlatformAppBrowserTest : public InProcessBrowserTest { // open then a reopen event does nothing. IN_PROC_BROWSER_TEST_F(AppControllerPlatformAppBrowserTest, PlatformAppReopenWithWindows) { - scoped_nsobject<AppController> ac([[AppController alloc] init]); + base::scoped_nsobject<AppController> ac([[AppController alloc] init]); NSUInteger old_window_count = [[NSApp windows] count]; EXPECT_EQ(1u, native_browser_list->size()); BOOL result = [ac applicationShouldHandleReopen:NSApp hasVisibleWindows:YES]; @@ -71,7 +71,7 @@ class AppControllerWebAppBrowserTest : public InProcessBrowserTest { // Test that in web app mode a reopen event opens the app URL. IN_PROC_BROWSER_TEST_F(AppControllerWebAppBrowserTest, WebAppReopenWithNoWindows) { - scoped_nsobject<AppController> ac([[AppController alloc] init]); + base::scoped_nsobject<AppController> ac([[AppController alloc] init]); EXPECT_EQ(1u, native_browser_list->size()); BOOL result = [ac applicationShouldHandleReopen:NSApp hasVisibleWindows:NO]; diff --git a/chrome/browser/app_controller_mac_unittest.mm b/chrome/browser/app_controller_mac_unittest.mm index b391fd7..a17c76d 100644 --- a/chrome/browser/app_controller_mac_unittest.mm +++ b/chrome/browser/app_controller_mac_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/app/chrome_command_ids.h" #import "chrome/browser/app_controller_mac.h" #include "testing/platform_test.h" @@ -13,7 +13,7 @@ class AppControllerTest : public PlatformTest { }; TEST_F(AppControllerTest, DockMenu) { - scoped_nsobject<AppController> ac([[AppController alloc] init]); + base::scoped_nsobject<AppController> ac([[AppController alloc] init]); NSMenu* menu = [ac applicationDockMenu:NSApp]; NSMenuItem* item; diff --git a/chrome/browser/chrome_browser_application_mac.h b/chrome/browser/chrome_browser_application_mac.h index 5363942..5bcfc15 100644 --- a/chrome/browser/chrome_browser_application_mac.h +++ b/chrome/browser/chrome_browser_application_mac.h @@ -11,8 +11,8 @@ #include <vector> +#import "base/mac/scoped_nsobject.h" #import "base/mac/scoped_sending_event.h" -#import "base/memory/scoped_nsobject.h" #import "base/message_loop/message_pump_mac.h" #include "base/synchronization/lock.h" diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm index 74dd296..2889a64 100644 --- a/chrome/browser/chrome_browser_application_mac.mm +++ b/chrome/browser/chrome_browser_application_mac.mm @@ -9,7 +9,7 @@ #include "base/debug/stack_trace.h" #import "base/logging.h" #import "base/mac/scoped_nsexception_enabler.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "base/metrics/histogram.h" #include "base/strings/stringprintf.h" #import "base/strings/sys_string_conversions.h" diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm index b1b4989..156146b 100644 --- a/chrome/browser/chrome_browser_main_mac.mm +++ b/chrome/browser/chrome_browser_main_mac.mm @@ -12,7 +12,7 @@ #include "base/files/file_path.h" #include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/metrics/histogram.h" #include "base/path_service.h" #include "chrome/app/breakpad_mac.h" @@ -265,9 +265,9 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { } // Now load the nib (from the right bundle). - scoped_nsobject<NSNib> - nib([[NSNib alloc] initWithNibNamed:@"MainMenu" - bundle:base::mac::FrameworkBundle()]); + base::scoped_nsobject<NSNib> nib( + [[NSNib alloc] initWithNibNamed:@"MainMenu" + bundle:base::mac::FrameworkBundle()]); // TODO(viettrungluu): crbug.com/20504 - This currently leaks, so if you // change this, you'll probably need to change the Valgrind suppression. [nib instantiateNibWithOwner:NSApp topLevelObjects:nil]; diff --git a/chrome/browser/download/download_status_updater_mac.mm b/chrome/browser/download/download_status_updater_mac.mm index fbf010e..4ffcd81 100644 --- a/chrome/browser/download/download_status_updater_mac.mm +++ b/chrome/browser/download/download_status_updater_mac.mm @@ -5,11 +5,11 @@ #include "chrome/browser/download/download_status_updater.h" #include "base/mac/foundation_util.h" -#include "base/memory/scoped_nsobject.h" -#include "base/supports_user_data.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" -#include "content/public/browser/download_item.h" +#include "base/supports_user_data.h" #import "chrome/browser/ui/cocoa/dock_icon.h" +#include "content/public/browser/download_item.h" #include "googleurl/src/gurl.h" // --- Private 10.8 API for showing progress --- @@ -169,7 +169,7 @@ class CrNSProgressUserData : public base::SupportsUserData::Data { void setTarget(const base::FilePath& target) { target_ = target; } private: - scoped_nsobject<NSProgress> progress_; + base::scoped_nsobject<NSProgress> progress_; base::FilePath target_; }; diff --git a/chrome/browser/importer/safari_importer.mm b/chrome/browser/importer/safari_importer.mm index 422cc68..e1eed6c 100644 --- a/chrome/browser/importer/safari_importer.mm +++ b/chrome/browser/importer/safari_importer.mm @@ -11,7 +11,7 @@ #include "base/file_util.h" #include "base/mac/mac_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" diff --git a/chrome/browser/mac/keystone_glue.h b/chrome/browser/mac/keystone_glue.h index 8b696c2..d85763c 100644 --- a/chrome/browser/mac/keystone_glue.h +++ b/chrome/browser/mac/keystone_glue.h @@ -12,7 +12,7 @@ #import <Foundation/Foundation.h> #include "base/mac/scoped_authorizationref.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" // Possible outcomes of various operations. A version may accompany some of // these, but beware: a version is never required. For statuses that can be @@ -89,7 +89,7 @@ enum BrandFileType { NSTimer* timer_; // strong // The most recent kAutoupdateStatusNotification notification posted. - scoped_nsobject<NSNotification> recentNotification_; + base::scoped_nsobject<NSNotification> recentNotification_; // The authorization object, when it needs to persist because it's being // carried across threads. diff --git a/chrome/browser/mac/keystone_glue.mm b/chrome/browser/mac/keystone_glue.mm index 0a97252..f93e86d 100644 --- a/chrome/browser/mac/keystone_glue.mm +++ b/chrome/browser/mac/keystone_glue.mm @@ -97,9 +97,9 @@ class PerformBridge : public base::RefCountedThreadSafe<PerformBridge> { [target_ performSelector:sel_ withObject:arg_]; } - scoped_nsobject<id> target_; + base::scoped_nsobject<id> target_; SEL sel_; - scoped_nsobject<id> arg_; + base::scoped_nsobject<id> arg_; }; } // namespace diff --git a/chrome/browser/media_galleries/fileapi/itunes_finder_mac.mm b/chrome/browser/media_galleries/fileapi/itunes_finder_mac.mm index 79846ac..fb9fb4e 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_finder_mac.mm +++ b/chrome/browser/media_galleries/fileapi/itunes_finder_mac.mm @@ -7,7 +7,7 @@ #include "base/file_util.h" #include "base/logging.h" #import "base/mac/foundation_util.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "base/time.h" #include "content/public/browser/browser_thread.h" @@ -28,8 +28,8 @@ void ITunesFinderMac::FindITunesLibraryOnFileThread() { CFStringRef iapp_id = CFSTR("com.apple.iApps"); CFStringRef itunes_db_key = CFSTR("iTunesRecentDatabasePaths"); - scoped_nsobject<NSArray> plist(CFToNSCast(CFCast<CFArrayRef>( - CFPreferencesCopyAppValue(itunes_db_key, iapp_id)))); + base::scoped_nsobject<NSArray> plist(CFToNSCast( + CFCast<CFArrayRef>(CFPreferencesCopyAppValue(itunes_db_key, iapp_id)))); if (!plist) { PostResultToUIThread(std::string()); return; diff --git a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm index 7c4447f..87119f1 100644 --- a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm +++ b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm @@ -6,7 +6,7 @@ #include <algorithm> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/threading/sequenced_worker_pool.h" #include "chrome/browser/media_galleries/mtp_device_delegate_impl.h" #include "chrome/browser/storage_monitor/image_capture_device.h" @@ -61,7 +61,7 @@ class MTPDeviceDelegateImplMac::DeviceListener virtual void ResetDelegate(); private: - scoped_nsobject<ImageCaptureDevice> camera_device_; + base::scoped_nsobject<ImageCaptureDevice> camera_device_; // Weak pointer MTPDeviceDelegateImplMac* delegate_; 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 c88493b..7e71717 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 @@ -9,7 +9,7 @@ #include "base/files/scoped_temp_dir.h" #include "base/mac/cocoa_protocols.h" #include "base/mac/foundation_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/message_loop.h" #include "base/run_loop.h" #include "base/strings/sys_string_conversions.h" @@ -47,7 +47,7 @@ const char kTestFileContents[] = "test"; @interface MockMTPICCameraDevice : ICCameraDevice { @private - scoped_nsobject<NSMutableArray> allMediaFiles_; + base::scoped_nsobject<NSMutableArray> allMediaFiles_; } - (void)addMediaFile:(ICCameraFile*)file; @@ -121,8 +121,8 @@ const char kTestFileContents[] = "test"; @interface MockMTPICCameraFile : ICCameraFile { @private - scoped_nsobject<NSString> name_; - scoped_nsobject<NSDate> date_; + base::scoped_nsobject<NSString> name_; + base::scoped_nsobject<NSDate> date_; } - (id)init:(NSString*)name; @@ -546,7 +546,7 @@ TEST_F(MTPDeviceDelegateImplMacTest, TestDownload) { info.last_accessed = t1; info.creation_time = t1; std::string kTestFileName("filename"); - scoped_nsobject<MockMTPICCameraFile> picture1( + base::scoped_nsobject<MockMTPICCameraFile> picture1( [[MockMTPICCameraFile alloc] init:base::SysUTF8ToNSString(kTestFileName)]); [camera_ addMediaFile:picture1]; diff --git a/chrome/browser/notifications/notification_ui_manager_mac.h b/chrome/browser/notifications/notification_ui_manager_mac.h index 709e2d2..20cc582 100644 --- a/chrome/browser/notifications/notification_ui_manager_mac.h +++ b/chrome/browser/notifications/notification_ui_manager_mac.h @@ -11,7 +11,7 @@ #include <set> #include "base/basictypes.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "chrome/browser/notifications/balloon_notification_ui_manager.h" @@ -74,7 +74,7 @@ class NotificationUIManagerMac : public BalloonNotificationUIManager { const string16& replacement_id) const; // Cocoa class that receives callbacks from the NSUserNotificationCenter. - scoped_nsobject<NotificationCenterDelegate> delegate_; + base::scoped_nsobject<NotificationCenterDelegate> delegate_; // Maps notification_ids to ControllerNotifications. The map owns the value, // so it must be deleted when remvoed from the map. This is typically handled diff --git a/chrome/browser/speech/tts_mac.mm b/chrome/browser/speech/tts_mac.mm index bdb9b1c..a5a8aec 100644 --- a/chrome/browser/speech/tts_mac.mm +++ b/chrome/browser/speech/tts_mac.mm @@ -4,7 +4,7 @@ #include <string> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/singleton.h" #include "base/strings/sys_string_conversions.h" #include "base/values.h" @@ -38,7 +38,7 @@ class TtsPlatformImplMac; // crash when trying to call willSpeakWord. @interface SingleUseSpeechSynthesizer : NSSpeechSynthesizer { @private - scoped_nsobject<NSString> utterance_; + base::scoped_nsobject<NSString> utterance_; bool didSpeak_; } @@ -85,8 +85,8 @@ class TtsPlatformImplMac : public TtsPlatformImpl { TtsPlatformImplMac(); virtual ~TtsPlatformImplMac(); - scoped_nsobject<SingleUseSpeechSynthesizer> speech_synthesizer_; - scoped_nsobject<ChromeTtsDelegate> delegate_; + base::scoped_nsobject<SingleUseSpeechSynthesizer> speech_synthesizer_; + base::scoped_nsobject<ChromeTtsDelegate> delegate_; int utterance_id_; std::string utterance_; bool sent_start_event_; diff --git a/chrome/browser/ssl/ssl_add_cert_handler_mac.mm b/chrome/browser/ssl/ssl_add_cert_handler_mac.mm index d12e477..bdcf6f3 100644 --- a/chrome/browser/ssl/ssl_add_cert_handler_mac.mm +++ b/chrome/browser/ssl/ssl_add_cert_handler_mac.mm @@ -8,7 +8,7 @@ #include <SecurityInterface/SFCertificateView.h> #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/cocoa/last_active_browser_cocoa.h" diff --git a/chrome/browser/storage_monitor/image_capture_device.h b/chrome/browser/storage_monitor/image_capture_device.h index 0860d9d..82fd1b5 100644 --- a/chrome/browser/storage_monitor/image_capture_device.h +++ b/chrome/browser/storage_monitor/image_capture_device.h @@ -11,8 +11,8 @@ #include "base/files/file_path.h" #include "base/mac/cocoa_protocols.h" #include "base/mac/foundation_util.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_nsobject.h" #include "base/memory/weak_ptr.h" #include "base/platform_file.h" #include "base/strings/string_util.h" @@ -58,7 +58,7 @@ class ImageCaptureDeviceListener { @interface ImageCaptureDevice : NSObject<ICCameraDeviceDelegate, ICCameraDeviceDownloadDelegate> { @private - scoped_nsobject<ICCameraDevice> camera_; + base::scoped_nsobject<ICCameraDevice> camera_; base::WeakPtr<ImageCaptureDeviceListener> listener_; bool closing_; } diff --git a/chrome/browser/storage_monitor/image_capture_device_manager.h b/chrome/browser/storage_monitor/image_capture_device_manager.h index 22297c9..bc8c09e 100644 --- a/chrome/browser/storage_monitor/image_capture_device_manager.h +++ b/chrome/browser/storage_monitor/image_capture_device_manager.h @@ -8,7 +8,7 @@ #import <Foundation/Foundation.h> #include <string> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/storage_monitor/storage_monitor.h" @protocol ICDeviceBrowserDelegate; @@ -39,7 +39,7 @@ class ImageCaptureDeviceManager { void SetNotifications(StorageMonitor::Receiver* notifications); private: - scoped_nsobject<ImageCaptureDeviceManagerImpl> device_browser_; + base::scoped_nsobject<ImageCaptureDeviceManagerImpl> device_browser_; }; } // namespace chrome diff --git a/chrome/browser/storage_monitor/image_capture_device_manager.mm b/chrome/browser/storage_monitor/image_capture_device_manager.mm index cfd5057..91191b4 100644 --- a/chrome/browser/storage_monitor/image_capture_device_manager.mm +++ b/chrome/browser/storage_monitor/image_capture_device_manager.mm @@ -25,8 +25,8 @@ chrome::ImageCaptureDeviceManager* g_image_capture_device_manager = NULL; @interface ImageCaptureDeviceManagerImpl : NSObject<ICDeviceBrowserDelegate> { @private - scoped_nsobject<ICDeviceBrowser> deviceBrowser_; - scoped_nsobject<NSMutableArray> cameras_; + base::scoped_nsobject<ICDeviceBrowser> deviceBrowser_; + base::scoped_nsobject<NSMutableArray> cameras_; // Guaranteed to outlive this class. // TODO(gbillock): Update when ownership chains go up through diff --git a/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm b/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm index 2b3a16a..f55576f 100644 --- a/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm +++ b/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm @@ -45,7 +45,7 @@ const char kTestFileContents[] = "test"; @interface MockICCameraDevice : ICCameraDevice { @private - scoped_nsobject<NSMutableArray> allMediaFiles_; + base::scoped_nsobject<NSMutableArray> allMediaFiles_; } - (void)addMediaFile:(ICCameraFile*)file; @@ -129,7 +129,7 @@ const char kTestFileContents[] = "test"; @interface MockICCameraFolder : ICCameraFolder { @private - scoped_nsobject<NSString> name_; + base::scoped_nsobject<NSString> name_; } - (id)initWithName:(NSString*)name; @@ -157,9 +157,9 @@ const char kTestFileContents[] = "test"; @interface MockICCameraFile : ICCameraFile { @private - scoped_nsobject<NSString> name_; - scoped_nsobject<NSDate> date_; - scoped_nsobject<MockICCameraFolder> parent_; + base::scoped_nsobject<NSString> name_; + base::scoped_nsobject<NSDate> date_; + base::scoped_nsobject<MockICCameraFolder> parent_; } - (id)init:(NSString*)name; @@ -262,7 +262,7 @@ class ImageCaptureDeviceManagerTest : public testing::Test { MockICCameraDevice* AttachDevice( chrome::ImageCaptureDeviceManager* manager) { // Ownership will be passed to the device browser delegate. - scoped_nsobject<MockICCameraDevice> device( + base::scoped_nsobject<MockICCameraDevice> device( [[MockICCameraDevice alloc] init]); id<ICDeviceBrowserDelegate> delegate = manager->device_browser(); [delegate deviceBrowser:nil didAddDevice:device moreComing:NO]; @@ -305,17 +305,16 @@ TEST_F(ImageCaptureDeviceManagerTest, OpenCamera) { EXPECT_FALSE(chrome::ImageCaptureDeviceManager::deviceForUUID( "nonexistent")); - scoped_nsobject<ImageCaptureDevice> camera( - [chrome::ImageCaptureDeviceManager::deviceForUUID(kDeviceId) - retain]); + base::scoped_nsobject<ImageCaptureDevice> camera( + [chrome::ImageCaptureDeviceManager::deviceForUUID(kDeviceId) retain]); [camera setListener:listener_.AsWeakPtr()]; [camera open]; - scoped_nsobject<MockICCameraFile> picture1( + base::scoped_nsobject<MockICCameraFile> picture1( [[MockICCameraFile alloc] init:@"pic1"]); [camera cameraDevice:nil didAddItem:picture1]; - scoped_nsobject<MockICCameraFile> picture2( + base::scoped_nsobject<MockICCameraFile> picture2( [[MockICCameraFile alloc] init:@"pic2"]); [camera cameraDevice:nil didAddItem:picture2]; ASSERT_EQ(2U, listener_.items().size()); @@ -339,9 +338,8 @@ TEST_F(ImageCaptureDeviceManagerTest, RemoveCamera) { manager.SetNotifications(monitor_.receiver()); ICCameraDevice* device = AttachDevice(&manager); - scoped_nsobject<ImageCaptureDevice> camera( - [chrome::ImageCaptureDeviceManager::deviceForUUID(kDeviceId) - retain]); + base::scoped_nsobject<ImageCaptureDevice> camera( + [chrome::ImageCaptureDeviceManager::deviceForUUID(kDeviceId) retain]); [camera setListener:listener_.AsWeakPtr()]; [camera open]; @@ -359,18 +357,16 @@ TEST_F(ImageCaptureDeviceManagerTest, DownloadFile) { manager.SetNotifications(monitor_.receiver()); MockICCameraDevice* device = AttachDevice(&manager); - scoped_nsobject<ImageCaptureDevice> camera( - [chrome::ImageCaptureDeviceManager::deviceForUUID(kDeviceId) - retain]); + base::scoped_nsobject<ImageCaptureDevice> camera( + [chrome::ImageCaptureDeviceManager::deviceForUUID(kDeviceId) retain]); [camera setListener:listener_.AsWeakPtr()]; [camera open]; std::string kTestFileName("pic1"); - scoped_nsobject<MockICCameraFile> picture1( - [[MockICCameraFile alloc] - init:base::SysUTF8ToNSString(kTestFileName)]); + base::scoped_nsobject<MockICCameraFile> picture1( + [[MockICCameraFile alloc] init:base::SysUTF8ToNSString(kTestFileName)]); [device addMediaFile:picture1]; [camera cameraDevice:nil didAddItem:picture1]; @@ -417,17 +413,15 @@ TEST_F(ImageCaptureDeviceManagerTest, TestSubdirectories) { manager.SetNotifications(monitor_.receiver()); MockICCameraDevice* device = AttachDevice(&manager); - scoped_nsobject<ImageCaptureDevice> camera( - [chrome::ImageCaptureDeviceManager::deviceForUUID(kDeviceId) - retain]); + base::scoped_nsobject<ImageCaptureDevice> camera( + [chrome::ImageCaptureDeviceManager::deviceForUUID(kDeviceId) retain]); [camera setListener:listener_.AsWeakPtr()]; [camera open]; std::string kTestFileName("pic1"); - scoped_nsobject<MockICCameraFile> picture1( - [[MockICCameraFile alloc] - init:base::SysUTF8ToNSString(kTestFileName)]); + base::scoped_nsobject<MockICCameraFile> picture1( + [[MockICCameraFile alloc] init:base::SysUTF8ToNSString(kTestFileName)]); [picture1 setParent:base::SysUTF8ToNSString("dir")]; [device addMediaFile:picture1]; [camera cameraDevice:nil didAddItem:picture1]; diff --git a/chrome/browser/ui/app_list/app_list_service_mac.mm b/chrome/browser/ui/app_list/app_list_service_mac.mm index 032b706..291d1d4 100644 --- a/chrome/browser/ui/app_list/app_list_service_mac.mm +++ b/chrome/browser/ui/app_list/app_list_service_mac.mm @@ -7,7 +7,7 @@ #include "base/command_line.h" #include "base/file_util.h" #include "base/lazy_instance.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/singleton.h" #include "base/message_loop.h" #include "base/observer_list.h" @@ -75,7 +75,7 @@ class AppListServiceMac : public AppListServiceImpl, AppListServiceMac() {} - scoped_nsobject<AppListWindowController> window_controller_; + base::scoped_nsobject<AppListWindowController> window_controller_; // App shim hosts observing when the app list is dismissed. In normal user // usage there should only be one. However, it can't be guaranteed, so use diff --git a/chrome/browser/ui/cocoa/about_ipc_controller_unittest.mm b/chrome/browser/ui/cocoa/about_ipc_controller_unittest.mm index 3f4eee7..e4c7bc1 100644 --- a/chrome/browser/ui/cocoa/about_ipc_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/about_ipc_controller_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/message_loop.h" #import "chrome/browser/ui/cocoa/about_ipc_controller.h" #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" @@ -46,15 +46,15 @@ TEST_F(AboutIPCControllerTest, TestFilter) { "NPObjectHell" }; for (size_t i = 0; i < arraysize(names); i++) { data.message_name = names[i]; - scoped_nsobject<CocoaLogData> cdata([[CocoaLogData alloc] - initWithLogData:data]); + base::scoped_nsobject<CocoaLogData> cdata( + [[CocoaLogData alloc] initWithLogData:data]); EXPECT_FALSE([controller filterOut:cdata.get()]); } // Flip a checkbox, see it filtered, flip back, all is fine. data.message_name = "ViewMsgFoo"; - scoped_nsobject<CocoaLogData> cdata([[CocoaLogData alloc] - initWithLogData:data]); + base::scoped_nsobject<CocoaLogData> cdata( + [[CocoaLogData alloc] initWithLogData:data]); [controller setDisplayViewMessages:NO]; EXPECT_TRUE([controller filterOut:cdata.get()]); [controller setDisplayViewMessages:YES]; diff --git a/chrome/browser/ui/cocoa/animatable_image.h b/chrome/browser/ui/cocoa/animatable_image.h index da1f297..102f337 100644 --- a/chrome/browser/ui/cocoa/animatable_image.h +++ b/chrome/browser/ui/cocoa/animatable_image.h @@ -8,7 +8,7 @@ #import <Cocoa/Cocoa.h> #import <QuartzCore/QuartzCore.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" // This class helps animate an NSImage's frame and opacity. It works by creating // a blank NSWindow in the size specified and giving it a layer on which the @@ -20,7 +20,7 @@ @interface AnimatableImage : NSWindow { @private // The image to animate. - scoped_nsobject<NSImage> image_; + base::scoped_nsobject<NSImage> image_; // The frame of the image before and after the animation. This is in this // window's coordinate system. diff --git a/chrome/browser/ui/cocoa/animatable_view.h b/chrome/browser/ui/cocoa/animatable_view.h index 91cae44..f84c2a5 100644 --- a/chrome/browser/ui/cocoa/animatable_view.h +++ b/chrome/browser/ui/cocoa/animatable_view.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/background_gradient_view.h" #import "chrome/browser/ui/cocoa/view_resizer.h" @@ -24,7 +24,7 @@ IBOutlet id delegate_; // weak, used to send animation ended messages. @private - scoped_nsobject<NSAnimation> currentAnimation_; + base::scoped_nsobject<NSAnimation> currentAnimation_; id<ViewResizer> resizeDelegate_; // weak, usually owns us } diff --git a/chrome/browser/ui/cocoa/animatable_view_unittest.mm b/chrome/browser/ui/cocoa/animatable_view_unittest.mm index e59eae9..1554ff5 100644 --- a/chrome/browser/ui/cocoa/animatable_view_unittest.mm +++ b/chrome/browser/ui/cocoa/animatable_view_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/animatable_view.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/view_resizer_pong.h" @@ -24,8 +24,8 @@ class AnimatableViewTest : public CocoaTest { [view_ setResizeDelegate:resizeDelegate_.get()]; } - scoped_nsobject<ViewResizerPong> resizeDelegate_; - scoped_nsobject<AnimatableView> view_; + base::scoped_nsobject<ViewResizerPong> resizeDelegate_; + base::scoped_nsobject<AnimatableView> view_; }; // Basic view tests (AddRemove, Display). diff --git a/chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_unittest.h b/chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_unittest.h index 2de6a78..b1f6b07 100644 --- a/chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_unittest.h +++ b/chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_unittest.h @@ -5,10 +5,10 @@ #ifndef CHROME_BROWSER_UI_COCOA_APPLESCRIPT_BOOKMARK_APPLESCRIPT_UTILS_UNITTEST_H_ #define CHROME_BROWSER_UI_COCOA_APPLESCRIPT_BOOKMARK_APPLESCRIPT_UTILS_UNITTEST_H_ -#import <objc/objc-runtime.h> #import <Cocoa/Cocoa.h> +#import <objc/objc-runtime.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/app_controller_mac.h" #import "chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.h" #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" @@ -42,9 +42,10 @@ class BookmarkAppleScriptTest : public CocoaProfileTest { virtual ~BookmarkAppleScriptTest(); virtual void SetUp() OVERRIDE; private: - scoped_nsobject<FakeAppDelegate> appDelegate_; + base::scoped_nsobject<FakeAppDelegate> appDelegate_; + protected: - scoped_nsobject<BookmarkFolderAppleScript> bookmarkBar_; + base::scoped_nsobject<BookmarkFolderAppleScript> bookmarkBar_; }; #endif // CHROME_BROWSER_UI_COCOA_APPLESCRIPT_BOOKMARK_APPLESCRIPT_UTILS_UNITTEST_H_ diff --git a/chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.mm b/chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.mm index cb978bf..a9ca820 100644 --- a/chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "base/strings/string16.h" #include "base/strings/sys_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -24,7 +24,7 @@ if (!node->is_folder()) continue; - scoped_nsobject<BookmarkFolderAppleScript> bookmarkFolder( + base::scoped_nsobject<BookmarkFolderAppleScript> bookmarkFolder( [[BookmarkFolderAppleScript alloc] initWithBookmarkNode:node]); [bookmarkFolder setContainer:self property:AppleScript::kBookmarkFoldersProperty]; @@ -95,7 +95,7 @@ if (!node->is_url()) continue; - scoped_nsobject<BookmarkItemAppleScript> bookmarkItem( + base::scoped_nsobject<BookmarkItemAppleScript> bookmarkItem( [[BookmarkItemAppleScript alloc] initWithBookmarkNode:node]); [bookmarkItem setContainer:self property:AppleScript::kBookmarkItemsProperty]; diff --git a/chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript_unittest.mm b/chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript_unittest.mm index 0bbd0b4..04bac0e 100644 --- a/chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript_unittest.mm +++ b/chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #import "chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_unittest.h" #import "chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.h" @@ -45,9 +45,9 @@ TEST_F(BookmarkFolderAppleScriptTest, InsertBookmarkFolder) { // Emulate what applescript would do when inserting a new bookmark folder. // Emulates a script like |set var to make new bookmark folder with // properties {title:"foo"}|. - scoped_nsobject<BookmarkFolderAppleScript> bookmarkFolder( + base::scoped_nsobject<BookmarkFolderAppleScript> bookmarkFolder( [[BookmarkFolderAppleScript alloc] init]); - scoped_nsobject<NSNumber> var([[bookmarkFolder.get() uniqueID] copy]); + base::scoped_nsobject<NSNumber> var([[bookmarkFolder.get() uniqueID] copy]); [bookmarkFolder.get() setTitle:@"foo"]; [bookmarkBar_.get() insertInBookmarkFolders:bookmarkFolder.get()]; @@ -66,9 +66,9 @@ TEST_F(BookmarkFolderAppleScriptTest, InsertBookmarkFolderAtPosition) { // Emulate what applescript would do when inserting a new bookmark folder. // Emulates a script like |set var to make new bookmark folder with // properties {title:"foo"} at after bookmark folder 1|. - scoped_nsobject<BookmarkFolderAppleScript> bookmarkFolder( + base::scoped_nsobject<BookmarkFolderAppleScript> bookmarkFolder( [[BookmarkFolderAppleScript alloc] init]); - scoped_nsobject<NSNumber> var([[bookmarkFolder.get() uniqueID] copy]); + base::scoped_nsobject<NSNumber> var([[bookmarkFolder.get() uniqueID] copy]); [bookmarkFolder.get() setTitle:@"foo"]; [bookmarkBar_.get() insertInBookmarkFolders:bookmarkFolder.get() atIndex:1]; @@ -119,9 +119,9 @@ TEST_F(BookmarkFolderAppleScriptTest, InsertBookmarkItem) { // Emulate what applescript would do when inserting a new bookmark folder. // Emulates a script like |set var to make new bookmark item with // properties {title:"Google", URL:"http://google.com"}|. - scoped_nsobject<BookmarkItemAppleScript> bookmarkItem( + base::scoped_nsobject<BookmarkItemAppleScript> bookmarkItem( [[BookmarkItemAppleScript alloc] init]); - scoped_nsobject<NSNumber> var([[bookmarkItem.get() uniqueID] copy]); + base::scoped_nsobject<NSNumber> var([[bookmarkItem.get() uniqueID] copy]); [bookmarkItem.get() setTitle:@"Google"]; [bookmarkItem.get() setURL:@"http://google.com"]; [bookmarkBar_.get() insertInBookmarkItems:bookmarkItem.get()]; @@ -137,7 +137,7 @@ TEST_F(BookmarkFolderAppleScriptTest, InsertBookmarkItem) { EXPECT_NSEQ(var.get(), [bi uniqueID]); // Test to see no bookmark item is created when no/invlid URL is entered. - scoped_nsobject<FakeScriptCommand> fakeScriptCommand( + base::scoped_nsobject<FakeScriptCommand> fakeScriptCommand( [[FakeScriptCommand alloc] init]); bookmarkItem.reset([[BookmarkItemAppleScript alloc] init]); [bookmarkBar_.get() insertInBookmarkItems:bookmarkItem.get()]; @@ -151,9 +151,9 @@ TEST_F(BookmarkFolderAppleScriptTest, InsertBookmarkItemAtPosition) { // Emulates a script like |set var to make new bookmark item with // properties {title:"XKCD", URL:"http://xkcd.org} // at after bookmark item 1|. - scoped_nsobject<BookmarkItemAppleScript> bookmarkItem( + base::scoped_nsobject<BookmarkItemAppleScript> bookmarkItem( [[BookmarkItemAppleScript alloc] init]); - scoped_nsobject<NSNumber> var([[bookmarkItem.get() uniqueID] copy]); + base::scoped_nsobject<NSNumber> var([[bookmarkItem.get() uniqueID] copy]); [bookmarkItem.get() setTitle:@"XKCD"]; [bookmarkItem.get() setURL:@"http://xkcd.org"]; @@ -171,7 +171,7 @@ TEST_F(BookmarkFolderAppleScriptTest, InsertBookmarkItemAtPosition) { EXPECT_NSEQ(var.get(), [bi uniqueID]); // Test to see no bookmark item is created when no/invlid URL is entered. - scoped_nsobject<FakeScriptCommand> fakeScriptCommand( + base::scoped_nsobject<FakeScriptCommand> fakeScriptCommand( [[FakeScriptCommand alloc] init]); bookmarkItem.reset([[BookmarkItemAppleScript alloc] init]); [bookmarkBar_.get() insertInBookmarkItems:bookmarkItem.get() atIndex:1]; diff --git a/chrome/browser/ui/cocoa/applescript/bookmark_item_applescript_unittest.mm b/chrome/browser/ui/cocoa/applescript/bookmark_item_applescript_unittest.mm index 44a309f..8e581f2 100644 --- a/chrome/browser/ui/cocoa/applescript/bookmark_item_applescript_unittest.mm +++ b/chrome/browser/ui/cocoa/applescript/bookmark_item_applescript_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #import "chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_unittest.h" #import "chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.h" @@ -35,7 +35,7 @@ TEST_F(BookmarkItemAppleScriptTest, GetAndSetURL) { GURL(base::SysNSStringToUTF8([item1 URL]))); // If scripter enters invalid URL. - scoped_nsobject<FakeScriptCommand> fakeScriptCommand( + base::scoped_nsobject<FakeScriptCommand> fakeScriptCommand( [[FakeScriptCommand alloc] init]); [item1 setURL:@"invalid-url.org"]; EXPECT_EQ((int)AppleScript::errInvalidURL, diff --git a/chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.mm b/chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.mm index 49fcc06..5255cd6 100644 --- a/chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.h" #include "base/logging.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #import "chrome/browser/app_controller_mac.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -31,7 +31,7 @@ return nil; } - scoped_nsobject<NSNumber> numID( + base::scoped_nsobject<NSNumber> numID( [[NSNumber alloc] initWithLongLong:model->next_node_id()]); [self setUniqueID:numID]; [self setTempTitle:@""]; @@ -58,7 +58,7 @@ // and this particular bookmark item/folder is never returned. bookmarkNode_ = aBookmarkNode; - scoped_nsobject<NSNumber> numID( + base::scoped_nsobject<NSNumber> numID( [[NSNumber alloc] initWithLongLong:aBookmarkNode->id()]); [self setUniqueID:numID]; } @@ -73,7 +73,7 @@ // and this particular bookmark item/folder is never returned. bookmarkNode_ = aBookmarkNode; - scoped_nsobject<NSNumber> numID( + base::scoped_nsobject<NSNumber> numID( [[NSNumber alloc] initWithLongLong:aBookmarkNode->id()]); [self setUniqueID:numID]; diff --git a/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.mm b/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.mm index d6e3326..6cdd204 100644 --- a/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.h" #include "base/logging.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "chrome/browser/app_controller_mac.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" @@ -30,7 +30,7 @@ if ((*browserIterator)->IsAttemptingToCloseBrowser()) continue; - scoped_nsobject<WindowAppleScript> window( + base::scoped_nsobject<WindowAppleScript> window( [[WindowAppleScript alloc] initWithBrowser:*browserIterator]); [window setContainer:NSApp property:AppleScript::kWindowsProperty]; diff --git a/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript_test.mm b/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript_test.mm index 0ac3eaa..901f7d6 100644 --- a/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript_test.mm +++ b/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript_test.mm @@ -47,8 +47,9 @@ IN_PROC_BROWSER_TEST_F(BrowserCrApplicationAppleScriptTest, InsertWindow) { // Emulate what applescript would do when creating a new window. // Emulate a script like |set var to make new window with properties // {visible:false}|. - scoped_nsobject<WindowAppleScript> aWindow([[WindowAppleScript alloc] init]); - scoped_nsobject<NSNumber> var([[aWindow.get() uniqueID] copy]); + base::scoped_nsobject<WindowAppleScript> aWindow( + [[WindowAppleScript alloc] init]); + base::scoped_nsobject<NSNumber> var([[aWindow.get() uniqueID] copy]); [aWindow.get() setValue:[NSNumber numberWithBool:YES] forKey:@"isVisible"]; [NSApp insertInAppleScriptWindows:aWindow.get()]; @@ -66,7 +67,7 @@ IN_PROC_BROWSER_TEST_F(BrowserCrApplicationAppleScriptTest, InsertWindow) { // Inserting and deleting windows. IN_PROC_BROWSER_TEST_F(BrowserCrApplicationAppleScriptTest, InsertAndDeleteWindows) { - scoped_nsobject<WindowAppleScript> aWindow; + base::scoped_nsobject<WindowAppleScript> aWindow; int count; // Create a bunch of windows. for (int i = 0; i < 5; ++i) { diff --git a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm index 7fc426f..e2a3539 100644 --- a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm @@ -7,7 +7,7 @@ #include "base/bind.h" #include "base/files/file_path.h" #include "base/logging.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "chrome/browser/printing/print_view_manager.h" #include "chrome/browser/sessions/session_id.h" @@ -60,7 +60,7 @@ void ResumeAppleEventAndSendReply(NSAppleEventManagerSuspensionID suspension_id, SessionID session; SessionID::id_type futureSessionIDOfTab = session.id() + 1; // Holds the SessionID that the new tab is going to get. - scoped_nsobject<NSNumber> numID( + base::scoped_nsobject<NSNumber> numID( [[NSNumber alloc] initWithInt:futureSessionIDOfTab]); [self setUniqueID:numID]; } @@ -85,7 +85,7 @@ void ResumeAppleEventAndSendReply(NSAppleEventManagerSuspensionID suspension_id, webContents_ = webContents; SessionTabHelper* session_tab_helper = SessionTabHelper::FromWebContents(webContents); - scoped_nsobject<NSNumber> numID( + base::scoped_nsobject<NSNumber> numID( [[NSNumber alloc] initWithInt:session_tab_helper->session_id().id()]); [self setUniqueID:numID]; } @@ -100,7 +100,7 @@ void ResumeAppleEventAndSendReply(NSAppleEventManagerSuspensionID suspension_id, webContents_ = webContents; SessionTabHelper* session_tab_helper = SessionTabHelper::FromWebContents(webContents); - scoped_nsobject<NSNumber> numID( + base::scoped_nsobject<NSNumber> numID( [[NSNumber alloc] initWithInt:session_tab_helper->session_id().id()]); [self setUniqueID:numID]; diff --git a/chrome/browser/ui/cocoa/applescript/window_applescript.mm b/chrome/browser/ui/cocoa/applescript/window_applescript.mm index fe6677f..f407d0f 100644 --- a/chrome/browser/ui/cocoa/applescript/window_applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/window_applescript.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/applescript/window_applescript.h" #include "base/logging.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/time.h" #import "chrome/browser/app_controller_mac.h" @@ -75,7 +75,7 @@ Browser::CreateParams(aProfile, chrome::HOST_DESKTOP_TYPE_NATIVE)); chrome::NewTab(browser_); browser_->window()->Show(); - scoped_nsobject<NSNumber> numID( + base::scoped_nsobject<NSNumber> numID( [[NSNumber alloc] initWithInt:browser_->session_id().id()]); [self setUniqueID:numID]; } @@ -93,7 +93,7 @@ // the applescript runtime calls appleScriptWindows in // BrowserCrApplication and this particular window is never returned. browser_ = aBrowser; - scoped_nsobject<NSNumber> numID( + base::scoped_nsobject<NSNumber> numID( [[NSNumber alloc] initWithInt:browser_->session_id().id()]); [self setUniqueID:numID]; } @@ -159,7 +159,7 @@ continue; } - scoped_nsobject<TabAppleScript> tab( + base::scoped_nsobject<TabAppleScript> tab( [[TabAppleScript alloc] initWithWebContents:webContents]); [tab setContainer:self property:AppleScript::kTabsProperty]; diff --git a/chrome/browser/ui/cocoa/applescript/window_applescript_test.mm b/chrome/browser/ui/cocoa/applescript/window_applescript_test.mm index f13b03b..f627622 100644 --- a/chrome/browser/ui/cocoa/applescript/window_applescript_test.mm +++ b/chrome/browser/ui/cocoa/applescript/window_applescript_test.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #import "chrome/browser/app_controller_mac.h" #import "chrome/browser/chrome_browser_application_mac.h" @@ -22,7 +22,7 @@ typedef InProcessBrowserTest WindowAppleScriptTest; // Create a window in default/normal mode. IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, DefaultCreation) { - scoped_nsobject<WindowAppleScript> aWindow( + base::scoped_nsobject<WindowAppleScript> aWindow( [[WindowAppleScript alloc] init]); EXPECT_TRUE(aWindow.get()); NSString* mode = [aWindow.get() mode]; @@ -32,7 +32,7 @@ IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, DefaultCreation) { // Create a window with a |NULL profile|. IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, CreationWithNoProfile) { - scoped_nsobject<WindowAppleScript> aWindow( + base::scoped_nsobject<WindowAppleScript> aWindow( [[WindowAppleScript alloc] initWithProfile:NULL]); EXPECT_FALSE(aWindow.get()); } @@ -40,7 +40,7 @@ IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, CreationWithNoProfile) { // Create a window with a particular profile. IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, CreationWithProfile) { Profile* lastProfile = [[NSApp delegate] lastProfile]; - scoped_nsobject<WindowAppleScript> aWindow( + base::scoped_nsobject<WindowAppleScript> aWindow( [[WindowAppleScript alloc] initWithProfile:lastProfile]); EXPECT_TRUE(aWindow.get()); EXPECT_TRUE([aWindow.get() uniqueID]); @@ -48,14 +48,14 @@ IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, CreationWithProfile) { // Create a window with no |Browser*|. IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, CreationWithNoBrowser) { - scoped_nsobject<WindowAppleScript> aWindow( + base::scoped_nsobject<WindowAppleScript> aWindow( [[WindowAppleScript alloc] initWithBrowser:NULL]); EXPECT_FALSE(aWindow.get()); } // Create a window with |Browser*| already present. IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, CreationWithBrowser) { - scoped_nsobject<WindowAppleScript> aWindow( + base::scoped_nsobject<WindowAppleScript> aWindow( [[WindowAppleScript alloc] initWithBrowser:browser()]); EXPECT_TRUE(aWindow.get()); EXPECT_TRUE([aWindow.get() uniqueID]); @@ -63,7 +63,7 @@ IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, CreationWithBrowser) { // Tabs within the window. IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, Tabs) { - scoped_nsobject<WindowAppleScript> aWindow( + base::scoped_nsobject<WindowAppleScript> aWindow( [[WindowAppleScript alloc] initWithBrowser:browser()]); NSArray* tabs = [aWindow.get() tabs]; EXPECT_EQ(1U, [tabs count]); @@ -78,10 +78,10 @@ IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, InsertTab) { // Emulate what applescript would do when creating a new tab. // Emulates a script like |set var to make new tab with // properties URL:"http://google.com"}|. - scoped_nsobject<TabAppleScript> aTab([[TabAppleScript alloc] init]); - scoped_nsobject<NSNumber> var([[aTab.get() uniqueID] copy]); + base::scoped_nsobject<TabAppleScript> aTab([[TabAppleScript alloc] init]); + base::scoped_nsobject<NSNumber> var([[aTab.get() uniqueID] copy]); [aTab.get() setURL:@"http://google.com"]; - scoped_nsobject<WindowAppleScript> aWindow( + base::scoped_nsobject<WindowAppleScript> aWindow( [[WindowAppleScript alloc] initWithBrowser:browser()]); [aWindow.get() insertInTabs:aTab.get()]; @@ -100,10 +100,10 @@ IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, InsertTabAtPosition) { // Emulate what applescript would do when creating a new tab. // Emulates a script like |set var to make new tab with // properties URL:"http://google.com"} at before tab 1|. - scoped_nsobject<TabAppleScript> aTab([[TabAppleScript alloc] init]); - scoped_nsobject<NSNumber> var([[aTab.get() uniqueID] copy]); + base::scoped_nsobject<TabAppleScript> aTab([[TabAppleScript alloc] init]); + base::scoped_nsobject<NSNumber> var([[aTab.get() uniqueID] copy]); [aTab.get() setURL:@"http://google.com"]; - scoped_nsobject<WindowAppleScript> aWindow( + base::scoped_nsobject<WindowAppleScript> aWindow( [[WindowAppleScript alloc] initWithBrowser:browser()]); [aWindow.get() insertInTabs:aTab.get() atIndex:0]; @@ -118,9 +118,9 @@ IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, InsertTabAtPosition) { // Inserting and deleting tabs. IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, InsertAndDeleteTabs) { - scoped_nsobject<WindowAppleScript> aWindow( + base::scoped_nsobject<WindowAppleScript> aWindow( [[WindowAppleScript alloc] initWithBrowser:browser()]); - scoped_nsobject<TabAppleScript> aTab; + base::scoped_nsobject<TabAppleScript> aTab; int count; for (int i = 0; i < 5; ++i) { for (int j = 0; j < 3; ++j) { @@ -143,7 +143,7 @@ IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, InsertAndDeleteTabs) { // Getting and setting values from the NSWindow. IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, NSWindowTest) { - scoped_nsobject<WindowAppleScript> aWindow( + base::scoped_nsobject<WindowAppleScript> aWindow( [[WindowAppleScript alloc] initWithBrowser:browser()]); [aWindow.get() setValue:[NSNumber numberWithBool:YES] forKey:@"isMiniaturized"]; @@ -155,9 +155,9 @@ IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, NSWindowTest) { // Getting and setting the active tab. IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, ActiveTab) { - scoped_nsobject<WindowAppleScript> aWindow( + base::scoped_nsobject<WindowAppleScript> aWindow( [[WindowAppleScript alloc] initWithBrowser:browser()]); - scoped_nsobject<TabAppleScript> aTab([[TabAppleScript alloc] init]); + base::scoped_nsobject<TabAppleScript> aTab([[TabAppleScript alloc] init]); [aWindow.get() insertInTabs:aTab.get()]; [aWindow.get() setActiveTabIndex:[NSNumber numberWithInt:2]]; EXPECT_EQ(2, [[aWindow.get() activeTabIndex] intValue]); @@ -168,9 +168,9 @@ IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, ActiveTab) { // Order of windows. IN_PROC_BROWSER_TEST_F(WindowAppleScriptTest, WindowOrder) { - scoped_nsobject<WindowAppleScript> window2( + base::scoped_nsobject<WindowAppleScript> window2( [[WindowAppleScript alloc] initWithBrowser:browser()]); - scoped_nsobject<WindowAppleScript> window1( + base::scoped_nsobject<WindowAppleScript> window1( [[WindowAppleScript alloc] init]); EXPECT_EQ([window1.get() windowComparator:window2.get()], NSOrderedAscending); EXPECT_EQ([window2.get() windowComparator:window1.get()], diff --git a/chrome/browser/ui/cocoa/autofill/autofill_account_chooser.h b/chrome/browser/ui/cocoa/autofill/autofill_account_chooser.h index c1b1116..67d2bff 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_account_chooser.h +++ b/chrome/browser/ui/cocoa/autofill/autofill_account_chooser.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" namespace autofill { class AutofillDialogController; @@ -17,9 +17,9 @@ namespace autofill { @interface AutofillAccountChooser : NSView { @private - scoped_nsobject<NSButton> link_; - scoped_nsobject<MenuButton> popup_; - scoped_nsobject<NSImageView> icon_; + base::scoped_nsobject<NSButton> link_; + base::scoped_nsobject<MenuButton> popup_; + base::scoped_nsobject<NSImageView> icon_; autofill::AutofillDialogController* controller_; // weak. } diff --git a/chrome/browser/ui/cocoa/autofill/autofill_account_chooser.mm b/chrome/browser/ui/cocoa/autofill/autofill_account_chooser.mm index c3904ae..35111d2 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_account_chooser.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_account_chooser.mm @@ -26,10 +26,10 @@ void AddMenuItem(NSMenu *menu, id target, SEL selector, NSString* title, return; } - scoped_nsobject<NSMenuItem> item([[NSMenuItem alloc] - initWithTitle:title - action:selector - keyEquivalent:@""]); + base::scoped_nsobject<NSMenuItem> item( + [[NSMenuItem alloc] initWithTitle:title + action:selector + keyEquivalent:@""]); [item setTag:tag]; [menu addItem:item]; [item setTarget:target]; @@ -63,7 +63,7 @@ void AddMenuItem(NSMenu *menu, id target, SEL selector, NSString* title, gfx::SkColorToCalibratedNSColor(chrome_style::GetLinkColor())]; popup_.reset([[MenuButton alloc] initWithFrame:NSZeroRect]); - scoped_nsobject<DownArrowPopupMenuCell> popupCell( + base::scoped_nsobject<DownArrowPopupMenuCell> popupCell( [[DownArrowPopupMenuCell alloc] initTextCell:@""]); [popup_ setCell:popupCell]; @@ -75,7 +75,7 @@ void AddMenuItem(NSMenu *menu, id target, SEL selector, NSString* title, [popupCell setImage:popupImage forButtonState:image_button_cell::kDefaultState]; - scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@""]); + base::scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@""]); [menu setAutoenablesItems:NO]; [popup_ setAttachedMenu:menu]; diff --git a/chrome/browser/ui/cocoa/autofill/autofill_account_chooser_unittest.mm b/chrome/browser/ui/cocoa/autofill/autofill_account_chooser_unittest.mm index e6ce376..d4717cb 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_account_chooser_unittest.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_account_chooser_unittest.mm @@ -27,7 +27,7 @@ class AutofillAccountChooserTest : public ui::CocoaTest { } protected: - scoped_nsobject<AutofillAccountChooser> view_; + base::scoped_nsobject<AutofillAccountChooser> view_; testing::NiceMock<autofill::MockAutofillDialogController> controller_; private: diff --git a/chrome/browser/ui/cocoa/autofill/autofill_details_container.h b/chrome/browser/ui/cocoa/autofill/autofill_details_container.h index 79c5804..aa99561 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_details_container.h +++ b/chrome/browser/ui/cocoa/autofill/autofill_details_container.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/autofill/autofill_dialog_types.h" #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h" @@ -20,7 +20,8 @@ class AutofillDialogController; // UI controller for details for current payment instrument. @interface AutofillDetailsContainer : NSViewController<AutofillLayout> { @private - scoped_nsobject<NSMutableArray> details_; // The individual detail sections. + base::scoped_nsobject<NSMutableArray> details_; // The individual detail + // sections. autofill::AutofillDialogController* controller_; // Not owned. } diff --git a/chrome/browser/ui/cocoa/autofill/autofill_details_container.mm b/chrome/browser/ui/cocoa/autofill/autofill_details_container.mm index 5a88597..4f07578 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_details_container.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_details_container.mm @@ -19,7 +19,7 @@ } - (void)addSection:(autofill::DialogSection)section { - scoped_nsobject<AutofillSectionContainer> sectionContainer( + base::scoped_nsobject<AutofillSectionContainer> sectionContainer( [[AutofillSectionContainer alloc] initWithController:controller_ forSection:section]); [details_ addObject:sectionContainer]; diff --git a/chrome/browser/ui/cocoa/autofill/autofill_details_container_unittest.mm b/chrome/browser/ui/cocoa/autofill/autofill_details_container_unittest.mm index 4841710..7cbc178 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_details_container_unittest.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_details_container_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/autofill/autofill_details_container.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/autofill/mock_autofill_dialog_controller.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -21,7 +21,7 @@ class AutofillDetailsContainerTest : public ui::CocoaTest { } protected: - scoped_nsobject<AutofillDetailsContainer> container_; + base::scoped_nsobject<AutofillDetailsContainer> container_; testing::NiceMock<autofill::MockAutofillDialogController> controller_; }; diff --git a/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.h b/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.h index 710fd55..917e2ec 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.h +++ b/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_COCOA_H_ #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_COCOA_H_ -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/ui/autofill/autofill_dialog_types.h" #include "chrome/browser/ui/autofill/autofill_dialog_view.h" @@ -66,7 +66,7 @@ class AutofillDialogCocoa : public AutofillDialogView, private: scoped_ptr<ConstrainedWindowMac> constrained_window_; - scoped_nsobject<AutofillDialogWindowController> sheet_controller_; + base::scoped_nsobject<AutofillDialogWindowController> sheet_controller_; // The controller |this| queries for logic and state. AutofillDialogController* controller_; @@ -80,9 +80,9 @@ class AutofillDialogCocoa : public AutofillDialogView, content::WebContents* webContents_; // weak. autofill::AutofillDialogCocoa* autofillDialog_; // weak. - scoped_nsobject<AutofillMainContainer> mainContainer_; - scoped_nsobject<AutofillSignInContainer> signInContainer_; - scoped_nsobject<AutofillAccountChooser> accountChooser_; + base::scoped_nsobject<AutofillMainContainer> mainContainer_; + base::scoped_nsobject<AutofillSignInContainer> signInContainer_; + base::scoped_nsobject<AutofillAccountChooser> accountChooser_; } // Designated initializer. The WebContents cannot be NULL. diff --git a/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm b/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm index 797368b..de12066 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm @@ -5,10 +5,9 @@ #include "chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.h" #include "base/mac/bundle_locations.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" #include "chrome/browser/ui/chrome_style.h" -#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" #include "chrome/browser/ui/chrome_style.h" #include "chrome/browser/ui/chrome_style.h" #import "chrome/browser/ui/cocoa/autofill/autofill_account_chooser.h" @@ -16,6 +15,7 @@ #import "chrome/browser/ui/cocoa/autofill/autofill_main_container.h" #import "chrome/browser/ui/cocoa/autofill/autofill_section_container.h" #import "chrome/browser/ui/cocoa/autofill/autofill_sign_in_container.h" +#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.h" #import "ui/base/cocoa/flipped_view.h" @@ -49,7 +49,7 @@ void AutofillDialogCocoa::Show() { sheet_controller_.reset([[AutofillDialogWindowController alloc] initWithWebContents:controller_->web_contents() autofillDialog:this]); - scoped_nsobject<CustomConstrainedWindowSheet> sheet( + base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:[sheet_controller_ window]]); constrained_window_.reset( @@ -136,7 +136,7 @@ void AutofillDialogCocoa::OnConstrainedWindowClosed( autofillDialog:(autofill::AutofillDialogCocoa*)autofillDialog { DCHECK(webContents); - scoped_nsobject<ConstrainedWindowCustomWindow> window( + base::scoped_nsobject<ConstrainedWindowCustomWindow> window( [[ConstrainedWindowCustomWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater]); @@ -169,7 +169,7 @@ void AutofillDialogCocoa::OnConstrainedWindowClosed( // This needs a flipped content view because otherwise the size // animation looks odd. However, replacing the contentView for constrained // windows does not work - it does custom rendering. - scoped_nsobject<NSView> flippedContentView( + base::scoped_nsobject<NSView> flippedContentView( [[FlippedView alloc] initWithFrame:NSZeroRect]); [flippedContentView setSubviews: @[accountChooser_, [mainContainer_ view], [signInContainer_ view]]]; diff --git a/chrome/browser/ui/cocoa/autofill/autofill_main_container.h b/chrome/browser/ui/cocoa/autofill/autofill_main_container.h index b05a713..9767a25 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_main_container.h +++ b/chrome/browser/ui/cocoa/autofill/autofill_main_container.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/autofill/autofill_dialog_types.h" #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h" @@ -25,8 +25,8 @@ namespace autofill { // Might dynamically add and remove other elements. @interface AutofillMainContainer : NSViewController<AutofillLayout> { @private - scoped_nsobject<GTMWidthBasedTweaker> buttonContainer_; - scoped_nsobject<AutofillDetailsContainer> detailsContainer_; + base::scoped_nsobject<GTMWidthBasedTweaker> buttonContainer_; + base::scoped_nsobject<AutofillDetailsContainer> detailsContainer_; AutofillDialogWindowController* target_; autofill::AutofillDialogController* controller_; // Not owned. } diff --git a/chrome/browser/ui/cocoa/autofill/autofill_main_container.mm b/chrome/browser/ui/cocoa/autofill/autofill_main_container.mm index 80b050cc..7d9fddb 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_main_container.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_main_container.mm @@ -35,7 +35,7 @@ - (void)loadView { [self buildWindowButtonsForFrame:NSZeroRect]; - scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:NSZeroRect]); [view setAutoresizesSubviews:YES]; [view setSubviews:@[buttonContainer_]]; [self setView:view]; @@ -77,7 +77,7 @@ [buttonContainer_ setAutoresizingMask:(NSViewMinXMargin | NSViewMaxYMargin)]; - scoped_nsobject<NSButton> button( + base::scoped_nsobject<NSButton> button( [[ConstrainedWindowButton alloc] initWithFrame:NSZeroRect]); [button setTitle:l10n_util::GetNSStringWithFixup(IDS_CANCEL)]; [button setKeyEquivalent:kKeyEquivalentEscape]; @@ -105,7 +105,7 @@ } - (void)layoutButtons { - scoped_nsobject<GTMUILocalizerAndLayoutTweaker> layoutTweaker( + base::scoped_nsobject<GTMUILocalizerAndLayoutTweaker> layoutTweaker( [[GTMUILocalizerAndLayoutTweaker alloc] init]); [layoutTweaker tweakUI:buttonContainer_]; } diff --git a/chrome/browser/ui/cocoa/autofill/autofill_main_container_unittest.mm b/chrome/browser/ui/cocoa/autofill/autofill_main_container_unittest.mm index a52103d..ac24cb7 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_main_container_unittest.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_main_container_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/autofill/autofill_main_container.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/autofill/mock_autofill_dialog_controller.h" #import "chrome/browser/ui/cocoa/autofill/autofill_account_chooser.h" #include "testing/gtest/include/gtest/gtest.h" @@ -23,7 +23,7 @@ class AutofillMainContainerTest : public ui::CocoaTest { } protected: - scoped_nsobject<AutofillMainContainer> container_; + base::scoped_nsobject<AutofillMainContainer> container_; testing::NiceMock<autofill::MockAutofillDialogController> controller_; }; @@ -48,4 +48,4 @@ TEST_F(AutofillMainContainerTest, SubViews) { } EXPECT_TRUE(hasButtons); -}
\ No newline at end of file +} diff --git a/chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.h b/chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.h index 99a4095..e570646 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.h +++ b/chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.h @@ -8,7 +8,7 @@ #include <vector> #include "base/basictypes.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/autofill/autofill_popup_view.h" @class AutofillPopupViewCocoa; diff --git a/chrome/browser/ui/cocoa/autofill/autofill_section_container.h b/chrome/browser/ui/cocoa/autofill/autofill_section_container.h index 1abaab0..62ff41b 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_section_container.h +++ b/chrome/browser/ui/cocoa/autofill/autofill_section_container.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/autofill/autofill_dialog_types.h" #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h" @@ -27,13 +27,14 @@ namespace autofill { @interface AutofillSectionContainer : NSViewController<AutofillLayout> { @private - scoped_nsobject<LayoutView> inputs_; - scoped_nsobject<MenuButton> suggestButton_; - scoped_nsobject<AutofillSuggestionContainer> suggestContainer_; - scoped_nsobject<NSTextField> label_; - scoped_nsobject<AutofillSectionView> view_; // The view for the container. + base::scoped_nsobject<LayoutView> inputs_; + base::scoped_nsobject<MenuButton> suggestButton_; + base::scoped_nsobject<AutofillSuggestionContainer> suggestContainer_; + base::scoped_nsobject<NSTextField> label_; + base::scoped_nsobject<AutofillSectionView> view_; // The view for the + // container. - scoped_nsobject<MenuController> menuController_; + base::scoped_nsobject<MenuController> menuController_; autofill::DialogSection section_; autofill::AutofillDialogController* controller_; // Not owned. } diff --git a/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm b/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm index 73ef309..2da1f4cb 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm @@ -198,7 +198,7 @@ void BreakSuggestionText(const string16& text, } - (NSTextField*)makeDetailSectionLabel:(NSString*)labelText { - scoped_nsobject<NSTextField> label([[NSTextField alloc] init]); + base::scoped_nsobject<NSTextField> label([[NSTextField alloc] init]); [label setFont: [[NSFontManager sharedFontManager] convertFont:[label font] toHaveTrait:NSBoldFontMask]]; @@ -211,7 +211,7 @@ void BreakSuggestionText(const string16& text, } - (MenuButton*)makeSuggestionButton { - scoped_nsobject<MenuButton> button([[MenuButton alloc] init]); + base::scoped_nsobject<MenuButton> button([[MenuButton alloc] init]); [button setOpenMenuOnClick:YES]; [button setBordered:NO]; @@ -245,7 +245,7 @@ void BreakSuggestionText(const string16& text, const autofill::DetailInputs& inputs = controller_->RequestedFieldsForSection(section_); - scoped_nsobject<LayoutView> view([[LayoutView alloc] init]); + base::scoped_nsobject<LayoutView> view([[LayoutView alloc] init]); [view setLayoutManager: scoped_ptr<SimpleGridLayout>(new SimpleGridLayout(view))]; SimpleGridLayout* layout = [view layoutManager]; @@ -274,7 +274,7 @@ void BreakSuggestionText(const string16& text, ui::ComboboxModel* input_model = controller_->ComboboxModelForAutofillType(input.type); if (input_model) { - scoped_nsobject<NSPopUpButton> popup( + base::scoped_nsobject<NSPopUpButton> popup( [[NSPopUpButton alloc] initWithFrame:NSZeroRect pullsDown:YES]); for (int i = 0; i < input_model->GetItemCount(); ++i) { [popup addItemWithTitle: @@ -285,7 +285,7 @@ void BreakSuggestionText(const string16& text, [popup setTag:reinterpret_cast<NSInteger>(&input)]; layout->AddView(popup); } else { - scoped_nsobject<AutofillTextField> field( + base::scoped_nsobject<AutofillTextField> field( [[AutofillTextField alloc] init]); [[field cell] setPlaceholderString: l10n_util::GetNSStringWithFixup(input.placeholder_text_rid)]; diff --git a/chrome/browser/ui/cocoa/autofill/autofill_section_container_unittest.mm b/chrome/browser/ui/cocoa/autofill/autofill_section_container_unittest.mm index 651d0c05..12c8199 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_section_container_unittest.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_section_container_unittest.mm @@ -5,15 +5,15 @@ #import "chrome/browser/ui/cocoa/autofill/autofill_section_container.h" #include "base/mac/foundation_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/autofill/autofill_dialog_models.h" #include "chrome/browser/ui/autofill/mock_autofill_dialog_controller.h" #import "chrome/browser/ui/cocoa/autofill/layout_view.h" #import "chrome/browser/ui/cocoa/menu_button.h" #include "grit/generated_resources.h" -#include "testing/gtest_mac.h" #include "testing/gtest/include/gtest/gtest.h" +#include "testing/gtest_mac.h" #include "testing/platform_test.h" #include "ui/base/models/combobox_model.h" #include "ui/base/models/simple_menu_model.h" @@ -41,7 +41,7 @@ class AutofillSectionContainerTest : public ui::CocoaTest { } protected: - scoped_nsobject<AutofillSectionContainer> container_; + base::scoped_nsobject<AutofillSectionContainer> container_; testing::NiceMock<autofill::MockAutofillDialogController> controller_; }; @@ -163,4 +163,4 @@ TEST_F(AutofillSectionContainerTest, SuggestionsPopulatedByController) { EXPECT_NSEQ(@"a", [[menu itemAtIndex:1] title]); EXPECT_NSEQ(@"b", [[menu itemAtIndex:2] title]); -}
\ No newline at end of file +} diff --git a/chrome/browser/ui/cocoa/autofill/autofill_section_view_unittest.mm b/chrome/browser/ui/cocoa/autofill/autofill_section_view_unittest.mm index 2515c71..8cad9d7 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_section_view_unittest.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_section_view_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/autofill/autofill_section_view.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest_mac.h" @@ -74,8 +74,8 @@ class AutofillSectionViewTest : public ui::CocoaTest { } protected: - scoped_nsobject<AutofillSectionView> view_; - scoped_nsobject<NSBitmapImageRep> bitmap_; + base::scoped_nsobject<AutofillSectionView> view_; + base::scoped_nsobject<NSBitmapImageRep> bitmap_; scoped_ptr<gfx::ScopedNSGraphicsContextSaveGState> saved_context_; NSGraphicsContext* context_; }; diff --git a/chrome/browser/ui/cocoa/autofill/autofill_sign_in_container_unittest.mm b/chrome/browser/ui/cocoa/autofill/autofill_sign_in_container_unittest.mm index 83220df..77f8a4b 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_sign_in_container_unittest.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_sign_in_container_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/autofill/autofill_sign_in_container.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/autofill/mock_autofill_dialog_controller.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" @@ -60,7 +60,7 @@ class AutofillSignInContainerTest : public ChromeRenderViewHostTestHarness { } protected: - scoped_nsobject<AutofillSignInContainer> container_; + base::scoped_nsobject<AutofillSignInContainer> container_; testing::NiceMock<autofill::MockAutofillDialogController> controller_; CocoaTestHelperWindow* test_window_; }; diff --git a/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.h b/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.h index 6253a20..6fe11d7 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.h +++ b/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h" namespace autofill { @@ -20,16 +20,16 @@ namespace autofill { @interface AutofillSuggestionContainer : NSViewController<AutofillLayout> { @private // The label that holds the suggestion description text. - scoped_nsobject<NSTextField> label_; + base::scoped_nsobject<NSTextField> label_; // The second (and longer) line of text that describes the suggestion. - scoped_nsobject<NSTextField> label2_; + base::scoped_nsobject<NSTextField> label2_; // The icon that comes just before |label_|. - scoped_nsobject<NSImageView> iconImageView_; + base::scoped_nsobject<NSImageView> iconImageView_; // The input set by ShowTextfield. - scoped_nsobject<AutofillTextField> inputField_; + base::scoped_nsobject<AutofillTextField> inputField_; autofill::AutofillDialogController* controller_; // Not owned. } diff --git a/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.mm b/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.mm index 6522e69..9989f83 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.mm @@ -8,7 +8,7 @@ #include <cmath> #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" #include "chrome/browser/ui/chrome_style.h" @@ -38,7 +38,7 @@ NSRect CenterVertically(NSRect rect1, NSRect rect2) { @implementation AutofillSuggestionContainer - (NSTextField*)makeDetailSectionLabel:(NSString*)labelText { - scoped_nsobject<NSTextField> label([[NSTextField alloc] init]); + base::scoped_nsobject<NSTextField> label([[NSTextField alloc] init]); [label setFont: [[NSFontManager sharedFontManager] convertFont:[label font] toHaveTrait:NSBoldFontMask]]; @@ -60,14 +60,14 @@ NSRect CenterVertically(NSRect rect1, NSRect rect2) { inputField_.reset([[AutofillTextField alloc] initWithFrame:NSZeroRect]); [inputField_ setHidden:YES]; - scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:NSZeroRect]); [view setSubviews: @[iconImageView_, label_, inputField_, label2_ ]]; [self setView:view]; } - (NSTextField*)createLabelWithFrame:(NSRect)frame { - scoped_nsobject<NSTextField> label( + base::scoped_nsobject<NSTextField> label( [[NSTextField alloc] initWithFrame:frame]); [label setEditable:NO]; [label setDrawsBackground:NO]; @@ -174,4 +174,4 @@ NSRect CenterVertically(NSRect rect1, NSRect rect2) { [[self view] setFrameSize:preferredContainerSize]; } -@end
\ No newline at end of file +@end diff --git a/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container_unittest.mm b/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container_unittest.mm index 08b3848..e535d41 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container_unittest.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container_unittest.mm @@ -20,7 +20,7 @@ class AutofillSuggestionContainerTest : public ui::CocoaTest { } protected: - scoped_nsobject<AutofillSuggestionContainer> container_; + base::scoped_nsobject<AutofillSuggestionContainer> container_; }; } // namespace @@ -47,4 +47,4 @@ TEST_F(AutofillSuggestionContainerTest, HasSubviews) { EXPECT_EQ(2, num_text_fields); EXPECT_TRUE(has_edit_field); EXPECT_TRUE(has_icon); -}
\ No newline at end of file +} diff --git a/chrome/browser/ui/cocoa/autofill/autofill_textfield.h b/chrome/browser/ui/cocoa/autofill/autofill_textfield.h index 57fcea7..264ad29 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_textfield.h +++ b/chrome/browser/ui/cocoa/autofill/autofill_textfield.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include <base/memory/scoped_nsobject.h> +#include <base/mac/scoped_nsobject.h> // Text field used for text inputs inside Autofill. // Provide both dog ear and red outline when the contents are marked invalid. @@ -17,7 +17,7 @@ @interface AutofillTextFieldCell : NSTextFieldCell { @private BOOL invalid_; - scoped_nsobject<NSImage> icon_; + base::scoped_nsobject<NSImage> icon_; } @property(assign, nonatomic) BOOL invalid; diff --git a/chrome/browser/ui/cocoa/autofill/autofill_textfield_unittest.mm b/chrome/browser/ui/cocoa/autofill/autofill_textfield_unittest.mm index ed6fa79..f32e636 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_textfield_unittest.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_textfield_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/autofill/autofill_textfield.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -20,7 +20,7 @@ class AutofillTextFieldTest : public CocoaTest { } protected: - scoped_nsobject<AutofillTextField> textfield_; + base::scoped_nsobject<AutofillTextField> textfield_; DISALLOW_COPY_AND_ASSIGN(AutofillTextFieldTest); }; diff --git a/chrome/browser/ui/cocoa/autofill/down_arrow_popup_menu_cell_unittest.mm b/chrome/browser/ui/cocoa/autofill/down_arrow_popup_menu_cell_unittest.mm index d41b496..4d878d6 100644 --- a/chrome/browser/ui/cocoa/autofill/down_arrow_popup_menu_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/autofill/down_arrow_popup_menu_cell_unittest.mm @@ -6,7 +6,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/cocoa/autofill/autofill_dialog_constants.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -19,13 +19,13 @@ class DownArrowPopupMenuCellTest : public ui::CocoaTest { DownArrowPopupMenuCellTest() { NSRect frame = NSMakeRect(0, 0, 50, 30); view_.reset([[NSButton alloc] initWithFrame:frame]); - scoped_nsobject<DownArrowPopupMenuCell> cell( + base::scoped_nsobject<DownArrowPopupMenuCell> cell( [[DownArrowPopupMenuCell alloc] initTextCell:@"Testing"]); [view_ setCell:cell.get()]; [[test_window() contentView] addSubview:view_]; } protected: - scoped_nsobject<NSButton> view_; + base::scoped_nsobject<NSButton> view_; private: DISALLOW_COPY_AND_ASSIGN(DownArrowPopupMenuCellTest); @@ -50,7 +50,8 @@ TEST_F(DownArrowPopupMenuCellTest, Defaults) { ASSERT_TRUE([cell isKindOfClass:[DownArrowPopupMenuCell class]]); NSRect rect = NSMakeRect(0, 0, 11, 17); - scoped_nsobject<NSImage> image([[NSImage alloc] initWithSize:rect.size]); + base::scoped_nsobject<NSImage> image( + [[NSImage alloc] initWithSize:rect.size]); [cell setImage:image forButtonState:image_button_cell::kDefaultState]; [view_ setTitle:@"Testing"]; diff --git a/chrome/browser/ui/cocoa/autofill/layout_view_unittest.mm b/chrome/browser/ui/cocoa/autofill/layout_view_unittest.mm index abfcd227..c56c9f8 100644 --- a/chrome/browser/ui/cocoa/autofill/layout_view_unittest.mm +++ b/chrome/browser/ui/cocoa/autofill/layout_view_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/autofill/layout_view.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/cocoa/autofill/simple_grid_layout.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -24,7 +24,7 @@ class LayoutViewTest : public ui::CocoaTest { } protected: - scoped_nsobject<LayoutView> view_; + base::scoped_nsobject<LayoutView> view_; SimpleGridLayout* layout_; // weak, owned by view_. }; @@ -40,9 +40,9 @@ TEST_F(LayoutViewTest, setFrameInvokesLayout) { cs->AddColumn(0.4); cs->AddColumn(0.6); layout_->StartRow(0, 0); - scoped_nsobject<NSView> childView1( + base::scoped_nsobject<NSView> childView1( [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 0, 45)]); - scoped_nsobject<NSView> childView2( + base::scoped_nsobject<NSView> childView2( [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 20, 55)]); layout_->AddView(childView1); layout_->AddView(childView2); @@ -62,4 +62,4 @@ TEST_F(LayoutViewTest, setFrameInvokesLayout) { subview = [[view_ subviews] objectAtIndex:1]; EXPECT_FLOAT_EQ(24, NSWidth([subview frame])); EXPECT_FLOAT_EQ(55, NSHeight([subview frame])); -}
\ No newline at end of file +} diff --git a/chrome/browser/ui/cocoa/autofill/simple_grid_layout_unittest.mm b/chrome/browser/ui/cocoa/autofill/simple_grid_layout_unittest.mm index d529211..da517c7 100644 --- a/chrome/browser/ui/cocoa/autofill/simple_grid_layout_unittest.mm +++ b/chrome/browser/ui/cocoa/autofill/simple_grid_layout_unittest.mm @@ -5,7 +5,7 @@ #include "chrome/browser/ui/cocoa/autofill/simple_grid_layout.h" #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "testing/gtest/include/gtest/gtest.h" namespace { @@ -19,15 +19,15 @@ class ColumnLayout : public SimpleGridLayout { class LayoutTest : public testing::Test { public: - scoped_nsobject<NSView> CreateViewWithWidth(float width) { + base::scoped_nsobject<NSView> CreateViewWithWidth(float width) { NSRect frame = NSMakeRect(0, 0, width, 0); - scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:frame]); + base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:frame]); return view; } - scoped_nsobject<NSView> CreateViewWithHeight(float height) { + base::scoped_nsobject<NSView> CreateViewWithHeight(float height) { NSRect frame = NSMakeRect(0, 0, 0, height); - scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:frame]); + base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:frame]); return view; } }; @@ -107,7 +107,7 @@ TEST_F(LayoutTest, AddPaddingRow) { ColumnSet* cs; cs = layout.AddRow(); cs->AddColumn(1.0f); - scoped_nsobject<NSView> view1 = CreateViewWithHeight(30.0f); + base::scoped_nsobject<NSView> view1 = CreateViewWithHeight(30.0f); layout.AddView(view1); layout.AddPaddingRow(20); @@ -115,7 +115,7 @@ TEST_F(LayoutTest, AddPaddingRow) { cs = layout.AddRow(); cs->AddColumn(1.0f); EXPECT_EQ(3, layout.num_rows()); - scoped_nsobject<NSView> view2 = CreateViewWithHeight(10.0f); + base::scoped_nsobject<NSView> view2 = CreateViewWithHeight(10.0f); layout.AddView(view2); layout.SizeRowsAndColumns(0.0f); @@ -132,17 +132,17 @@ TEST_F(LayoutTest, RowsAccomodateHeightOfAllElements) { layout.GetLastValidColumnSet()->AddColumn(0.6f); layout.GetLastValidColumnSet()->AddColumn(0.6f); - scoped_nsobject<NSView> view1 = CreateViewWithHeight(37.0f); + base::scoped_nsobject<NSView> view1 = CreateViewWithHeight(37.0f); layout.AddView(view1); layout.SizeRowsAndColumns(0.0f); EXPECT_FLOAT_EQ(37.0f, layout.GetRowHeight(0)); - scoped_nsobject<NSView> view2 = CreateViewWithHeight(26.0f); + base::scoped_nsobject<NSView> view2 = CreateViewWithHeight(26.0f); layout.AddView(view2); layout.SizeRowsAndColumns(0.0f); EXPECT_FLOAT_EQ(37.0f, layout.GetRowHeight(0)); - scoped_nsobject<NSView> view3 = CreateViewWithHeight(42.0f); + base::scoped_nsobject<NSView> view3 = CreateViewWithHeight(42.0f); layout.AddView(view3); layout.SizeRowsAndColumns(0.0f); EXPECT_FLOAT_EQ(42.0f, layout.GetRowHeight(0)); @@ -153,12 +153,12 @@ TEST_F(LayoutTest, SizeRowsAdjustsRowLocations) { layout.AddRow(); layout.GetLastValidColumnSet()->AddColumn(0.6f); - scoped_nsobject<NSView> view1 = CreateViewWithHeight(30.0f); + base::scoped_nsobject<NSView> view1 = CreateViewWithHeight(30.0f); layout.AddView(view1); layout.AddRow(); layout.GetLastValidColumnSet()->AddColumn(0.6f); - scoped_nsobject<NSView> view2 = CreateViewWithHeight(40.0f); + base::scoped_nsobject<NSView> view2 = CreateViewWithHeight(40.0f); layout.AddView(view2); layout.SizeRowsAndColumns(0.0f); @@ -174,17 +174,17 @@ TEST_F(LayoutTest, SimpleGridLayoutAdjustsViews) { layout.GetLastValidColumnSet()->AddPaddingColumn(30); layout.GetLastValidColumnSet()->AddColumn(0.4f); - scoped_nsobject<NSView> view1 = CreateViewWithHeight(22.0f); - scoped_nsobject<NSView> view2 = CreateViewWithHeight(20.0f); + base::scoped_nsobject<NSView> view1 = CreateViewWithHeight(22.0f); + base::scoped_nsobject<NSView> view2 = CreateViewWithHeight(20.0f); layout.AddView(view1); layout.AddView(view2); layout.AddRow(); layout.GetLastValidColumnSet()->AddColumn(0.6f); - scoped_nsobject<NSView> view3 = CreateViewWithHeight(18.0f); + base::scoped_nsobject<NSView> view3 = CreateViewWithHeight(18.0f); layout.AddView(view3); - scoped_nsobject<NSView> host_view = CreateViewWithWidth(150.0f); + base::scoped_nsobject<NSView> host_view = CreateViewWithWidth(150.0f); layout.Layout(host_view); EXPECT_FLOAT_EQ(72.0f, NSWidth([view1 frame])); @@ -214,7 +214,7 @@ TEST_F(LayoutTest, SimpleGridLayoutHeightForWidth) layout.AddRow(); layout.GetLastValidColumnSet()->AddColumn(0.6f); - scoped_nsobject<NSView> view1 = CreateViewWithHeight(22.0f); + base::scoped_nsobject<NSView> view1 = CreateViewWithHeight(22.0f); layout.AddView(view1); EXPECT_FLOAT_EQ(22.0f, layout.GetPreferredHeightForWidth(100.0)); @@ -223,7 +223,7 @@ TEST_F(LayoutTest, SimpleGridLayoutHeightForWidth) layout.AddRow(); layout.GetLastValidColumnSet()->AddColumn(0.6f); - scoped_nsobject<NSView> view2 = CreateViewWithHeight(13.0f); + base::scoped_nsobject<NSView> view2 = CreateViewWithHeight(13.0f); layout.AddView(view2); EXPECT_FLOAT_EQ(47.0f, layout.GetPreferredHeightForWidth(100.0)); } @@ -308,7 +308,7 @@ TEST_F(LayoutTest, AddViewSkipsPaddingColumns) { layout.GetLastValidColumnSet()->AddColumn(0.4f); EXPECT_EQ(0, layout.next_column()); - scoped_nsobject<NSView> view1 = CreateViewWithWidth(37.0f); + base::scoped_nsobject<NSView> view1 = CreateViewWithWidth(37.0f); layout.AddView(view1); EXPECT_EQ(2, layout.next_column()); } @@ -321,12 +321,12 @@ TEST_F(LayoutTest, ColumnLayoutAdjustsViews) { layout.GetLastValidColumnSet()->AddPaddingColumn(30); layout.GetLastValidColumnSet()->AddColumn(0.4f); - scoped_nsobject<NSView> view1 = CreateViewWithWidth(37.0f); - scoped_nsobject<NSView> view2 = CreateViewWithWidth(42.0f); + base::scoped_nsobject<NSView> view1 = CreateViewWithWidth(37.0f); + base::scoped_nsobject<NSView> view2 = CreateViewWithWidth(42.0f); layout.AddView(view1); layout.AddView(view2); - scoped_nsobject<NSView> host_view = CreateViewWithWidth(150.0f); + base::scoped_nsobject<NSView> host_view = CreateViewWithWidth(150.0f); layout.Layout(host_view); EXPECT_FLOAT_EQ(72.0f, NSWidth([view1 frame])); diff --git a/chrome/browser/ui/cocoa/background_gradient_view_unittest.mm b/chrome/browser/ui/cocoa/background_gradient_view_unittest.mm index d1cda6c..b7e9697 100644 --- a/chrome/browser/ui/cocoa/background_gradient_view_unittest.mm +++ b/chrome/browser/ui/cocoa/background_gradient_view_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/background_gradient_view.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" @@ -36,7 +36,7 @@ class BackgroundGradientViewTest : public CocoaTest { public: BackgroundGradientViewTest() { NSRect frame = NSMakeRect(0, 0, 100, 30); - scoped_nsobject<BackgroundGradientSubClassTest> view; + base::scoped_nsobject<BackgroundGradientSubClassTest> view; view.reset([[BackgroundGradientSubClassTest alloc] initWithFrame:frame]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; diff --git a/chrome/browser/ui/cocoa/base_bubble_controller.mm b/chrome/browser/ui/cocoa/base_bubble_controller.mm index 91eaa98..c7ef5b6 100644 --- a/chrome/browser/ui/cocoa/base_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/base_bubble_controller.mm @@ -7,7 +7,7 @@ #include "base/logging.h" #include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/string_util.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h" #import "chrome/browser/ui/cocoa/info_bubble_view.h" @@ -76,7 +76,7 @@ DCHECK(![[self window] delegate]); [theWindow setDelegate:self]; - scoped_nsobject<InfoBubbleView> contentView( + base::scoped_nsobject<InfoBubbleView> contentView( [[InfoBubbleView alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)]); [theWindow setContentView:contentView.get()]; bubble_ = contentView.get(); @@ -123,7 +123,7 @@ - (NSBox*)separatorWithFrame:(NSRect)frame { frame.size.height = 1.0; - scoped_nsobject<NSBox> spacer([[NSBox alloc] initWithFrame:frame]); + base::scoped_nsobject<NSBox> spacer([[NSBox alloc] initWithFrame:frame]); [spacer setBoxType:NSBoxSeparator]; [spacer setBorderType:NSLineBorder]; [spacer setAlphaValue:0.2]; diff --git a/chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm index 307034c..feccd6f 100644 --- a/chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/base_bubble_controller.h" #include "base/mac/mac_util.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/info_bubble_view.h" #import "chrome/browser/ui/cocoa/run_loop_testing.h" @@ -44,7 +44,7 @@ class BaseBubbleControllerTest : public CocoaTest { } public: - scoped_nsobject<NSWindow> bubbleWindow_; + base::scoped_nsobject<NSWindow> bubbleWindow_; BaseBubbleController* controller_; }; @@ -118,12 +118,12 @@ TEST_F(BaseBubbleControllerTest, AnchorAlignRightArrow) { // the key window changes. TEST_F(BaseBubbleControllerTest, ResignKeyCloses) { // Closing the bubble will autorelease the controller. - scoped_nsobject<BaseBubbleController> keep_alive([controller_ retain]); + base::scoped_nsobject<BaseBubbleController> keep_alive([controller_ retain]); NSWindow* bubble_window = [controller_ window]; EXPECT_FALSE([bubble_window isVisible]); - scoped_nsobject<NSWindow> other_window( + base::scoped_nsobject<NSWindow> other_window( [[NSWindow alloc] initWithContentRect:NSMakeRect(500, 500, 500, 500) styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered @@ -163,7 +163,7 @@ TEST_F(BaseBubbleControllerTest, LionClickOutsideCloses) { return; // Closing the bubble will autorelease the controller. - scoped_nsobject<BaseBubbleController> keep_alive([controller_ retain]); + base::scoped_nsobject<BaseBubbleController> keep_alive([controller_ retain]); NSWindow* window = [controller_ window]; EXPECT_FALSE([window isVisible]); diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller_unittest.mm index 1e0a3ab..2f56924 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge_unittest.mm index a0f2ef9..0a9650d 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge_unittest.mm @@ -26,7 +26,7 @@ typedef std::pair<GURL,WindowOpenDisposition> OpenInfo; // Oddly, we are our own delegate. @interface FakeBookmarkBarController : BookmarkBarController { @public - scoped_nsobject<NSMutableArray> callbacks_; + base::scoped_nsobject<NSMutableArray> callbacks_; std::vector<OpenInfo> opens_; } @end @@ -98,15 +98,15 @@ class BookmarkBarBridgeTest : public CocoaProfileTest { TEST_F(BookmarkBarBridgeTest, TestRedirect) { BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile()); - scoped_nsobject<NSView> parentView([[NSView alloc] - initWithFrame:NSMakeRect(0,0,100,100)]); - scoped_nsobject<NSView> webView([[NSView alloc] - initWithFrame:NSMakeRect(0,0,100,100)]); - scoped_nsobject<NSView> infoBarsView( - [[NSView alloc] initWithFrame:NSMakeRect(0,0,100,100)]); + base::scoped_nsobject<NSView> parentView( + [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]); + base::scoped_nsobject<NSView> webView( + [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]); + base::scoped_nsobject<NSView> infoBarsView( + [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]); - scoped_nsobject<FakeBookmarkBarController> - controller([[FakeBookmarkBarController alloc] initWithBrowser:browser()]); + base::scoped_nsobject<FakeBookmarkBarController> controller( + [[FakeBookmarkBarController alloc] initWithBrowser:browser()]); EXPECT_TRUE(controller.get()); scoped_ptr<BookmarkBarBridge> bridge(new BookmarkBarBridge(profile(), controller.get(), diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h index 234f663..78ef62d 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h @@ -9,7 +9,7 @@ #include <map> #import "base/mac/cocoa_protocols.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" @@ -183,13 +183,13 @@ willAnimateFromState:(BookmarkBar::State)oldState std::map<int32,int64> menuTagMap_; // Our bookmark buttons, ordered from L-->R. - scoped_nsobject<NSMutableArray> buttons_; + base::scoped_nsobject<NSMutableArray> buttons_; // The folder image so we can use one copy for all buttons - scoped_nsobject<NSImage> folderImage_; + base::scoped_nsobject<NSImage> folderImage_; // The default image, so we can use one copy for all buttons. - scoped_nsobject<NSImage> defaultImage_; + base::scoped_nsobject<NSImage> defaultImage_; // If the bar is disabled, we hide it and ignore show/hide commands. // Set when using fullscreen mode. @@ -206,7 +206,7 @@ willAnimateFromState:(BookmarkBar::State)oldState id<ViewResizer> resizeDelegate_; // weak // Logic for dealing with a click on a bookmark folder button. - scoped_nsobject<BookmarkFolderTarget> folderTarget_; + base::scoped_nsobject<BookmarkFolderTarget> folderTarget_; // A controller for a pop-up bookmark folder window (custom menu). // This is not a scoped_nsobject because it owns itself (when its @@ -224,17 +224,17 @@ willAnimateFromState:(BookmarkBar::State)oldState NSRect originalImportBookmarksRect_; // Original, pre-resized field rect. // "Other bookmarks" button on the right side. - scoped_nsobject<BookmarkButton> otherBookmarksButton_; + base::scoped_nsobject<BookmarkButton> otherBookmarksButton_; // "Apps" button to the right of "Other bookmarks". - scoped_nsobject<BookmarkButton> appsPageShortcutButton_; + base::scoped_nsobject<BookmarkButton> appsPageShortcutButton_; // When doing a drag, this is folder button "hovered over" which we // may want to open after a short delay. There are cases where a // mouse-enter can open a folder (e.g. if the menus are "active") // but that doesn't use this variable or need a delay so "hover" is // the wrong term. - scoped_nsobject<BookmarkButton> hoverButton_; + base::scoped_nsobject<BookmarkButton> hoverButton_; // We save the view width when we add bookmark buttons. This lets // us avoid a rebuild until we've grown the window bigger than our @@ -273,7 +273,8 @@ willAnimateFromState:(BookmarkBar::State)oldState CGFloat insertionPos_; // Controller responsible for all bookmark context menus. - scoped_nsobject<BookmarkContextMenuCocoaController> contextMenuController_; + base::scoped_nsobject<BookmarkContextMenuCocoaController> + contextMenuController_; } @property(readonly, nonatomic) BookmarkBar::State currentState; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm index 3c43a37..d9f3890 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm @@ -1073,8 +1073,8 @@ void RecordAppLaunch(Profile* profile, GURL url) { BookmarkButtonCell* cell = [self cellForBookmarkNode:node]; NSRect frame = [self frameForBookmarkButtonFromCell:cell xOffset:xOffset]; - scoped_nsobject<BookmarkButton> - button([[BookmarkButton alloc] initWithFrame:frame]); + base::scoped_nsobject<BookmarkButton> button( + [[BookmarkButton alloc] initWithFrame:frame]); DCHECK(button.get()); // [NSButton setCell:] warns to NOT use setCell: other than in the diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm index 7769928..0301ba3 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm @@ -6,7 +6,7 @@ #include "base/basictypes.h" #include "base/command_line.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" @@ -30,8 +30,8 @@ #include "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #include "testing/platform_test.h" -#include "third_party/ocmock/gtest_support.h" #import "third_party/ocmock/OCMock/OCMock.h" +#include "third_party/ocmock/gtest_support.h" #include "ui/base/cocoa/animation_utils.h" #include "ui/base/test/cocoa_test_event_utils.h" #include "ui/base/theme_provider.h" @@ -204,7 +204,7 @@ class FakeTheme : public ui::ThemeProvider { public: FakeTheme(NSColor* color) : color_(color) {} - scoped_nsobject<NSColor> color_; + base::scoped_nsobject<NSColor> color_; virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const OVERRIDE { return NULL; @@ -292,8 +292,8 @@ namespace { class BookmarkBarControllerTestBase : public CocoaProfileTest { public: - scoped_nsobject<NSView> parent_view_; - scoped_nsobject<ViewResizerPong> resizeDelegate_; + base::scoped_nsobject<NSView> parent_view_; + base::scoped_nsobject<ViewResizerPong> resizeDelegate_; virtual void SetUp() { CocoaProfileTest::SetUp(); @@ -335,8 +335,8 @@ class BookmarkBarControllerTestBase : public CocoaProfileTest { class BookmarkBarControllerTest : public BookmarkBarControllerTestBase { public: - scoped_nsobject<NSButtonCell> cell_; - scoped_nsobject<BookmarkBarControllerNoOpen> bar_; + base::scoped_nsobject<NSButtonCell> cell_; + base::scoped_nsobject<BookmarkBarControllerNoOpen> bar_; virtual void SetUp() { BookmarkBarControllerTestBase::SetUp(); @@ -496,7 +496,7 @@ TEST_F(BookmarkBarControllerTest, StateChanges) { // Make sure we're watching for frame change notifications. TEST_F(BookmarkBarControllerTest, FrameChangeNotification) { - scoped_nsobject<BookmarkBarControllerTogglePong> bar; + base::scoped_nsobject<BookmarkBarControllerTogglePong> bar; bar.reset( [[BookmarkBarControllerTogglePong alloc] initWithBrowser:browser() @@ -731,9 +731,10 @@ TEST_F(BookmarkBarControllerTest, OpenBookmark) { GURL gurl("http://walla.walla.ding.dong.com"); scoped_ptr<BookmarkNode> node(new BookmarkNode(gurl)); - scoped_nsobject<BookmarkButtonCell> cell([[BookmarkButtonCell alloc] init]); + base::scoped_nsobject<BookmarkButtonCell> cell( + [[BookmarkButtonCell alloc] init]); [cell setBookmarkNode:node.get()]; - scoped_nsobject<BookmarkButton> button([[BookmarkButton alloc] init]); + base::scoped_nsobject<BookmarkButton> button([[BookmarkButton alloc] init]); [button setCell:cell.get()]; [cell setRepresentedObject:[NSValue valueWithPointer:node.get()]]; @@ -830,7 +831,7 @@ TEST_F(BookmarkBarControllerTest, TestButtonLimits) { // Make sure that each button we add marches to the right and does not // overlap with the previous one. TEST_F(BookmarkBarControllerTest, TestButtonMarch) { - scoped_nsobject<NSMutableArray> cells([[NSMutableArray alloc] init]); + base::scoped_nsobject<NSMutableArray> cells([[NSMutableArray alloc] init]); CGFloat widths[] = { 10, 10, 100, 10, 500, 500, 80000, 60000, 1, 345 }; for (unsigned int i = 0; i < arraysize(widths); i++) { @@ -1168,7 +1169,7 @@ TEST_F(BookmarkBarControllerTest, TestClearOnDealloc) { bookmark_utils::AddIfNotBookmarked(model, gurls[i], titles[i]); // Get and retain the buttons so we can examine them after dealloc. - scoped_nsobject<NSArray> buttons([[bar_ buttons] retain]); + base::scoped_nsobject<NSArray> buttons([[bar_ buttons] retain]); EXPECT_EQ([buttons count], arraysize(titles)); // Make sure that everything is set. @@ -1702,9 +1703,9 @@ class BookmarkBarControllerNotificationTest : public CocoaProfileTest { // Do not add the bar to a window, yet. } - scoped_nsobject<NSView> parent_view_; - scoped_nsobject<ViewResizerPong> resizeDelegate_; - scoped_nsobject<BookmarkBarControllerNotificationPong> bar_; + base::scoped_nsobject<NSView> parent_view_; + base::scoped_nsobject<ViewResizerPong> resizeDelegate_; + base::scoped_nsobject<BookmarkBarControllerNotificationPong> bar_; }; TEST_F(BookmarkBarControllerNotificationTest, DeregistersForNotifications) { @@ -1740,7 +1741,7 @@ TEST_F(BookmarkBarControllerNotificationTest, DeregistersForNotifications) { class BookmarkBarControllerDragDropTest : public BookmarkBarControllerTestBase { public: - scoped_nsobject<BookmarkBarControllerDragData> bar_; + base::scoped_nsobject<BookmarkBarControllerDragData> bar_; virtual void SetUp() { BookmarkBarControllerTestBase::SetUp(); @@ -1891,7 +1892,7 @@ TEST_F(BookmarkBarControllerDragDropTest, DragBookmarkData) { // Gen up some dragging data. const BookmarkNode* newNode = other->GetChild(2); [bar_ setDragDataNode:newNode]; - scoped_nsobject<FakeDragInfo> dragInfo([[FakeDragInfo alloc] init]); + base::scoped_nsobject<FakeDragInfo> dragInfo([[FakeDragInfo alloc] init]); [dragInfo setDropLocation:[targetButton center]]; [bar_ dragBookmarkData:(id<NSDraggingInfo>)dragInfo.get()]; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell_unittest.mm index 3b1eb0a..7418039 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "grit/ui_resources.h" @@ -15,7 +15,7 @@ class BookmarkBarFolderButtonCellTest : public CocoaTest { // Basic creation. TEST_F(BookmarkBarFolderButtonCellTest, Create) { - scoped_nsobject<BookmarkBarFolderButtonCell> cell; + base::scoped_nsobject<BookmarkBarFolderButtonCell> cell; cell.reset([[BookmarkBarFolderButtonCell buttonCellForNode:nil text:nil image:nil @@ -25,21 +25,21 @@ TEST_F(BookmarkBarFolderButtonCellTest, Create) { TEST_F(BookmarkBarFolderButtonCellTest, FaviconPositioning) { NSRect frame = NSMakeRect(0, 0, 50, 30); - scoped_nsobject<NSButton> view([[NSButton alloc] initWithFrame:frame]); - scoped_nsobject<NSButton> folder_view( + base::scoped_nsobject<NSButton> view([[NSButton alloc] initWithFrame:frame]); + base::scoped_nsobject<NSButton> folder_view( [[NSButton alloc] initWithFrame:frame]); ASSERT_TRUE(view.get()); ASSERT_TRUE(folder_view.get()); ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - scoped_nsobject<NSImage> image( + base::scoped_nsobject<NSImage> image( rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON).CopyNSImage()); ASSERT_TRUE(image.get()); - scoped_nsobject<BookmarkButtonCell> cell( + base::scoped_nsobject<BookmarkButtonCell> cell( [[BookmarkButtonCell alloc] initTextCell:@"Testing"]); - scoped_nsobject<BookmarkBarFolderButtonCell> folder_cell( + base::scoped_nsobject<BookmarkBarFolderButtonCell> folder_cell( [[BookmarkBarFolderButtonCell buttonCellForNode:nil text:@"Testing" image:image diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h index 746552c..ec27fea 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" #import "ui/base/cocoa/tracking_area.h" @@ -27,7 +27,7 @@ class Profile; BookmarkButtonControllerProtocol> { @private // The button whose click opened us. - scoped_nsobject<BookmarkButton> parentButton_; + base::scoped_nsobject<BookmarkButton> parentButton_; // Bookmark bar folder controller chains are torn down in two ways: // 1. Clicking "outside" the folder (see use of the NSEvent local event @@ -57,13 +57,13 @@ class Profile; // Our parent controller, if we are a nested folder, otherwise nil. // Strong to insure the object lives as long as we need it. - scoped_nsobject<BookmarkBarFolderController> parentController_; + base::scoped_nsobject<BookmarkBarFolderController> parentController_; // The main bar controller from whence we or a parent sprang. BookmarkBarController* barController_; // WEAK: It owns us. // Our buttons. We do not have buttons for nested folders. - scoped_nsobject<NSMutableArray> buttons_; + base::scoped_nsobject<NSMutableArray> buttons_; // The scroll view that contains our main button view (below). IBOutlet NSScrollView* scrollView_; @@ -102,10 +102,10 @@ class Profile; // We model hover state as a state machine with specific allowable // transitions. |hoverState_| is the state of this machine at any // given time. - scoped_nsobject<BookmarkBarFolderHoverState> hoverState_; + base::scoped_nsobject<BookmarkBarFolderHoverState> hoverState_; // Logic for dealing with a click on a bookmark folder button. - scoped_nsobject<BookmarkFolderTarget> folderTarget_; + base::scoped_nsobject<BookmarkFolderTarget> folderTarget_; // A controller for a pop-up bookmark folder window (custom menu). // We (self) are the parentController_ for our folderController_. diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm index 3999e7a..2ada86e 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "base/basictypes.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" @@ -129,7 +129,7 @@ void DeleteBookmark(BookmarkButton* button, Profile* profile) { class BookmarkBarFolderControllerTest : public CocoaProfileTest { public: - scoped_nsobject<BookmarkBarControllerChildFolderRedirect> bar_; + base::scoped_nsobject<BookmarkBarControllerChildFolderRedirect> bar_; const BookmarkNode* folderA_; // Owned by model. const BookmarkNode* longTitleNode_; // Owned by model. @@ -217,7 +217,7 @@ class BookmarkBarFolderControllerTest : public CocoaProfileTest { }; TEST_F(BookmarkBarFolderControllerTest, InitCreateAndDelete) { - scoped_nsobject<BookmarkBarFolderController> bbfc; + base::scoped_nsobject<BookmarkBarFolderController> bbfc; bbfc.reset(SimpleBookmarkBarFolderController()); // Make sure none of the buttons overlap, that all are inside @@ -251,7 +251,7 @@ TEST_F(BookmarkBarFolderControllerTest, InitCreateAndDelete) { // Make sure closing of the window releases the controller. // (e.g. valgrind shouldn't complain if we do this). TEST_F(BookmarkBarFolderControllerTest, ReleaseOnClose) { - scoped_nsobject<BookmarkBarFolderController> bbfc; + base::scoped_nsobject<BookmarkBarFolderController> bbfc; bbfc.reset(SimpleBookmarkBarFolderController()); EXPECT_TRUE(bbfc.get()); @@ -264,7 +264,7 @@ TEST_F(BookmarkBarFolderControllerTest, BasicPosition) { EXPECT_TRUE(parentButton); // If parent is a BookmarkBarController, grow down. - scoped_nsobject<BookmarkBarFolderController> bbfc; + base::scoped_nsobject<BookmarkBarFolderController> bbfc; bbfc.reset([[BookmarkBarFolderController alloc] initWithParentButton:parentButton parentController:nil @@ -289,7 +289,7 @@ TEST_F(BookmarkBarFolderControllerTest, BasicPosition) { EXPECT_LT(shifted.x, pt.x); // If parent is a BookmarkBarFolderController, grow right. - scoped_nsobject<BookmarkBarFolderController> bbfc2; + base::scoped_nsobject<BookmarkBarFolderController> bbfc2; bbfc2.reset([[BookmarkBarFolderController alloc] initWithParentButton:[[bbfc buttons] objectAtIndex:0] parentController:bbfc.get() @@ -323,7 +323,7 @@ TEST_F(BookmarkBarFolderControllerTest, PositionRightLeftRight) { EXPECT_TRUE(parentButton); // Open them all. - scoped_nsobject<NSMutableArray> folder_controller_array; + base::scoped_nsobject<NSMutableArray> folder_controller_array; folder_controller_array.reset([[NSMutableArray array] retain]); for (i=0; i<count; i++) { BookmarkBarFolderControllerNoLevel* bbfcl = @@ -368,7 +368,7 @@ TEST_F(BookmarkBarFolderControllerTest, PositionRightLeftRight) { } TEST_F(BookmarkBarFolderControllerTest, DropDestination) { - scoped_nsobject<BookmarkBarFolderController> bbfc; + base::scoped_nsobject<BookmarkBarFolderController> bbfc; bbfc.reset(SimpleBookmarkBarFolderController()); EXPECT_TRUE(bbfc.get()); @@ -404,7 +404,7 @@ TEST_F(BookmarkBarFolderControllerTest, DropDestination) { } TEST_F(BookmarkBarFolderControllerTest, OpenFolder) { - scoped_nsobject<BookmarkBarFolderController> bbfc; + base::scoped_nsobject<BookmarkBarFolderController> bbfc; bbfc.reset(SimpleBookmarkBarFolderController()); EXPECT_TRUE(bbfc.get()); @@ -430,7 +430,7 @@ TEST_F(BookmarkBarFolderControllerTest, OpenFolder) { } TEST_F(BookmarkBarFolderControllerTest, DeleteOpenFolder) { - scoped_nsobject<BookmarkBarFolderController> parent_controller( + base::scoped_nsobject<BookmarkBarFolderController> parent_controller( SimpleBookmarkBarFolderController()); // Open a folder. @@ -445,7 +445,7 @@ TEST_F(BookmarkBarFolderControllerTest, DeleteOpenFolder) { } TEST_F(BookmarkBarFolderControllerTest, ChildFolderCallbacks) { - scoped_nsobject<BookmarkBarFolderControllerPong> bbfc; + base::scoped_nsobject<BookmarkBarFolderControllerPong> bbfc; bbfc.reset(SimpleBookmarkBarFolderController()); EXPECT_TRUE(bbfc.get()); [bar_ setChildFolderDelegate:bbfc.get()]; @@ -463,7 +463,7 @@ TEST_F(BookmarkBarFolderControllerTest, ChildFolderCallbacks) { // Make sure bookmark folders have variable widths. TEST_F(BookmarkBarFolderControllerTest, ChildFolderWidth) { - scoped_nsobject<BookmarkBarFolderController> bbfc; + base::scoped_nsobject<BookmarkBarFolderController> bbfc; bbfc.reset(SimpleBookmarkBarFolderController()); EXPECT_TRUE(bbfc.get()); @@ -482,7 +482,7 @@ TEST_F(BookmarkBarFolderControllerTest, ChildFolderWidth) { // Simple scrolling tests. // Currently flaky due to a changed definition of the correct menu boundaries. TEST_F(BookmarkBarFolderControllerTest, DISABLED_SimpleScroll) { - scoped_nsobject<BookmarkBarFolderController> bbfc; + base::scoped_nsobject<BookmarkBarFolderController> bbfc; NSRect screenFrame = [[NSScreen mainScreen] visibleFrame]; CGFloat screenHeight = NSHeight(screenFrame); int nodecount = AddLotsOfNodes(); @@ -572,7 +572,7 @@ TEST_F(BookmarkBarFolderControllerTest, DISABLED_SimpleScroll) { // Folder menu sizing and placement while deleting bookmarks // and scrolling tests. TEST_F(BookmarkBarFolderControllerTest, MenuPlacementWhileScrollingDeleting) { - scoped_nsobject<BookmarkBarFolderController> bbfc; + base::scoped_nsobject<BookmarkBarFolderController> bbfc; AddLotsOfNodes(); bbfc.reset(SimpleBookmarkBarFolderController()); [bbfc showWindow:bbfc.get()]; @@ -625,7 +625,7 @@ TEST_F(BookmarkBarFolderControllerTest, MenuPlacementWhileScrollingDeleting) { // Make sure that we return the correct browser window. TEST_F(BookmarkBarFolderControllerTest, BrowserWindow) { - scoped_nsobject<BookmarkBarFolderController> controller( + base::scoped_nsobject<BookmarkBarFolderController> controller( SimpleBookmarkBarFolderController()); EXPECT_EQ([bar_ browserWindow], [controller browserWindow]); } @@ -680,9 +680,9 @@ TEST_F(BookmarkBarFolderControllerTest, BrowserWindow) { class BookmarkBarFolderControllerMenuTest : public CocoaProfileTest { public: - scoped_nsobject<NSView> parent_view_; - scoped_nsobject<ViewResizerPong> resizeDelegate_; - scoped_nsobject<BookmarkBarController> bar_; + base::scoped_nsobject<NSView> parent_view_; + base::scoped_nsobject<ViewResizerPong> resizeDelegate_; + base::scoped_nsobject<BookmarkBarController> bar_; virtual void SetUp() { CocoaProfileTest::SetUp(); @@ -1379,7 +1379,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, DragBookmarkData) { // Pop open a folder. BookmarkButton* button = [bar_ buttonWithTitleEqualTo:@"2f"]; - scoped_nsobject<BookmarkBarFolderControllerDragData> folderController; + base::scoped_nsobject<BookmarkBarFolderControllerDragData> folderController; folderController.reset([[BookmarkBarFolderControllerDragData alloc] initWithParentButton:button parentController:nil @@ -1392,7 +1392,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, DragBookmarkData) { // Gen up some dragging data. const BookmarkNode* newNode = other->GetChild(2); [folderController setDragDataNode:newNode]; - scoped_nsobject<FakedDragInfo> dragInfo([[FakedDragInfo alloc] init]); + base::scoped_nsobject<FakedDragInfo> dragInfo([[FakedDragInfo alloc] init]); [dragInfo setDropLocation:[targetButton top]]; [folderController dragBookmarkData:(id<NSDraggingInfo>)dragInfo.get()]; @@ -1438,7 +1438,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, DragBookmarkDataToTrash) { // Pop open a folder. BookmarkButton* button = [bar_ buttonWithTitleEqualTo:@"2f"]; - scoped_nsobject<BookmarkBarFolderControllerDragData> folderController; + base::scoped_nsobject<BookmarkBarFolderControllerDragData> folderController; folderController.reset([[BookmarkBarFolderControllerDragData alloc] initWithParentButton:button parentController:nil diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state.h index 20ea39e..8d8dea7 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state.h @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" // Hover state machine. Encapsulates the hover state for @@ -39,7 +39,7 @@ // Like normal menus, hovering over a folder button causes it to // open. This variable is set when a hover is initiated (but has // not necessarily fired yet). - scoped_nsobject<BookmarkButton> hoverButton_; + base::scoped_nsobject<BookmarkButton> hoverButton_; // We model hover state as a state machine with specific allowable // transitions. |hoverState_| is the state of this machine at any diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state_unittest.mm index bb39d7d..7c441be 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state_unittest.mm @@ -19,14 +19,14 @@ class BookmarkBarFolderHoverStateTest : public CocoaTest { // these specific state transitions. TEST_F(BookmarkBarFolderHoverStateTest, HoverState) { base::MessageLoopForUI message_loop; - scoped_nsobject<BookmarkBarFolderHoverState> bbfhs; + base::scoped_nsobject<BookmarkBarFolderHoverState> bbfhs; bbfhs.reset([[BookmarkBarFolderHoverState alloc] init]); // Initial state. EXPECT_FALSE([bbfhs hoverButton]); ASSERT_EQ(kHoverStateClosed, [bbfhs hoverState]); - scoped_nsobject<BookmarkButton> button; + base::scoped_nsobject<BookmarkButton> button; button.reset([[BookmarkButton alloc] initWithFrame:NSMakeRect(0, 0, 20, 20)]); // Test transition from closed to opening. diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view_unittest.mm index 0550eab..b48b86a 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -133,9 +133,9 @@ class BookmarkBarFolderViewTest : public CocoaProfileTest { return [mock_button retain]; } - scoped_nsobject<id> mock_controller_; - scoped_nsobject<BookmarkBarFolderView> view_; - scoped_nsobject<id> mock_button_; + base::scoped_nsobject<id> mock_controller_; + base::scoped_nsobject<BookmarkBarFolderView> view_; + base::scoped_nsobject<id> mock_button_; }; TEST_F(BookmarkBarFolderViewTest, BookmarkButtonDragAndDrop) { diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.h index 21115db..285bc25 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_FOLDER_WINDOW_H_ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" // Window for a bookmark folder "menu". This menu pops up when you diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.mm index 06a6112..3d6a25b 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.mm @@ -5,11 +5,11 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.h" #import "base/logging.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h" -#import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" #import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" +#import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" using bookmarks::kBookmarkBarMenuCornerRadius; @@ -60,13 +60,13 @@ using bookmarks::kBookmarkBarMenuCornerRadius; NSColor* endColor = [startColor gtm_colorAdjustedFor:GTMColorationLightPenumbra faded:YES]; - scoped_nsobject<NSGradient> gradient( - [[NSGradient alloc] initWithColorsAndLocations:startColor, 0.0, - midColor, 0.25, - endColor, 0.5, - midColor, 0.75, - startColor, 1.0, - nil]); + base::scoped_nsobject<NSGradient> gradient( + [[NSGradient alloc] initWithColorsAndLocations:startColor, 0.0, + midColor, 0.25, + endColor, 0.5, + midColor, 0.75, + startColor, 1.0, + nil]); [gradient drawInBezierPath:bezier angle:0.0]; } diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window_unittest.mm index d1d1005..9fb9b52 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window_unittest.mm @@ -12,7 +12,7 @@ class BookmarkBarFolderWindowTest : public CocoaTest { }; TEST_F(BookmarkBarFolderWindowTest, Borderless) { - scoped_nsobject<BookmarkBarFolderWindow> window_; + base::scoped_nsobject<BookmarkBarFolderWindow> window_; window_.reset([[BookmarkBarFolderWindow alloc] initWithContentRect:NSMakeRect(0,0,20,20) styleMask:0 @@ -29,8 +29,8 @@ class BookmarkBarFolderWindowContentViewTest : public CocoaTest { initWithFrame:NSMakeRect(0, 0, 100, 100)]); [[test_window() contentView] addSubview:view_.get()]; } - scoped_nsobject<BookmarkBarFolderWindowContentView> view_; - scoped_nsobject<BookmarkBarFolderWindowScrollView> scroll_view_; + base::scoped_nsobject<BookmarkBarFolderWindowContentView> view_; + base::scoped_nsobject<BookmarkBarFolderWindowScrollView> scroll_view_; }; TEST_VIEW(BookmarkBarFolderWindowContentViewTest, view_); @@ -43,7 +43,7 @@ class BookmarkBarFolderWindowScrollViewTest : public CocoaTest { initWithFrame:NSMakeRect(0, 0, 100, 100)]); [[test_window() contentView] addSubview:scroll_view_.get()]; } - scoped_nsobject<BookmarkBarFolderWindowScrollView> scroll_view_; + base::scoped_nsobject<BookmarkBarFolderWindowScrollView> scroll_view_; }; TEST_VIEW(BookmarkBarFolderWindowScrollViewTest, scroll_view_); diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm index e8208970..f7a984b 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/themes/theme_service.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" @@ -94,14 +94,14 @@ class BookmarkBarToolbarViewTest : public CocoaTest { BookmarkBarToolbarViewTest() { controller_.reset([[DrawDetachedBarFakeController alloc] init]); NSRect frame = NSMakeRect(0, 0, 400, 40); - scoped_nsobject<BookmarkBarToolbarView> view( + base::scoped_nsobject<BookmarkBarToolbarView> view( [[BookmarkBarToolbarView alloc] initWithFrame:frame]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; [view_ setController:controller_.get()]; } - scoped_nsobject<DrawDetachedBarFakeController> controller_; + base::scoped_nsobject<DrawDetachedBarFakeController> controller_; BookmarkBarToolbarView* view_; }; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_unittest.mm index 902bb7f..8456dfa 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -201,7 +201,7 @@ class BookmarkBarViewTest : public CocoaProfileTest { view_.reset([[BookmarkBarView alloc] init]); } - scoped_nsobject<BookmarkBarView> view_; + base::scoped_nsobject<BookmarkBarView> view_; }; TEST_F(BookmarkBarViewTest, CanDragWindow) { @@ -209,8 +209,8 @@ TEST_F(BookmarkBarViewTest, CanDragWindow) { } TEST_F(BookmarkBarViewTest, BookmarkButtonDragAndDrop) { - scoped_nsobject<FakeBookmarkDraggingInfo> - info([[FakeBookmarkDraggingInfo alloc] init]); + base::scoped_nsobject<FakeBookmarkDraggingInfo> info( + [[FakeBookmarkDraggingInfo alloc] init]); [view_ setController:info.get()]; [info reset]; @@ -222,12 +222,13 @@ TEST_F(BookmarkBarViewTest, BookmarkButtonDragAndDrop) { ASCIIToUTF16("Test Bookmark"), GURL("http://www.exmaple.com")); - scoped_nsobject<BookmarkButtonCell> button_cell( + base::scoped_nsobject<BookmarkButtonCell> button_cell( [[BookmarkButtonCell buttonCellForNode:node text:nil image:nil menuController:nil] retain]); - scoped_nsobject<BookmarkButton> dragged_button([[BookmarkButton alloc] init]); + base::scoped_nsobject<BookmarkButton> dragged_button( + [[BookmarkButton alloc] init]); [dragged_button setCell:button_cell]; [info setDraggingSource:dragged_button.get()]; [info setDragDataType:kBookmarkButtonDragType]; @@ -243,8 +244,8 @@ TEST_F(BookmarkBarViewTest, BookmarkButtonDragAndDrop) { // When dragging bookmarks across profiles, we should always copy, never move. TEST_F(BookmarkBarViewTest, BookmarkButtonDragAndDropAcrossProfiles) { - scoped_nsobject<FakeBookmarkDraggingInfo> - info([[FakeBookmarkDraggingInfo alloc] init]); + base::scoped_nsobject<FakeBookmarkDraggingInfo> info( + [[FakeBookmarkDraggingInfo alloc] init]); [view_ setController:info.get()]; [info reset]; @@ -263,12 +264,13 @@ TEST_F(BookmarkBarViewTest, BookmarkButtonDragAndDropAcrossProfiles) { ASCIIToUTF16("Test Bookmark"), GURL("http://www.exmaple.com")); - scoped_nsobject<BookmarkButtonCell> button_cell( + base::scoped_nsobject<BookmarkButtonCell> button_cell( [[BookmarkButtonCell buttonCellForNode:node text:nil image:nil menuController:nil] retain]); - scoped_nsobject<BookmarkButton> dragged_button([[BookmarkButton alloc] init]); + base::scoped_nsobject<BookmarkButton> dragged_button( + [[BookmarkButton alloc] init]); [dragged_button setCell:button_cell]; [info setDraggingSource:dragged_button.get()]; [info setDragDataType:kBookmarkButtonDragType]; @@ -283,8 +285,8 @@ TEST_F(BookmarkBarViewTest, BookmarkButtonDragAndDropAcrossProfiles) { } TEST_F(BookmarkBarViewTest, URLDragAndDrop) { - scoped_nsobject<FakeBookmarkDraggingInfo> - info([[FakeBookmarkDraggingInfo alloc] init]); + base::scoped_nsobject<FakeBookmarkDraggingInfo> info( + [[FakeBookmarkDraggingInfo alloc] init]); [view_ setController:info.get()]; [info reset]; @@ -301,12 +303,13 @@ TEST_F(BookmarkBarViewTest, URLDragAndDrop) { } TEST_F(BookmarkBarViewTest, BookmarkButtonDropIndicator) { - scoped_nsobject<FakeBookmarkDraggingInfo> - info([[FakeBookmarkDraggingInfo alloc] init]); + base::scoped_nsobject<FakeBookmarkDraggingInfo> info( + [[FakeBookmarkDraggingInfo alloc] init]); [view_ setController:info.get()]; [info reset]; - scoped_nsobject<BookmarkButton> dragged_button([[BookmarkButton alloc] init]); + base::scoped_nsobject<BookmarkButton> dragged_button( + [[BookmarkButton alloc] init]); [info setDraggingSource:dragged_button.get()]; [info setDragDataType:kBookmarkButtonDragType]; EXPECT_FALSE([info draggingEnteredCalled]); diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm index 5cad07e..1405f7c 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm @@ -5,7 +5,7 @@ #import <Cocoa/Cocoa.h> #include "base/basictypes.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" @@ -252,8 +252,8 @@ TEST_F(BookmarkBubbleControllerTest, TestClose) { GURL("http://www.google.com")); EXPECT_EQ(edits_, 0); - scoped_nsobject<BookmarkPulseObserver> observer([[BookmarkPulseObserver alloc] - init]); + base::scoped_nsobject<BookmarkPulseObserver> observer( + [[BookmarkPulseObserver alloc] init]); EXPECT_EQ([observer notifications], 0); BookmarkBubbleController* controller = ControllerForNode(node); EXPECT_TRUE(controller); diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm index 876ac6d..92f6b89 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm @@ -7,7 +7,7 @@ #include <cmath> #include "base/logging.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "chrome/browser/bookmarks/bookmark_model.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" @@ -415,10 +415,11 @@ BookmarkButton* gDraggedButton = nil; // Weak // if the source view is clipped. Fortunately, we don't display clipped // bookmark buttons. [self lockFocus]; - scoped_nsobject<NSBitmapImageRep> - bitmap([[NSBitmapImageRep alloc] initWithFocusedViewRect:bounds]); + base::scoped_nsobject<NSBitmapImageRep> bitmap( + [[NSBitmapImageRep alloc] initWithFocusedViewRect:bounds]); [self unlockFocus]; - scoped_nsobject<NSImage> image([[NSImage alloc] initWithSize:[bitmap size]]); + base::scoped_nsobject<NSImage> image( + [[NSImage alloc] initWithSize:[bitmap size]]); [image addRepresentation:bitmap]; // Make an autoreleased |NSImage|, which will be returned, and draw into it. diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h index 32b13f4..0a4b7da 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h @@ -30,10 +30,10 @@ class BookmarkNode; BOOL drawFolderArrow_; // Arrow for folders - scoped_nsobject<NSImage> arrowImage_; + base::scoped_nsobject<NSImage> arrowImage_; // Text color for title. - scoped_nsobject<NSColor> textColor_; + base::scoped_nsobject<NSColor> textColor_; } @property(nonatomic, readwrite, assign) const BookmarkNode* bookmarkNode; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm index 6aaab33..a377295 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm @@ -215,7 +215,8 @@ const int kHierarchyButtonXMargin = 4; // We must reapply the text color after any setTitle: call - (void)applyTextColor { - scoped_nsobject<NSMutableParagraphStyle> style([NSMutableParagraphStyle new]); + base::scoped_nsobject<NSMutableParagraphStyle> style( + [NSMutableParagraphStyle new]); [style setAlignment:NSLeftTextAlignment]; NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:textColor_, @@ -224,9 +225,8 @@ const int kHierarchyButtonXMargin = 4; style.get(), NSParagraphStyleAttributeName, [NSNumber numberWithFloat:0.2], NSKernAttributeName, nil]; - scoped_nsobject<NSAttributedString> ats([[NSAttributedString alloc] - initWithString:[self title] - attributes:dict]); + base::scoped_nsobject<NSAttributedString> ats( + [[NSAttributedString alloc] initWithString:[self title] attributes:dict]); [self setAttributedTitle:ats.get()]; } diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell_unittest.mm index baeccef..db26ae7 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" @@ -43,8 +43,8 @@ class BookmarkButtonCellTest : public CocoaProfileTest { // Make sure it's not totally bogus TEST_F(BookmarkButtonCellTest, SizeForBounds) { NSRect frame = NSMakeRect(0, 0, 50, 30); - scoped_nsobject<NSButton> view([[NSButton alloc] initWithFrame:frame]); - scoped_nsobject<BookmarkButtonCell> cell( + base::scoped_nsobject<NSButton> view([[NSButton alloc] initWithFrame:frame]); + base::scoped_nsobject<BookmarkButtonCell> cell( [[BookmarkButtonCell alloc] initTextCell:@"Testing"]); [view setCell:cell.get()]; [[test_window() contentView] addSubview:view]; @@ -58,14 +58,14 @@ TEST_F(BookmarkButtonCellTest, SizeForBounds) { // Make sure icon-only buttons are squeezed tightly. TEST_F(BookmarkButtonCellTest, IconOnlySqueeze) { NSRect frame = NSMakeRect(0, 0, 50, 30); - scoped_nsobject<NSButton> view([[NSButton alloc] initWithFrame:frame]); - scoped_nsobject<BookmarkButtonCell> cell( + base::scoped_nsobject<NSButton> view([[NSButton alloc] initWithFrame:frame]); + base::scoped_nsobject<BookmarkButtonCell> cell( [[BookmarkButtonCell alloc] initTextCell:@"Testing"]); [view setCell:cell.get()]; [[test_window() contentView] addSubview:view]; ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - scoped_nsobject<NSImage> image( + base::scoped_nsobject<NSImage> image( rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON).CopyNSImage()); EXPECT_TRUE(image.get()); @@ -87,7 +87,7 @@ TEST_F(BookmarkButtonCellTest, IconOnlySqueeze) { // Make sure the default from the base class is overridden. TEST_F(BookmarkButtonCellTest, MouseEnterStuff) { - scoped_nsobject<BookmarkButtonCell> cell( + base::scoped_nsobject<BookmarkButtonCell> cell( [[BookmarkButtonCell alloc] initTextCell:@"Testing"]); // Setting the menu should have no affect since we either share or // dynamically compose the menu given a node. @@ -106,7 +106,7 @@ TEST_F(BookmarkButtonCellTest, MouseEnterStuff) { TEST_F(BookmarkButtonCellTest, BookmarkNode) { BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile()); - scoped_nsobject<BookmarkButtonCell> cell( + base::scoped_nsobject<BookmarkButtonCell> cell( [[BookmarkButtonCell alloc] initTextCell:@"Testing"]); const BookmarkNode* node = model->bookmark_bar_node(); @@ -119,11 +119,11 @@ TEST_F(BookmarkButtonCellTest, BookmarkNode) { } TEST_F(BookmarkButtonCellTest, BookmarkMouseForwarding) { - scoped_nsobject<BookmarkButtonCell> cell( + base::scoped_nsobject<BookmarkButtonCell> cell( [[BookmarkButtonCell alloc] initTextCell:@"Testing"]); - scoped_nsobject<ButtonRemembersMouseEnterExit> - button([[ButtonRemembersMouseEnterExit alloc] - initWithFrame:NSMakeRect(0,0,50,50)]); + base::scoped_nsobject<ButtonRemembersMouseEnterExit> button( + [[ButtonRemembersMouseEnterExit alloc] + initWithFrame:NSMakeRect(0, 0, 50, 50)]); [button setCell:cell.get()]; EXPECT_EQ(0, button.get()->enters_); EXPECT_EQ(0, button.get()->exits_); @@ -147,7 +147,8 @@ TEST_F(BookmarkButtonCellTest, BookmarkMouseForwarding) { // Confirms a cell created in a nib is initialized properly TEST_F(BookmarkButtonCellTest, Awake) { - scoped_nsobject<BookmarkButtonCell> cell([[BookmarkButtonCell alloc] init]); + base::scoped_nsobject<BookmarkButtonCell> cell( + [[BookmarkButtonCell alloc] init]); [cell awakeFromNib]; EXPECT_EQ(NSLeftTextAlignment, [cell alignment]); } @@ -159,11 +160,11 @@ TEST_F(BookmarkButtonCellTest, FolderArrow) { const BookmarkNode* node = model->AddURL(bar, bar->child_count(), ASCIIToUTF16("title"), GURL("http://www.google.com")); - scoped_nsobject<BookmarkButtonCell> cell( - [[BookmarkButtonCell alloc] initForNode:node - text:@"small" - image:nil - menuController:nil]); + base::scoped_nsobject<BookmarkButtonCell> cell( + [[BookmarkButtonCell alloc] initForNode:node + text:@"small" + image:nil + menuController:nil]); EXPECT_TRUE(cell.get()); NSSize size = [cell cellSize]; @@ -184,9 +185,9 @@ TEST_F(BookmarkButtonCellTest, VerticalTextOffset) { ASCIIToUTF16("title"), GURL("http://www.google.com")); - scoped_nsobject<GradientButtonCell> gradient_cell( + base::scoped_nsobject<GradientButtonCell> gradient_cell( [[GradientButtonCell alloc] initTextCell:@"Testing"]); - scoped_nsobject<BookmarkButtonCell> bookmark_cell( + base::scoped_nsobject<BookmarkButtonCell> bookmark_cell( [[BookmarkButtonCell alloc] initForNode:node text:@"small" image:nil diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_unittest.mm index 6e0b5d3..a6cb9d2 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" @@ -65,14 +65,14 @@ class BookmarkButtonTest : public CocoaProfileTest { // Make sure nothing leaks TEST_F(BookmarkButtonTest, Create) { - scoped_nsobject<BookmarkButton> button; + base::scoped_nsobject<BookmarkButton> button; button.reset([[BookmarkButton alloc] initWithFrame:NSMakeRect(0,0,500,500)]); } // Test folder and empty node queries. TEST_F(BookmarkButtonTest, FolderAndEmptyOrNot) { - scoped_nsobject<BookmarkButton> button; - scoped_nsobject<BookmarkButtonCell> cell; + base::scoped_nsobject<BookmarkButton> button; + base::scoped_nsobject<BookmarkButtonCell> cell; button.reset([[BookmarkButton alloc] initWithFrame:NSMakeRect(0,0,500,500)]); cell.reset([[BookmarkButtonCell alloc] initTextCell:@"hi mom"]); @@ -107,10 +107,10 @@ TEST_F(BookmarkButtonTest, MouseEnterExitRedirect) { cocoa_test_event_utils::MouseEventAtPoint(NSMakePoint(10,10), NSMouseMoved, 0); - scoped_nsobject<BookmarkButton> button; - scoped_nsobject<BookmarkButtonCell> cell; - scoped_nsobject<FakeButtonDelegate> - delegate([[FakeButtonDelegate alloc] init]); + base::scoped_nsobject<BookmarkButton> button; + base::scoped_nsobject<BookmarkButtonCell> cell; + base::scoped_nsobject<FakeButtonDelegate> delegate( + [[FakeButtonDelegate alloc] init]); button.reset([[BookmarkButton alloc] initWithFrame:NSMakeRect(0,0,500,500)]); cell.reset([[BookmarkButtonCell alloc] initTextCell:@"hi mom"]); [button setCell:cell]; @@ -130,10 +130,10 @@ TEST_F(BookmarkButtonTest, MouseEnterExitRedirect) { } TEST_F(BookmarkButtonTest, DragToTrash) { - scoped_nsobject<BookmarkButton> button; - scoped_nsobject<BookmarkButtonCell> cell; - scoped_nsobject<FakeButtonDelegate> - delegate([[FakeButtonDelegate alloc] init]); + base::scoped_nsobject<BookmarkButton> button; + base::scoped_nsobject<BookmarkButtonCell> cell; + base::scoped_nsobject<FakeButtonDelegate> delegate( + [[FakeButtonDelegate alloc] init]); button.reset([[BookmarkButton alloc] initWithFrame:NSMakeRect(0,0,500,500)]); cell.reset([[BookmarkButtonCell alloc] initTextCell:@"hi mom"]); [button setCell:cell]; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_context_menu_cocoa_controller.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_context_menu_cocoa_controller.h index 7f4828c..61a49f0 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_context_menu_cocoa_controller.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_context_menu_cocoa_controller.h @@ -8,7 +8,7 @@ #import <Cocoa/Cocoa.h> #include "base/basictypes.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" @class BookmarkBarController; @@ -41,7 +41,7 @@ class BookmarkNode; // Controller responsible for creating a Cocoa NSMenu from the cross-platform // SimpleMenuModel owned by the |bookmarkContextMenuController_|. - scoped_nsobject<MenuController> menuController_; + base::scoped_nsobject<MenuController> menuController_; } // Initializes the BookmarkContextMenuCocoaController for the given bookmark diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_drag_drop_cocoa.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_drag_drop_cocoa.mm index 3c1889d..c69a17d 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_drag_drop_cocoa.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_drag_drop_cocoa.mm @@ -9,7 +9,7 @@ #include <cmath> #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/message_loop.h" #include "base/strings/string16.h" #include "base/strings/sys_string_conversions.h" @@ -69,9 +69,8 @@ void DrawTruncatedTitle(NSAttributedString* title, NSRect frame) { NSColor* color = [NSColor blackColor]; NSColor* alpha_color = [color colorWithAlphaComponent:0.0]; - scoped_nsobject<NSGradient> mask( - [[NSGradient alloc] initWithStartingColor:color - endingColor:alpha_color]); + base::scoped_nsobject<NSGradient> mask( + [[NSGradient alloc] initWithStartingColor:color endingColor:alpha_color]); // Draw the gradient mask. CGContextSetBlendMode(context, kCGBlendModeDestinationIn); [mask drawFromPoint:NSMakePoint(NSMaxX(frame) - gradient_width, @@ -101,9 +100,8 @@ NSImage* DragImageForBookmark(NSImage* favicon, const string16& title) { [NSDictionary dictionaryWithObject:[NSFont systemFontOfSize: [NSFont smallSystemFontSize]] forKey:NSFontAttributeName]; - scoped_nsobject<NSAttributedString> rich_title( - [[NSAttributedString alloc] initWithString:ns_title - attributes:attrs]); + base::scoped_nsobject<NSAttributedString> rich_title( + [[NSAttributedString alloc] initWithString:ns_title attributes:attrs]); // Set up sizes and locations for rendering. const CGFloat kIconMargin = 2.0; // Gap between icon and text. diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h index e8107ea..1a60827 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/bookmarks/bookmark_editor.h" #include "chrome/browser/bookmarks/bookmark_expanded_state_tracker.h" @@ -41,10 +41,10 @@ class BookmarkModel; BOOL creatingNewFolders_; // True while in createNewFolders. // An array of BookmarkFolderInfo where each item describes a folder in the // BookmarkNode structure. - scoped_nsobject<NSArray> folderTreeArray_; + base::scoped_nsobject<NSArray> folderTreeArray_; // Bound to the table view giving a path to the current selections, of which // there should only ever be one. - scoped_nsobject<NSArray> tableSelectionPaths_; + base::scoped_nsobject<NSArray> tableSelectionPaths_; // C++ bridge object that observes the BookmarkModel for me. scoped_ptr<BookmarkEditorBaseControllerBridge> observer_; } diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller_unittest.mm index c66f651..1aeeaa8 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h index da3ed89..abf67cb 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h @@ -13,7 +13,7 @@ @interface BookmarkEditorController : BookmarkEditorBaseController { @private const BookmarkNode* node_; // weak; owned by the model - scoped_nsobject<NSString> initialUrl_; + base::scoped_nsobject<NSString> initialUrl_; NSString* displayURL_; // Bound to a text field in the dialog. IBOutlet NSTextField* urlField_; IBOutlet NSTextField* nameTextField_; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target_unittest.mm index 2ca188d..c6019a9 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target_unittest.mm @@ -57,8 +57,8 @@ TEST_F(BookmarkFolderTargetTest, StartWithNothing) { // Make sure we get an addNew [[controller expect] addNewFolderControllerWithParentButton:sender]; - scoped_nsobject<BookmarkFolderTarget> target( - [[BookmarkFolderTarget alloc] initWithController:controller]); + base::scoped_nsobject<BookmarkFolderTarget> target( + [[BookmarkFolderTarget alloc] initWithController:controller]); [target openBookmarkFolderFromButton:sender]; EXPECT_OCMOCK_VERIFY(controller); @@ -82,7 +82,7 @@ TEST_F(BookmarkFolderTargetTest, ReopenSameFolder) { // any subfolders). [[controller expect] closeBookmarkFolder:controller]; - scoped_nsobject<BookmarkFolderTarget> target( + base::scoped_nsobject<BookmarkFolderTarget> target( [[BookmarkFolderTarget alloc] initWithController:controller]); [target openBookmarkFolderFromButton:sender]; @@ -111,8 +111,8 @@ TEST_F(BookmarkFolderTargetTest, ReopenNotSame) { // close and open. [[controller expect] addNewFolderControllerWithParentButton:sender]; - scoped_nsobject<BookmarkFolderTarget> target( - [[BookmarkFolderTarget alloc] initWithController:controller]); + base::scoped_nsobject<BookmarkFolderTarget> target( + [[BookmarkFolderTarget alloc] initWithController:controller]); [target openBookmarkFolderFromButton:sender]; EXPECT_OCMOCK_VERIFY(controller); diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h index 747a480..1d8fc04 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h @@ -22,7 +22,7 @@ #include <map> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/bookmarks/bookmark_model_observer.h" #import "chrome/browser/ui/cocoa/main_menu_item.h" @@ -139,7 +139,7 @@ class BookmarkMenuBridge : public BookmarkModelObserver, BookmarkMenuCocoaController* controller_; // strong // The folder image so we can use one copy for all. - scoped_nsobject<NSImage> folder_image_; + base::scoped_nsobject<NSImage> folder_image_; // In order to appropriately update items in the bookmark menu, without // forcing a rebuild, map the model's nodes to menu items. diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm index 73bc86d..092df71 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm @@ -4,7 +4,7 @@ #import <AppKit/AppKit.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller_unittest.mm index fddc7fb..e4b7b4e 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller_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. -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" @@ -76,7 +76,7 @@ class BookmarkMenuCocoaControllerTest : public CocoaProfileTest { FakeBookmarkMenuController* controller() { return controller_.get(); } private: - scoped_nsobject<FakeBookmarkMenuController> controller_; + base::scoped_nsobject<FakeBookmarkMenuController> controller_; }; TEST_F(BookmarkMenuCocoaControllerTest, TestOpenItem) { diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa.h index e6bc619..cbafd35 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa.h @@ -25,7 +25,7 @@ #include "base/basictypes.h" #include "base/mac/scoped_block.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_model_observer.h" diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa_unittest.mm index c781af2..c508ebe 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h index d7009dd..e5a603e 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -31,7 +31,7 @@ class BookmarkModelObserverForCocoa; const BookmarkNode* parent_; int newIndex_; - scoped_nsobject<NSString> initialName_; + base::scoped_nsobject<NSString> initialName_; // Ping me when things change out from under us. scoped_ptr<BookmarkModelObserverForCocoa> observer_; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller_unittest.mm index eb78e7a..d8a023d 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h" @@ -23,12 +23,11 @@ TEST_F(BookmarkNameFolderControllerTest, AddNew) { const BookmarkNode* parent = model->bookmark_bar_node(); EXPECT_EQ(0, parent->child_count()); - scoped_nsobject<BookmarkNameFolderController> - controller([[BookmarkNameFolderController alloc] - initWithParentWindow:test_window() - profile:profile() - parent:parent - newIndex:0]); + base::scoped_nsobject<BookmarkNameFolderController> controller( + [[BookmarkNameFolderController alloc] initWithParentWindow:test_window() + profile:profile() + parent:parent + newIndex:0]); [controller window]; // force nib load // Do nothing. @@ -59,12 +58,11 @@ TEST_F(BookmarkNameFolderControllerTest, AddNewWithSibling) { GURL("http://www.google.com")); EXPECT_EQ(2, parent->child_count()); - scoped_nsobject<BookmarkNameFolderController> - controller([[BookmarkNameFolderController alloc] - initWithParentWindow:test_window() - profile:profile() - parent:parent - newIndex:1]); + base::scoped_nsobject<BookmarkNameFolderController> controller( + [[BookmarkNameFolderController alloc] initWithParentWindow:test_window() + profile:profile() + parent:parent + newIndex:1]); [controller window]; // force nib load // Add a new folder. @@ -83,12 +81,11 @@ TEST_F(BookmarkNameFolderControllerTest, AddNewDefaultName) { const BookmarkNode* parent = model->bookmark_bar_node(); EXPECT_EQ(0, parent->child_count()); - scoped_nsobject<BookmarkNameFolderController> - controller([[BookmarkNameFolderController alloc] - initWithParentWindow:test_window() - profile:profile() - parent:parent - newIndex:0]); + base::scoped_nsobject<BookmarkNameFolderController> controller( + [[BookmarkNameFolderController alloc] initWithParentWindow:test_window() + profile:profile() + parent:parent + newIndex:0]); [controller window]; // force nib load @@ -104,12 +101,11 @@ TEST_F(BookmarkNameFolderControllerTest, AddNewBlankName) { const BookmarkNode* parent = model->bookmark_bar_node(); EXPECT_EQ(0, parent->child_count()); - scoped_nsobject<BookmarkNameFolderController> - controller([[BookmarkNameFolderController alloc] - initWithParentWindow:test_window() - profile:profile() - parent:parent - newIndex:0]); + base::scoped_nsobject<BookmarkNameFolderController> controller( + [[BookmarkNameFolderController alloc] initWithParentWindow:test_window() + profile:profile() + parent:parent + newIndex:0]); [controller window]; // force nib load // Change the name to blank, click OK. @@ -128,11 +124,10 @@ TEST_F(BookmarkNameFolderControllerTest, Rename) { // Rename the folder by creating a controller that originates from // the node. - scoped_nsobject<BookmarkNameFolderController> - controller([[BookmarkNameFolderController alloc] - initWithParentWindow:test_window() - profile:profile() - node:folder]); + base::scoped_nsobject<BookmarkNameFolderController> controller( + [[BookmarkNameFolderController alloc] initWithParentWindow:test_window() + profile:profile() + node:folder]); [controller window]; // force nib load EXPECT_NSEQ(@"folder", [controller folderName]); @@ -148,12 +143,11 @@ TEST_F(BookmarkNameFolderControllerTest, EditAndConfirmOKButton) { const BookmarkNode* parent = model->bookmark_bar_node(); EXPECT_EQ(0, parent->child_count()); - scoped_nsobject<BookmarkNameFolderController> - controller([[BookmarkNameFolderController alloc] - initWithParentWindow:test_window() - profile:profile() - parent:parent - newIndex:0]); + base::scoped_nsobject<BookmarkNameFolderController> controller( + [[BookmarkNameFolderController alloc] initWithParentWindow:test_window() + profile:profile() + parent:parent + newIndex:0]); [controller window]; // force nib load // We start enabled since the default "New Folder" is added for us. diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_tree_browser_cell_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_tree_browser_cell_unittest.mm index 60f6deb..7450904 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_tree_browser_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_tree_browser_cell_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "chrome/browser/bookmarks/bookmark_model.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_tree_browser_cell.h" #include "testing/platform_test.h" @@ -20,8 +20,8 @@ class BookmarkTreeBrowserCellTest : public PlatformTest { } scoped_ptr<BookmarkNode> bookmarkNodeMock_; - scoped_nsobject<NSMatrix> matrixMock_; - scoped_nsobject<NSObject> targetMock_; + base::scoped_nsobject<NSMatrix> matrixMock_; + base::scoped_nsobject<NSObject> targetMock_; }; TEST_F(BookmarkTreeBrowserCellTest, BasicAllocDealloc) { diff --git a/chrome/browser/ui/cocoa/browser/avatar_button_controller.h b/chrome/browser/ui/cocoa/browser/avatar_button_controller.h index a72d6ee..f61ccad 100644 --- a/chrome/browser/ui/cocoa/browser/avatar_button_controller.h +++ b/chrome/browser/ui/cocoa/browser/avatar_button_controller.h @@ -7,7 +7,7 @@ #import <AppKit/AppKit.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" @class AvatarMenuBubbleController; @@ -36,10 +36,10 @@ class ThemeProvider; __weak AvatarMenuBubbleController* menuController_; // The avatar button. - scoped_nsobject<NSButton> button_; + base::scoped_nsobject<NSButton> button_; // The managed user avatar label. Only used for managed user profiles. - scoped_nsobject<NSButton> labelButton_; + base::scoped_nsobject<NSButton> labelButton_; } // The avatar button view. diff --git a/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm b/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm index 52049b0..ab62229 100644 --- a/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm +++ b/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm @@ -98,8 +98,9 @@ const CGFloat kMenuYOffsetAdjust = 1.0; if ((self = [super init])) { browser_ = browser; - scoped_nsobject<NSView> container([[NSView alloc] initWithFrame:NSMakeRect( - 0, 0, profiles::kAvatarIconWidth, profiles::kAvatarIconHeight)]); + base::scoped_nsobject<NSView> container( + [[NSView alloc] initWithFrame:NSMakeRect( + 0, 0, profiles::kAvatarIconWidth, profiles::kAvatarIconHeight)]); [self setView:container]; button_.reset([[NSButton alloc] initWithFrame:NSMakeRect( 0, 0, profiles::kAvatarIconWidth, profiles::kAvatarIconHeight)]); @@ -258,7 +259,7 @@ const CGFloat kMenuYOffsetAdjust = 1.0; - (NSImage*)compositeImageWithShadow:(NSImage*)image { gfx::ScopedNSGraphicsContextSaveGState scopedGState; - scoped_nsobject<NSImage> destination( + base::scoped_nsobject<NSImage> destination( [[NSImage alloc] initWithSize:[image size]]); NSRect destRect = NSZeroRect; @@ -266,7 +267,7 @@ const CGFloat kMenuYOffsetAdjust = 1.0; [destination lockFocus]; - scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); + base::scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); [shadow.get() setShadowColor:[NSColor colorWithCalibratedWhite:0.0 alpha:0.75]]; [shadow.get() setShadowOffset:NSMakeSize(0, 0)]; diff --git a/chrome/browser/ui/cocoa/browser/avatar_button_controller_unittest.mm b/chrome/browser/ui/cocoa/browser/avatar_button_controller_unittest.mm index 83001ee..43b7c3b 100644 --- a/chrome/browser/ui/cocoa/browser/avatar_button_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/browser/avatar_button_controller_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/browser/avatar_button_controller.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #import "chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.h" @@ -35,7 +35,7 @@ class AvatarButtonControllerTest : public CocoaProfileTest { AvatarButtonController* controller() { return controller_.get(); } private: - scoped_nsobject<AvatarButtonController> controller_; + base::scoped_nsobject<AvatarButtonController> controller_; }; TEST_F(AvatarButtonControllerTest, AddRemoveProfiles) { @@ -89,7 +89,7 @@ TEST_F(AvatarButtonControllerTest, ManagedUserLabel) { // Build a new controller to check if it is initialized correctly for a // managed user profile. - scoped_nsobject<AvatarButtonController> controller( + base::scoped_nsobject<AvatarButtonController> controller( [[AvatarButtonController alloc] initWithBrowser:browser()]); EXPECT_TRUE([controller labelButtonView]); diff --git a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.h b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.h index f3f77f4..b0eb8f0 100644 --- a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.h +++ b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/base_bubble_controller.h" #import "ui/base/cocoa/tracking_area.h" @@ -23,7 +23,7 @@ class Browser; scoped_ptr<AvatarMenuModel> model_; // Array of the below view controllers. - scoped_nsobject<NSMutableArray> items_; + base::scoped_nsobject<NSMutableArray> items_; // Is set to true if the managed user has clicked on Switch Users. BOOL expanded_; @@ -65,7 +65,7 @@ class Browser; // The animation showing the edit link, which is run after the user has // dwelled over the item for a short delay. - scoped_nsobject<NSAnimation> linkAnimation_; + base::scoped_nsobject<NSAnimation> linkAnimation_; // Instance variables that back the outlets. __weak NSImageView* iconView_; diff --git a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm index 65cff17..4514695 100644 --- a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm @@ -110,7 +110,7 @@ const CGFloat kManagedUserSpacing = 26.0; // Use an arbitrary height because it will reflect the size of the content. NSRect contentRect = NSMakeRect(0, 0, kBubbleMinWidth, 150); // Create an empty window into which content is placed. - scoped_nsobject<InfoBubbleWindow> window( + base::scoped_nsobject<InfoBubbleWindow> window( [[InfoBubbleWindow alloc] initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered @@ -302,10 +302,11 @@ const CGFloat kManagedUserSpacing = 26.0; } - (NSView*)configureManagedUserInformation:(CGFloat)width { - scoped_nsobject<NSView> container([[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> container( + [[NSView alloc] initWithFrame:NSZeroRect]); // Add the limited user icon on the left side of the information TextView. - scoped_nsobject<NSImageView> iconView( + base::scoped_nsobject<NSImageView> iconView( [[NSImageView alloc] initWithFrame:NSMakeRect(5, 0, 16, 16)]); [iconView setImage:model_->GetManagedUserIcon().ToNSImage()]; [container addSubview:iconView]; @@ -314,9 +315,9 @@ const CGFloat kManagedUserSpacing = 26.0; base::SysUTF16ToNSString(model_->GetManagedUserInformation()); NSDictionary* attributes = @{ NSFontAttributeName : [NSFont labelFontOfSize:12] }; - scoped_nsobject<NSAttributedString> attrString( + base::scoped_nsobject<NSAttributedString> attrString( [[NSAttributedString alloc] initWithString:info attributes:attributes]); - scoped_nsobject<NSTextView> label( + base::scoped_nsobject<NSTextView> label( [[NSTextView alloc] initWithFrame:NSMakeRect( kManagedUserSpacing, 0, width - kManagedUserSpacing - 5, 0)]); [[label textStorage] setAttributedString:attrString]; @@ -333,12 +334,11 @@ const CGFloat kManagedUserSpacing = 26.0; - (NSButton*)configureNewUserButton:(CGFloat)yOffset updateWidthAdjust:(CGFloat*)widthAdjust { - scoped_nsobject<NSButton> newButton( - [[NSButton alloc] initWithFrame:NSMakeRect( - kLabelInset, yOffset, kBubbleMinWidth - kLabelInset, 16)]); - scoped_nsobject<HyperlinkButtonCell> buttonCell( + base::scoped_nsobject<NSButton> newButton([[NSButton alloc] initWithFrame: + NSMakeRect(kLabelInset, yOffset, kBubbleMinWidth - kLabelInset, 16)]); + base::scoped_nsobject<HyperlinkButtonCell> buttonCell( [[HyperlinkButtonCell alloc] initTextCell: - l10n_util::GetNSString(IDS_PROFILES_CREATE_NEW_PROFILE_LINK)]); + l10n_util::GetNSString(IDS_PROFILES_CREATE_NEW_PROFILE_LINK)]); [newButton setCell:buttonCell.get()]; [newButton setFont:[NSFont labelFontOfSize:12.0]]; [newButton setBezelStyle:NSRegularSquareBezelStyle]; @@ -352,12 +352,12 @@ const CGFloat kManagedUserSpacing = 26.0; - (NSButton*)configureSwitchUserButton:(CGFloat)yOffset updateWidthAdjust:(CGFloat*)widthAdjust { - scoped_nsobject<NSButton> newButton( + base::scoped_nsobject<NSButton> newButton( [[NSButton alloc] initWithFrame:NSMakeRect( kManagedUserSpacing, yOffset, kBubbleMinWidth - kLabelInset, 16)]); - scoped_nsobject<HyperlinkButtonCell> buttonCell( + base::scoped_nsobject<HyperlinkButtonCell> buttonCell( [[HyperlinkButtonCell alloc] initTextCell: - l10n_util::GetNSString(IDS_PROFILES_SWITCH_PROFILE_LINK)]); + l10n_util::GetNSString(IDS_PROFILES_SWITCH_PROFILE_LINK)]); [newButton setCell:buttonCell.get()]; [newButton setFont:[NSFont labelFontOfSize:12.0]]; [newButton setBezelStyle:NSRegularSquareBezelStyle]; diff --git a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller_unittest.mm index a252969..153efc4 100644 --- a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/message_loop/message_pump_mac.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/prefs/pref_service_syncable.h" @@ -116,7 +116,7 @@ TEST_F(AvatarMenuBubbleControllerTest, PerformLayout) { NSView* contents = [[controller() window] contentView]; EXPECT_EQ(4U, [[contents subviews] count]); - scoped_nsobject<NSMutableArray> oldItems([[controller() items] copy]); + base::scoped_nsobject<NSMutableArray> oldItems([[controller() items] copy]); // Now create a new profile and notify the delegate. manager()->CreateTestingProfile("test3", scoped_ptr<PrefServiceSyncable>(), @@ -180,7 +180,7 @@ TEST_F(AvatarMenuBubbleControllerTest, PerformLayout) { @end TEST_F(AvatarMenuBubbleControllerTest, HighlightForEventType) { - scoped_nsobject<TestingAvatarMenuItemController> item( + base::scoped_nsobject<TestingAvatarMenuItemController> item( [[TestingAvatarMenuItemController alloc] initWithModelIndex:0 menuController:nil]); // Test non-active states first. diff --git a/chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller_unittest.mm b/chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller_unittest.mm index 2315cfc..83ddfa3 100644 --- a/chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_service_factory.h" diff --git a/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.mm b/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.mm index 4662fc6..736ae92 100644 --- a/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.mm @@ -69,8 +69,8 @@ const CGFloat kIconSize = 26.0; @private PasswordGenerationBubbleController* controller_; BOOL hovering_; - scoped_nsobject<NSImage> normalImage_; - scoped_nsobject<NSImage> hoverImage_; + base::scoped_nsobject<NSImage> normalImage_; + base::scoped_nsobject<NSImage> hoverImage_; } - (void)setUpWithController:(PasswordGenerationBubbleController*)controller @@ -260,12 +260,10 @@ const CGFloat kIconSize = 26.0; - (void)setUpTrackingAreaInRect:(NSRect)frame ofView:(PasswordGenerationTextField*)view { NSRect iconFrame = [self getIconFrame:frame]; - scoped_nsobject<CrTrackingArea> area( + base::scoped_nsobject<CrTrackingArea> area( [[CrTrackingArea alloc] initWithRect:iconFrame options:NSTrackingMouseEnteredAndExited | - NSTrackingActiveAlways - owner:view - userInfo:nil]); + NSTrackingActiveAlways owner:view userInfo:nil]); [view addTrackingArea:area]; } @@ -308,7 +306,7 @@ const CGFloat kIconSize = 26.0; kTopBorderOffset + info_bubble::kBubbleArrowHeight); NSRect contentRect = NSMakeRect(0, 0, width, height); - scoped_nsobject<InfoBubbleWindow> window( + base::scoped_nsobject<InfoBubbleWindow> window( [[InfoBubbleWindow alloc] initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered @@ -364,12 +362,11 @@ const CGFloat kIconSize = 26.0; [button setAction:@selector(fillPassword:)]; [contentView addSubview:button]; - scoped_nsobject<NSTextField> title([[NSTextField alloc] - initWithFrame:NSMakeRect( - kBorderSize, - kBorderSize + kTextFieldHeight + kVerticalSpacing, - kTitleWidth, - kTitleHeight)]); + base::scoped_nsobject<NSTextField> title([[NSTextField alloc] initWithFrame: + NSMakeRect(kBorderSize, + kBorderSize + kTextFieldHeight + kVerticalSpacing, + kTitleWidth, + kTitleHeight)]); [title setEditable:NO]; [title setBordered:NO]; [title setStringValue:l10n_util::GetNSString( diff --git a/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.h b/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.h index 8b909db..c92468e 100644 --- a/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.h +++ b/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_COCOA_BROWSER_ZOOM_BUBBLE_CONTROLLER_H_ #include "base/mac/scoped_block.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/cocoa/base_bubble_controller.h" #import "ui/base/cocoa/tracking_area.h" @@ -31,7 +31,7 @@ class WebContents; base::mac::ScopedBlock<void(^)(ZoomBubbleController*)> closeObserver_; // The text field that displays the current zoom percentage. - scoped_nsobject<NSTextField> zoomPercent_; + base::scoped_nsobject<NSTextField> zoomPercent_; // Whether or not the mouse is over the bubble. BOOL isMouseInside_; diff --git a/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm b/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm index a7c9b9e..0f2baa2 100644 --- a/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm @@ -74,11 +74,11 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) { - (id)initWithParentWindow:(NSWindow*)parentWindow closeObserver:(void(^)(ZoomBubbleController*))closeObserver { - scoped_nsobject<InfoBubbleWindow> window([[InfoBubbleWindow alloc] - initWithContentRect:NSMakeRect(0, 0, 200, 100) - styleMask:NSBorderlessWindowMask - backing:NSBackingStoreBuffered - defer:NO]); + base::scoped_nsobject<InfoBubbleWindow> window( + [[InfoBubbleWindow alloc] initWithContentRect:NSMakeRect(0, 0, 200, 100) + styleMask:NSBorderlessWindowMask + backing:NSBackingStoreBuffered + defer:NO]); if ((self = [super initWithWindow:window parentWindow:parentWindow anchoredAt:NSZeroPoint])) { @@ -208,7 +208,8 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) { // Separator view. rect.origin.x += NSWidth(rect); rect.size.width = 1; - scoped_nsobject<NSBox> separatorView([[NSBox alloc] initWithFrame:rect]); + base::scoped_nsobject<NSBox> separatorView( + [[NSBox alloc] initWithFrame:rect]); [separatorView setBoxType:NSBoxCustom]; ui::NativeTheme* nativeTheme = ui::NativeTheme::instance(); [separatorView setBorderColor: @@ -241,7 +242,7 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) { - (NSAttributedString*)attributedStringWithString:(NSString*)string fontSize:(CGFloat)fontSize { - scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( + base::scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( [[NSMutableParagraphStyle alloc] init]); [paragraphStyle setAlignment:NSCenterTextAlignment]; NSDictionary* attributes = @{ @@ -260,7 +261,7 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) { - (NSButton*)addButtonWithTitleID:(int)titleID fontSize:(CGFloat)fontSize action:(SEL)action { - scoped_nsobject<NSButton> button( + base::scoped_nsobject<NSButton> button( [[ZoomHoverButton alloc] initWithFrame:NSZeroRect]); NSString* title = l10n_util::GetNSStringWithFixup(titleID); [button setAttributedTitle:[self attributedStringWithString:title @@ -273,7 +274,7 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) { } - (NSTextField*)addZoomPercentTextField { - scoped_nsobject<NSTextField> textField( + base::scoped_nsobject<NSTextField> textField( [[NSTextField alloc] initWithFrame:NSZeroRect]); [textField setEditable:NO]; [textField setBordered:NO]; diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.h b/chrome/browser/ui/cocoa/browser_window_cocoa.h index 199e421..ea17ec7 100644 --- a/chrome/browser/ui/cocoa/browser_window_cocoa.h +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/extensions/extension_keybinding_registry.h" @@ -169,7 +169,7 @@ class BrowserWindowCocoa : Browser* browser_; // weak, owned by controller BrowserWindowController* controller_; // weak, owns us base::WeakPtrFactory<Browser> confirm_close_factory_; - scoped_nsobject<NSString> pending_window_title_; + base::scoped_nsobject<NSString> pending_window_title_; ui::WindowShowState initial_show_state_; NSInteger attention_request_id_; // identifier from requestUserAttention }; diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm index 39813e2..53a69cf 100644 --- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm @@ -497,13 +497,12 @@ void BrowserWindowCocoa::ShowOneClickSigninBubble( WebContents* web_contents = browser_->tab_strip_model()->GetActiveWebContents(); if (type == ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE) { - scoped_nsobject<OneClickSigninBubbleController> bubble_controller( - [[OneClickSigninBubbleController alloc] - initWithBrowserWindowController:cocoa_controller() - webContents:web_contents - errorMessage:base::SysUTF16ToNSString( - error_message) - callback:start_sync_callback]); + base::scoped_nsobject<OneClickSigninBubbleController> bubble_controller([ + [OneClickSigninBubbleController alloc] + initWithBrowserWindowController:cocoa_controller() + webContents:web_contents + errorMessage:base::SysUTF16ToNSString(error_message) + callback:start_sync_callback]); [bubble_controller showWindow:nil]; } else { // Deletes itself when the dialog closes. diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm b/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm index 53835b3..8bb2f9e 100644 --- a/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm +++ b/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "base/mac/mac_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string_util.h" #include "chrome/browser/ui/bookmarks/bookmark_utils.h" @@ -14,8 +14,8 @@ #include "chrome/common/pref_names.h" #include "content/public/browser/notification_details.h" #include "testing/gtest/include/gtest/gtest.h" -#import "third_party/ocmock/gtest_support.h" #import "third_party/ocmock/OCMock/OCMock.h" +#import "third_party/ocmock/gtest_support.h" // Main test class. class BrowserWindowCocoaTest : public CocoaProfileTest { @@ -79,7 +79,7 @@ TEST_F(BrowserWindowCocoaTest, TestFullscreen) { // Wrap the FakeController in a scoped_nsobject instead of autoreleasing in // windowWillClose: because we never actually open a window in this test (so // windowWillClose: never gets called). - scoped_nsobject<FakeController> fake_controller( + base::scoped_nsobject<FakeController> fake_controller( [[FakeController alloc] init]); scoped_ptr<BrowserWindowCocoa> bwc(new BrowserWindowCocoa( browser(), static_cast<BrowserWindowController*>(fake_controller.get()))); @@ -99,7 +99,7 @@ TEST_F(BrowserWindowCocoaTest, TestFullscreenWithChrome) { // Wrap the FakeController in a scoped_nsobject instead of autoreleasing in // windowWillClose: because we never actually open a window in this test (so // windowWillClose: never gets called). - scoped_nsobject<FakeController> fake_controller( + base::scoped_nsobject<FakeController> fake_controller( [[FakeController alloc] init]); scoped_ptr<BrowserWindowCocoa> bwc(new BrowserWindowCocoa( browser(), static_cast<BrowserWindowController*>(fake_controller.get()))); diff --git a/chrome/browser/ui/cocoa/browser_window_controller.h b/chrome/browser/ui/cocoa/browser_window_controller.h index 8ce1492..2e5edbc 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.h +++ b/chrome/browser/ui/cocoa/browser_window_controller.h @@ -12,7 +12,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" @@ -62,16 +62,17 @@ class WebContents; scoped_ptr<Browser> browser_; NSWindow* savedRegularWindow_; scoped_ptr<BrowserWindowCocoa> windowShim_; - scoped_nsobject<ToolbarController> toolbarController_; - scoped_nsobject<TabStripController> tabStripController_; - scoped_nsobject<FindBarCocoaController> findBarCocoaController_; - scoped_nsobject<InfoBarContainerController> infoBarContainerController_; - scoped_nsobject<DownloadShelfController> downloadShelfController_; - scoped_nsobject<BookmarkBarController> bookmarkBarController_; - scoped_nsobject<DevToolsController> devToolsController_; - scoped_nsobject<OverlayableContentsController> overlayableContentsController_; - scoped_nsobject<PresentationModeController> presentationModeController_; - scoped_nsobject<FullscreenExitBubbleController> + base::scoped_nsobject<ToolbarController> toolbarController_; + base::scoped_nsobject<TabStripController> tabStripController_; + base::scoped_nsobject<FindBarCocoaController> findBarCocoaController_; + base::scoped_nsobject<InfoBarContainerController> infoBarContainerController_; + base::scoped_nsobject<DownloadShelfController> downloadShelfController_; + base::scoped_nsobject<BookmarkBarController> bookmarkBarController_; + base::scoped_nsobject<DevToolsController> devToolsController_; + base::scoped_nsobject<OverlayableContentsController> + overlayableContentsController_; + base::scoped_nsobject<PresentationModeController> presentationModeController_; + base::scoped_nsobject<FullscreenExitBubbleController> fullscreenExitBubbleController_; // Strong. StatusBubble is a special case of a strong reference that @@ -106,16 +107,16 @@ class WebContents; // The view controller that manages the incognito badge or the multi-profile // avatar icon. The view is always in the view hierarchy, but will be hidden // unless it's appropriate to show it. - scoped_nsobject<AvatarButtonController> avatarButtonController_; + base::scoped_nsobject<AvatarButtonController> avatarButtonController_; // Lazily created view which draws the background for the floating set of bars // in presentation mode (for window types having a floating bar; it remains // nil for those which don't). - scoped_nsobject<NSView> floatingBarBackingView_; + base::scoped_nsobject<NSView> floatingBarBackingView_; // The borderless window used in fullscreen mode. Lion reuses the original // window in fullscreen mode, so this is always nil on Lion. - scoped_nsobject<NSWindow> fullscreenWindow_; + base::scoped_nsobject<NSWindow> fullscreenWindow_; // Tracks whether presentation mode was entered from fullscreen mode or // directly from normal windowed mode. Used to determine what to do when @@ -143,7 +144,7 @@ class WebContents; // where keyboard focus is. Whenever an object requires bar visibility, it has // itself added to |barVisibilityLocks_|. When it no longer requires bar // visibility, it has itself removed. - scoped_nsobject<NSMutableSet> barVisibilityLocks_; + base::scoped_nsobject<NSMutableSet> barVisibilityLocks_; // Bar visibility locks and releases only result (when appropriate) in changes // in visible state when the following is |YES|. diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm index d4cc3a3..f771854 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm @@ -10,7 +10,7 @@ #include "base/command_line.h" #include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" // IDC_* diff --git a/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm b/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm index 8951175..d991eaf 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm @@ -654,7 +654,7 @@ IN_PROC_BROWSER_TEST_F(BrowserWindowControllerTest, browser()->tab_strip_model()->GetActiveWebContents()->GetView(); EXPECT_FALSE(web_contents_view->GetAllowOverlappingViews()); - scoped_nsobject<HistoryOverlayController> overlay( + base::scoped_nsobject<HistoryOverlayController> overlay( [[HistoryOverlayController alloc] initForMode:kHistoryOverlayModeBack]); [overlay showPanelForView:web_contents_view->GetNativeView()]; EXPECT_TRUE(web_contents_view->GetAllowOverlappingViews()); diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm index 39c04b0..bd9cb661 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm @@ -7,7 +7,7 @@ #include <cmath> #include "base/command_line.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/prefs/pref_service.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" @@ -552,21 +552,22 @@ willPositionSheet:(NSWindow*)sheet [bookmarkBubbleController_ ok:self]; // Save the current first responder so we can restore after views are moved. - scoped_nsobject<FocusTracker> focusTracker( + base::scoped_nsobject<FocusTracker> focusTracker( [[FocusTracker alloc] initWithWindow:sourceWindow]); // While we move views (and focus) around, disable any bar visibility changes. [self disableBarVisibilityUpdates]; // Retain the tab strip view while we remove it from its superview. - scoped_nsobject<NSView> tabStripView; + base::scoped_nsobject<NSView> tabStripView; if ([self hasTabStrip]) { tabStripView.reset([[self tabStripView] retain]); [tabStripView removeFromSuperview]; } // Ditto for the content view. - scoped_nsobject<NSView> contentView([[sourceWindow contentView] retain]); + base::scoped_nsobject<NSView> contentView( + [[sourceWindow contentView] retain]); // Disable autoresizing of subviews while we move views around. This prevents // spurious renderer resizes. [contentView setAutoresizesSubviews:NO]; diff --git a/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm b/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm index ce77ea0..cd19e73 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/browser_window_controller.h" #include "base/mac/mac_util.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/prefs/pref_service.h" #include "base/strings/utf_string_conversions.h" @@ -641,7 +641,7 @@ TEST_F(BrowserWindowControllerTest, TestStatusBubblePositioning) { NSPoint bubbleOrigin = [controller_ statusBubbleBaseFrame].origin; // Add a fake subview to devToolsView to emulate docked devTools. - scoped_nsobject<NSView> view( + base::scoped_nsobject<NSView> view( [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 10, 10)]); [[controller_ devToolsView] addSubview:view]; [[controller_ devToolsView] adjustSubviews]; @@ -653,7 +653,7 @@ TEST_F(BrowserWindowControllerTest, TestStatusBubblePositioning) { } TEST_F(BrowserWindowControllerTest, TestSigninMenuItemNoErrors) { - scoped_nsobject<NSMenuItem> syncMenuItem( + base::scoped_nsobject<NSMenuItem> syncMenuItem( [[NSMenuItem alloc] initWithTitle:@"" action:@selector(commandDispatch) keyEquivalent:@""]); @@ -697,7 +697,7 @@ TEST_F(BrowserWindowControllerTest, TestSigninMenuItemNoErrors) { } TEST_F(BrowserWindowControllerTest, TestSigninMenuItemAuthError) { - scoped_nsobject<NSMenuItem> syncMenuItem( + base::scoped_nsobject<NSMenuItem> syncMenuItem( [[NSMenuItem alloc] initWithTitle:@"" action:@selector(commandDispatch) keyEquivalent:@""]); @@ -728,7 +728,7 @@ TEST_F(BrowserWindowControllerTest, TestSigninMenuItemAuthError) { // If there's a separator after the signin menu item, make sure it is hidden/ // shown when the signin menu item is. TEST_F(BrowserWindowControllerTest, TestSigninMenuItemWithSeparator) { - scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@""]); + base::scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@""]); NSMenuItem* signinMenuItem = [menu addItemWithTitle:@"" action:@selector(commandDispatch) @@ -759,7 +759,7 @@ TEST_F(BrowserWindowControllerTest, TestSigninMenuItemWithSeparator) { // If there's a non-separator item after the signin menu item, it should not // change state when the signin menu item is hidden/shown. TEST_F(BrowserWindowControllerTest, TestSigninMenuItemWithNonSeparator) { - scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@""]); + base::scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@""]); NSMenuItem* signinMenuItem = [menu addItemWithTitle:@"" action:@selector(commandDispatch) @@ -809,7 +809,7 @@ TEST_F(BrowserWindowControllerTest, BookmarkBarHitTest) { @private // We release the window ourselves, so we don't have to rely on the unittest // doing it for us. - scoped_nsobject<NSWindow> testFullscreenWindow_; + base::scoped_nsobject<NSWindow> testFullscreenWindow_; } @end diff --git a/chrome/browser/ui/cocoa/bubble_view.h b/chrome/browser/ui/cocoa/bubble_view.h index 336f8cd..12c89f4 100644 --- a/chrome/browser/ui/cocoa/bubble_view.h +++ b/chrome/browser/ui/cocoa/bubble_view.h @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" // A view class that looks like a "bubble" with rounded corners and displays // text inside. Can be themed. To put flush against the sides of a window, the @@ -33,7 +33,7 @@ enum { @interface BubbleView : NSView { @private - scoped_nsobject<NSString> content_; + base::scoped_nsobject<NSString> content_; unsigned long cornerFlags_; // The window from which we get the theme used to draw. In some cases, // it might not be the window we're in. As a result, this may or may not diff --git a/chrome/browser/ui/cocoa/bubble_view.mm b/chrome/browser/ui/cocoa/bubble_view.mm index 4c3d8e0..b9b8648 100644 --- a/chrome/browser/ui/cocoa/bubble_view.mm +++ b/chrome/browser/ui/cocoa/bubble_view.mm @@ -104,7 +104,7 @@ const float kWindowEdge = 0.7f; textColor = themeProvider->GetNSColor(ThemeProperties::COLOR_TAB_TEXT, true); NSFont* textFont = [self font]; - scoped_nsobject<NSShadow> textShadow([[NSShadow alloc] init]); + base::scoped_nsobject<NSShadow> textShadow([[NSShadow alloc] init]); [textShadow setShadowBlurRadius:0.0f]; [textShadow.get() setShadowColor:[textColor gtm_legibleTextColor]]; [textShadow.get() setShadowOffset:NSMakeSize(0.0f, -1.0f)]; diff --git a/chrome/browser/ui/cocoa/bubble_view_unittest.mm b/chrome/browser/ui/cocoa/bubble_view_unittest.mm index 4b8850e..c1b5d9b 100644 --- a/chrome/browser/ui/cocoa/bubble_view_unittest.mm +++ b/chrome/browser/ui/cocoa/bubble_view_unittest.mm @@ -3,7 +3,7 @@ // found in the LICENSE file. -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/bubble_view.h" #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "testing/gtest_mac.h" @@ -12,7 +12,7 @@ class BubbleViewTest : public CocoaTest { public: BubbleViewTest() { NSRect frame = NSMakeRect(0, 0, 50, 50); - scoped_nsobject<BubbleView> view( + base::scoped_nsobject<BubbleView> view( [[BubbleView alloc] initWithFrame:frame themeProvider:test_window()]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; @@ -27,7 +27,7 @@ TEST_VIEW(BubbleViewTest, view_); // Test a nil themeProvider in init. TEST_F(BubbleViewTest, NilThemeProvider) { NSRect frame = NSMakeRect(0, 0, 50, 50); - scoped_nsobject<BubbleView> view( + base::scoped_nsobject<BubbleView> view( [[BubbleView alloc] initWithFrame:frame themeProvider:nil]); [[test_window() contentView] addSubview:view.get()]; [view display]; diff --git a/chrome/browser/ui/cocoa/certificate_viewer_mac.h b/chrome/browser/ui/cocoa/certificate_viewer_mac.h index 737d40d..f33bef2d 100644 --- a/chrome/browser/ui/cocoa/certificate_viewer_mac.h +++ b/chrome/browser/ui/cocoa/certificate_viewer_mac.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_COCOA_CERTIFICATE_VIEWER_MAC_H_ -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h" @@ -21,11 +21,11 @@ namespace net { @interface SSLCertificateViewerCocoa : NSObject<ConstrainedWindowSheet> { @private // The corresponding list of certificates. - scoped_nsobject<NSArray> certificates_; + base::scoped_nsobject<NSArray> certificates_; scoped_ptr<SSLCertificateViewerCocoaBridge> observer_; - scoped_nsobject<SFCertificatePanel> panel_; + base::scoped_nsobject<SFCertificatePanel> panel_; scoped_ptr<ConstrainedWindowMac> constrainedWindow_; - scoped_nsobject<NSWindow> overlayWindow_; + base::scoped_nsobject<NSWindow> overlayWindow_; BOOL closePending_; // A copy of the sheet's frame used to restore on show. NSRect oldSheetFrame_; diff --git a/chrome/browser/ui/cocoa/certificate_viewer_mac.mm b/chrome/browser/ui/cocoa/certificate_viewer_mac.mm index 0e66381..20d5787 100644 --- a/chrome/browser/ui/cocoa/certificate_viewer_mac.mm +++ b/chrome/browser/ui/cocoa/certificate_viewer_mac.mm @@ -10,7 +10,7 @@ #include "base/mac/foundation_util.h" #include "base/mac/scoped_cftyperef.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/certificate_viewer.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" diff --git a/chrome/browser/ui/cocoa/chrome_event_processing_window.h b/chrome/browser/ui/cocoa/chrome_event_processing_window.h index cb69c52..6cbc927 100644 --- a/chrome/browser/ui/cocoa/chrome_event_processing_window.h +++ b/chrome/browser/ui/cocoa/chrome_event_processing_window.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "ui/base/cocoa/underlay_opengl_hosting_window.h" // Override NSWindow to access unhandled keyboard events (for command diff --git a/chrome/browser/ui/cocoa/chrome_event_processing_window_unittest.mm b/chrome/browser/ui/cocoa/chrome_event_processing_window_unittest.mm index 823e7bd..b1566e9 100644 --- a/chrome/browser/ui/cocoa/chrome_event_processing_window_unittest.mm +++ b/chrome/browser/ui/cocoa/chrome_event_processing_window_unittest.mm @@ -5,13 +5,13 @@ #include <Carbon/Carbon.h> #include "base/debug/debugger.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/app/chrome_command_ids.h" -#import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h" +#import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" -#include "third_party/ocmock/gtest_support.h" #import "third_party/ocmock/OCMock/OCMock.h" +#include "third_party/ocmock/gtest_support.h" #import "third_party/ocmock/ocmock_extensions.h" namespace { diff --git a/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.h b/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.h index a91db0d..74ca702 100644 --- a/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.h +++ b/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.h @@ -10,7 +10,7 @@ #include <vector> #include "base/files/file_path.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/chrome_to_mobile_service.h" #import "chrome/browser/ui/cocoa/base_bubble_controller.h" @@ -97,7 +97,7 @@ class ChromeToMobileBubbleNotificationBridge base::FilePath snapshotPath_; // An animation used to cycle through the "Sending..." status messages. - scoped_nsobject<NSAnimation> progressAnimation_; + base::scoped_nsobject<NSAnimation> progressAnimation_; } // The owner of this object is responsible for showing the bubble. It is not diff --git a/chrome/browser/ui/cocoa/clickhold_button_cell.h b/chrome/browser/ui/cocoa/clickhold_button_cell.h index 554e1f6..7e290ae 100644 --- a/chrome/browser/ui/cocoa/clickhold_button_cell.h +++ b/chrome/browser/ui/cocoa/clickhold_button_cell.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/image_button_cell.h" // A button cell that implements "click hold" behavior after a specified delay diff --git a/chrome/browser/ui/cocoa/clickhold_button_cell_unittest.mm b/chrome/browser/ui/cocoa/clickhold_button_cell_unittest.mm index f76f805..0786271 100644 --- a/chrome/browser/ui/cocoa/clickhold_button_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/clickhold_button_cell_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/clickhold_button_cell.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" @@ -16,9 +16,10 @@ class ClickHoldButtonCellTest : public CocoaTest { public: ClickHoldButtonCellTest() { NSRect frame = NSMakeRect(0, 0, 50, 30); - scoped_nsobject<NSButton> view([[NSButton alloc] initWithFrame:frame]); + base::scoped_nsobject<NSButton> view( + [[NSButton alloc] initWithFrame:frame]); view_ = view.get(); - scoped_nsobject<ClickHoldButtonCell> cell( + base::scoped_nsobject<ClickHoldButtonCell> cell( [[ClickHoldButtonCell alloc] initTextCell:@"Testing"]); [view_ setCell:cell.get()]; [[test_window() contentView] addSubview:view_]; diff --git a/chrome/browser/ui/cocoa/color_chooser_mac.mm b/chrome/browser/ui/cocoa/color_chooser_mac.mm index f5e8dda..2241818 100644 --- a/chrome/browser/ui/cocoa/color_chooser_mac.mm +++ b/chrome/browser/ui/cocoa/color_chooser_mac.mm @@ -5,7 +5,7 @@ #import <Cocoa/Cocoa.h> #include "base/logging.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/browser_dialogs.h" #include "content/public/browser/color_chooser.h" #include "content/public/browser/web_contents.h" @@ -54,7 +54,7 @@ class ColorChooserMac : public content::ColorChooser { // The web contents invoking the color chooser. No ownership because it will // outlive this class. content::WebContents* web_contents_; - scoped_nsobject<ColorPanelCocoa> panel_; + base::scoped_nsobject<ColorPanelCocoa> panel_; }; ColorChooserMac* ColorChooserMac::current_color_chooser_ = NULL; diff --git a/chrome/browser/ui/cocoa/command_observer_bridge_unittest.mm b/chrome/browser/ui/cocoa/command_observer_bridge_unittest.mm index ed973b1..eb65c2e 100644 --- a/chrome/browser/ui/cocoa/command_observer_bridge_unittest.mm +++ b/chrome/browser/ui/cocoa/command_observer_bridge_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/command_updater.h" #import "chrome/browser/ui/cocoa/command_observer_bridge.h" @@ -45,7 +45,7 @@ class CommandObserverBridgeTest : public PlatformTest { observer_([[CommandTestObserver alloc] init]) { } scoped_ptr<CommandUpdater> updater_; - scoped_nsobject<CommandTestObserver> observer_; + base::scoped_nsobject<CommandTestObserver> observer_; }; // Tests creation and deletion. NULL arguments aren't allowed. diff --git a/chrome/browser/ui/cocoa/confirm_bubble_cocoa.h b/chrome/browser/ui/cocoa/confirm_bubble_cocoa.h index 8d2a3f3..c1971b0 100644 --- a/chrome/browser/ui/cocoa/confirm_bubble_cocoa.h +++ b/chrome/browser/ui/cocoa/confirm_bubble_cocoa.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" @class ConfirmBubbleController; class ConfirmBubbleModel; @@ -37,11 +37,11 @@ class ConfirmBubbleModel; ConfirmBubbleController* controller_; // weak // Controls used in this bubble. - scoped_nsobject<NSImageView> icon_; - scoped_nsobject<NSTextView> titleLabel_; - scoped_nsobject<NSTextView> messageLabel_; - scoped_nsobject<NSButton> okButton_; - scoped_nsobject<NSButton> cancelButton_; + base::scoped_nsobject<NSImageView> icon_; + base::scoped_nsobject<NSTextView> titleLabel_; + base::scoped_nsobject<NSTextView> messageLabel_; + base::scoped_nsobject<NSButton> okButton_; + base::scoped_nsobject<NSButton> cancelButton_; } // Initializes a bubble view. Since this initializer programmatically creates a diff --git a/chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm b/chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm index b16acea..474bf21 100644 --- a/chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm +++ b/chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm @@ -215,17 +215,17 @@ void ShowConfirmBubble(gfx::NativeView view, initWithFrame:NSMakeRect(left, bottom, kMaxMessageWidth, 0)]); NSString* messageText = [controller_ messageText]; NSMutableDictionary* attributes = [NSMutableDictionary dictionary]; - scoped_nsobject<NSMutableAttributedString> attributedMessage( + base::scoped_nsobject<NSMutableAttributedString> attributedMessage( [[NSMutableAttributedString alloc] initWithString:messageText attributes:attributes]); NSString* linkText = [controller_ linkText]; if (linkText) { - scoped_nsobject<NSAttributedString> whiteSpace( + base::scoped_nsobject<NSAttributedString> whiteSpace( [[NSAttributedString alloc] initWithString:@" "]); [attributedMessage.get() appendAttributedString:whiteSpace.get()]; [attributes setObject:[NSString string] forKey:NSLinkAttributeName]; - scoped_nsobject<NSAttributedString> attributedLink( + base::scoped_nsobject<NSAttributedString> attributedLink( [[NSAttributedString alloc] initWithString:linkText attributes:attributes]); [attributedMessage.get() appendAttributedString:attributedLink.get()]; diff --git a/chrome/browser/ui/cocoa/confirm_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/confirm_bubble_controller_unittest.mm index 76d605ba..05b4652 100644 --- a/chrome/browser/ui/cocoa/confirm_bubble_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/confirm_bubble_controller_unittest.mm @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "base/compiler_specific.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" diff --git a/chrome/browser/ui/cocoa/confirm_quit_panel_controller.mm b/chrome/browser/ui/cocoa/confirm_quit_panel_controller.mm index 659fff8..27813eb 100644 --- a/chrome/browser/ui/cocoa/confirm_quit_panel_controller.mm +++ b/chrome/browser/ui/cocoa/confirm_quit_panel_controller.mm @@ -8,7 +8,7 @@ #import "chrome/browser/ui/cocoa/confirm_quit_panel_controller.h" #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/metrics/histogram.h" #include "base/prefs/pref_registry_simple.h" #include "base/strings/sys_string_conversions.h" @@ -65,7 +65,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) { - (id)initWithFrame:(NSRect)frameRect { if ((self = [super initWithFrame:frameRect])) { - scoped_nsobject<NSTextField> message( + base::scoped_nsobject<NSTextField> message( // The frame will be fixed up when |-setMessageText:| is called. [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)]); message_ = message.get(); @@ -95,9 +95,9 @@ void RegisterLocalState(PrefRegistrySimple* registry) { const CGFloat kHorizontalPadding = 30; // In view coordinates. // Style the string. - scoped_nsobject<NSMutableAttributedString> attrString( + base::scoped_nsobject<NSMutableAttributedString> attrString( [[NSMutableAttributedString alloc] initWithString:text]); - scoped_nsobject<NSShadow> textShadow([[NSShadow alloc] init]); + base::scoped_nsobject<NSShadow> textShadow([[NSShadow alloc] init]); [textShadow.get() setShadowColor:[NSColor colorWithCalibratedWhite:0 alpha:0.6]]; [textShadow.get() setShadowOffset:NSMakeSize(0, -1)]; @@ -192,7 +192,7 @@ ConfirmQuitPanelController* g_confirmQuitPanelController = nil; - (id)init { const NSRect kWindowFrame = NSMakeRect(0, 0, 350, 70); - scoped_nsobject<NSWindow> window( + base::scoped_nsobject<NSWindow> window( [[NSWindow alloc] initWithContentRect:kWindowFrame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered @@ -205,7 +205,7 @@ ConfirmQuitPanelController* g_confirmQuitPanelController = nil; // Create the content view. Take the frame from the existing content view. NSRect frame = [[window contentView] frame]; - scoped_nsobject<ConfirmQuitFrameView> frameView( + base::scoped_nsobject<ConfirmQuitFrameView> frameView( [[ConfirmQuitFrameView alloc] initWithFrame:frame]); contentView_ = frameView.get(); [window setContentView:contentView_]; @@ -230,7 +230,7 @@ ConfirmQuitPanelController* g_confirmQuitPanelController = nil; } - (NSApplicationTerminateReply)runModalLoopForApplication:(NSApplication*)app { - scoped_nsobject<ConfirmQuitPanelController> keepAlive([self retain]); + base::scoped_nsobject<ConfirmQuitPanelController> keepAlive([self retain]); // If this is the second of two such attempts to quit within a certain time // interval, then just quit. @@ -327,7 +327,7 @@ ConfirmQuitPanelController* g_confirmQuitPanelController = nil; - (void)showWindow:(id)sender { // If a panel that is fading out is going to be reused here, make sure it // does not get released when the animation finishes. - scoped_nsobject<ConfirmQuitPanelController> keepAlive([self retain]); + base::scoped_nsobject<ConfirmQuitPanelController> keepAlive([self retain]); [[self window] setAnimations:[NSDictionary dictionary]]; [[self window] center]; [[self window] setAlphaValue:1.0]; @@ -342,7 +342,7 @@ ConfirmQuitPanelController* g_confirmQuitPanelController = nil; - (void)animateFadeOut { NSWindow* window = [self window]; - scoped_nsobject<CAAnimation> animation( + base::scoped_nsobject<CAAnimation> animation( [[window animationForKey:@"alphaValue"] copy]); [animation setDelegate:self]; [animation setDuration:0.2]; diff --git a/chrome/browser/ui/cocoa/confirm_quit_panel_controller_unittest.mm b/chrome/browser/ui/cocoa/confirm_quit_panel_controller_unittest.mm index 0348801..d330230 100644 --- a/chrome/browser/ui/cocoa/confirm_quit_panel_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/confirm_quit_panel_controller_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/confirm_quit_panel_controller.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "chrome/browser/ui/cocoa/confirm_quit.h" #include "testing/gtest_mac.h" diff --git a/chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm b/chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm index 3a718a4..36529a9 100644 --- a/chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm +++ b/chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm @@ -6,7 +6,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" @@ -95,7 +95,7 @@ class ConstrainedWebDialogDelegateViewMac : private: scoped_ptr<ConstrainedWebDialogDelegateMac> impl_; scoped_ptr<ConstrainedWindowMac> constrained_window_; - scoped_nsobject<NSWindow> window_; + base::scoped_nsobject<NSWindow> window_; DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateViewMac); }; @@ -119,9 +119,8 @@ ConstrainedWebDialogDelegateViewMac::ConstrainedWebDialogDelegateViewMac( [[window_ contentView] addSubview:GetWebContents()->GetView()->GetNativeView()]; - scoped_nsobject<CustomConstrainedWindowSheet> sheet( - [[CustomConstrainedWindowSheet alloc] - initWithCustomWindow:window_]); + base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( + [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window_]); constrained_window_.reset(new ConstrainedWindowMac( this, web_contents, sheet)); diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h b/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h index ac2f34c..389f6a8 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" // This class implements an alert that has a constrained window look and feel // (close button on top right, WebUI style buttons, etc...). The alert can be @@ -15,12 +15,12 @@ // this would be done by ConstrainedWindowSheetController. @interface ConstrainedWindowAlert : NSObject { @private - scoped_nsobject<NSTextField> informativeTextField_; - scoped_nsobject<NSTextField> messageTextField_; - scoped_nsobject<NSView> accessoryView_; - scoped_nsobject<NSMutableArray> buttons_; - scoped_nsobject<NSButton> closeButton_; - scoped_nsobject<NSWindow> window_; + base::scoped_nsobject<NSTextField> informativeTextField_; + base::scoped_nsobject<NSTextField> messageTextField_; + base::scoped_nsobject<NSView> accessoryView_; + base::scoped_nsobject<NSMutableArray> buttons_; + base::scoped_nsobject<NSButton> closeButton_; + base::scoped_nsobject<NSWindow> window_; } @property(nonatomic, copy) NSString* informativeText; diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.mm index 7fda80b..036c42a 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.mm @@ -110,7 +110,7 @@ const CGFloat kButtonGap = 6; action:(SEL)action { if (!buttons_.get()) buttons_.reset([[NSMutableArray alloc] init]); - scoped_nsobject<NSButton> button( + base::scoped_nsobject<NSButton> button( [[ConstrainedWindowButton alloc] initWithFrame:NSZeroRect]); [button setTitle:title]; [button setKeyEquivalent:keyEquivalent]; diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert_unittest.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert_unittest.mm index 52f6ca1..868f81d 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert_unittest.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_alert_unittest.mm @@ -11,7 +11,7 @@ class ConstrainedWindowAlertTest : public CocoaTest { // Test showing the alert. TEST_F(ConstrainedWindowAlertTest, Show) { - scoped_nsobject<ConstrainedWindowAlert> alert( + base::scoped_nsobject<ConstrainedWindowAlert> alert( [[ConstrainedWindowAlert alloc] init]); EXPECT_TRUE([alert window]); EXPECT_TRUE([alert closeButton]); @@ -27,7 +27,7 @@ TEST_F(ConstrainedWindowAlertTest, Show) { // Test showing the alert with no buttons. TEST_F(ConstrainedWindowAlertTest, NoButtons) { - scoped_nsobject<ConstrainedWindowAlert> alert( + base::scoped_nsobject<ConstrainedWindowAlert> alert( [[ConstrainedWindowAlert alloc] init]); [alert layout]; [[alert window] makeKeyAndOrderFront:nil]; @@ -35,13 +35,13 @@ TEST_F(ConstrainedWindowAlertTest, NoButtons) { // Test adding an accessory view to an alert. TEST_F(ConstrainedWindowAlertTest, AccessoryView) { - scoped_nsobject<ConstrainedWindowAlert> alert( + base::scoped_nsobject<ConstrainedWindowAlert> alert( [[ConstrainedWindowAlert alloc] init]); [alert addButtonWithTitle:@"OK" keyEquivalent:@"" target:nil action:NULL]; [alert addButtonWithTitle:@"Cancel" keyEquivalent:@"" target:nil action:NULL]; NSRect view_rect = NSMakeRect(0, 0, 700, 300); - scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:view_rect]); + base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:view_rect]); EXPECT_FALSE([alert accessoryView]); [alert setAccessoryView:view]; EXPECT_NSEQ([alert accessoryView], view); diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_animation.h b/chrome/browser/ui/cocoa/constrained_window/constrained_window_animation.h index 3248411..635a6e6 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_animation.h +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_animation.h @@ -7,12 +7,12 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" // Base class for all constrained window animation classes. @interface ConstrainedWindowAnimationBase : NSAnimation { @protected - scoped_nsobject<NSWindow> window_; + base::scoped_nsobject<NSWindow> window_; } - (id)initWithWindow:(NSWindow*)window; diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_animation_unittest.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_animation_unittest.mm index 9c7c2bd..5ec022f 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_animation_unittest.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_animation_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/message_loop/message_pump_mac.h" -#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_animation.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" +#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_animation.h" // This class runs an animation for exactly two frames then end it. @interface ConstrainedWindowAnimationTestDelegate : NSObject @@ -57,26 +57,26 @@ class ConstrainedWindowAnimationTest : public CocoaTest { delegate_.reset([[ConstrainedWindowAnimationTestDelegate alloc] init]); } - scoped_nsobject<ConstrainedWindowAnimationTestDelegate> delegate_; + base::scoped_nsobject<ConstrainedWindowAnimationTestDelegate> delegate_; }; // Test the show animation. TEST_F(ConstrainedWindowAnimationTest, Show) { - scoped_nsobject<NSAnimation> animation( + base::scoped_nsobject<NSAnimation> animation( [[ConstrainedWindowAnimationShow alloc] initWithWindow:test_window()]); [delegate_ runAnimation:animation]; } // Test the hide animation. TEST_F(ConstrainedWindowAnimationTest, Hide) { - scoped_nsobject<NSAnimation> animation( + base::scoped_nsobject<NSAnimation> animation( [[ConstrainedWindowAnimationHide alloc] initWithWindow:test_window()]); [delegate_ runAnimation:animation]; } // Test the pulse animation. TEST_F(ConstrainedWindowAnimationTest, Pulse) { - scoped_nsobject<NSAnimation> animation( + base::scoped_nsobject<NSAnimation> animation( [[ConstrainedWindowAnimationPulse alloc] initWithWindow:test_window()]); [delegate_ runAnimation:animation]; } diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm index fb07d84..39e4a3f 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/key_equivalent_constants.h" #include "skia/ext/skia_utils_mac.h" #import "third_party/molokocacao/NSBezierPath+MCAdditions.h" @@ -88,13 +88,13 @@ NSAttributedString* GetButtonAttributedString(NSString* title, const SkColor shadow_color[] = {0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0xFFFFFFFF}; - scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); + base::scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); [shadow setShadowColor: gfx::SkColorToCalibratedNSColor(shadow_color[button_state])]; [shadow setShadowOffset:NSMakeSize(0, -1)]; [shadow setShadowBlurRadius:0]; - scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( + base::scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( [[NSMutableParagraphStyle alloc] init]); [paragraphStyle setAlignment:NSCenterTextAlignment]; diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_button_unittest.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_button_unittest.mm index 3f0628b..ed9b40c 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_button_unittest.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_button_unittest.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/memory/scoped_nsobject.h" -#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" +#import "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" +#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -19,7 +19,7 @@ class ConstrainedWindowButtonTest : public CocoaTest { } protected: - scoped_nsobject<ConstrainedWindowButton> button_; + base::scoped_nsobject<ConstrainedWindowButton> button_; }; TEST_VIEW(ConstrainedWindowButtonTest, button_) diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_control_utils.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_control_utils.mm index 5d73a8f..2be3ee7 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_control_utils.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_control_utils.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_control_utils.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "skia/ext/skia_utils_mac.h" namespace constrained_window { @@ -29,7 +29,7 @@ NSAttributedString* GetAttributedLabelString( const gfx::Font& font = ui::ResourceBundle::GetSharedInstance().GetFont(fontStyle); - scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( + base::scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( [[NSMutableParagraphStyle alloc] init]); [paragraphStyle setAlignment:alignment]; [paragraphStyle setLineBreakMode:lineBreakMode]; diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h b/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h index d1b6007..b36f07e 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h @@ -7,14 +7,14 @@ #import <Cocoa/Cocoa.h> +#import "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h" -#import "base/memory/scoped_nsobject.h" // Represents a custom sheet. The sheet's window is shown without using the // system |beginSheet:...| API. @interface CustomConstrainedWindowSheet : NSObject<ConstrainedWindowSheet> { @private - scoped_nsobject<NSWindow> customWindow_; + base::scoped_nsobject<NSWindow> customWindow_; } - (id)initWithCustomWindow:(NSWindow*)customWindow; diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.mm index 28668aa..ab3d83e 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.mm @@ -17,7 +17,7 @@ } - (void)showSheetForWindow:(NSWindow*)window { - scoped_nsobject<NSAnimation> animation( + base::scoped_nsobject<NSAnimation> animation( [[ConstrainedWindowAnimationShow alloc] initWithWindow:customWindow_]); [window addChildWindow:customWindow_ ordered:NSWindowAbove]; @@ -29,7 +29,7 @@ - (void)closeSheetWithAnimation:(BOOL)withAnimation { if (withAnimation) { - scoped_nsobject<NSAnimation> animation( + base::scoped_nsobject<NSAnimation> animation( [[ConstrainedWindowAnimationHide alloc] initWithWindow:customWindow_]); [animation startAnimation]; } @@ -47,7 +47,7 @@ } - (void)pulseSheet { - scoped_nsobject<NSAnimation> animation( + base::scoped_nsobject<NSAnimation> animation( [[ConstrainedWindowAnimationPulse alloc] initWithWindow:customWindow_]); [animation startAnimation]; } diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.mm index 984b176..cf972e0 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/chrome_style.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.h" #include "skia/ext/skia_utils_mac.h" @@ -17,7 +17,7 @@ styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO])) { - scoped_nsobject<NSView> contentView( + base::scoped_nsobject<NSView> contentView( [[ConstrainedWindowCustomWindowContentView alloc] initWithFrame:NSZeroRect]); [self setContentView:contentView]; diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window_unittest.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window_unittest.mm index f40ac1a..91dc464 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window_unittest.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window_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. -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.h" @@ -11,7 +11,7 @@ class ConstrainedWindowCustomWindowTest : public CocoaTest { // Simply test creating and drawing the window. TEST_F(ConstrainedWindowCustomWindowTest, Basic) { - scoped_nsobject<ConstrainedWindowCustomWindow> window( + base::scoped_nsobject<ConstrainedWindowCustomWindow> window( [[ConstrainedWindowCustomWindow alloc] initWithContentRect:NSMakeRect(0, 0, 10, 10)]); EXPECT_TRUE([window canBecomeKeyWindow]); diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h index 3707539..73202e8 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "components/web_modal/native_web_contents_modal_dialog.h" namespace content { @@ -50,7 +50,7 @@ class ConstrainedWindowMac { // The WebContents that owns and constrains this ConstrainedWindowMac. Weak. content::WebContents* web_contents_; - scoped_nsprotocol<id<ConstrainedWindowSheet>> sheet_; + base::scoped_nsprotocol<id<ConstrainedWindowSheet>> sheet_; // This is true if the constrained window has been shown. bool shown_; diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm index 6147583..04bc13a 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm @@ -66,8 +66,8 @@ class ConstrainedWindowMacTest : public InProcessBrowserTest { } protected: - scoped_nsobject<CustomConstrainedWindowSheet> sheet_; - scoped_nsobject<NSWindow> sheet_window_; + base::scoped_nsobject<CustomConstrainedWindowSheet> sheet_; + base::scoped_nsobject<NSWindow> sheet_window_; content::WebContents* tab0_; content::WebContents* tab1_; BrowserWindowController* controller_; @@ -137,7 +137,7 @@ IN_PROC_BROWSER_TEST_F(ConstrainedWindowMacTest, BrowserWindowClose) { EXPECT_EQ(1.0, [sheet_window_ alphaValue]); // Close the browser window. - scoped_nsobject<NSWindow> browser_window( + base::scoped_nsobject<NSWindow> browser_window( [browser()->window()->GetNativeWindow() retain]); EXPECT_TRUE([browser_window isVisible]); [browser()->window()->GetNativeWindow() performClose:nil]; diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.h b/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.h index 3223ac2..329594e 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.h +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.h @@ -8,8 +8,8 @@ #import <Cocoa/Cocoa.h> #include <vector> +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_vector.h" -#include "base/memory/scoped_nsobject.h" @protocol ConstrainedWindowSheet; @@ -18,9 +18,9 @@ // A tab in this case is the |parentView| passed to |-showSheet:forParentView:|. @interface ConstrainedWindowSheetController : NSObject { @private - scoped_nsobject<NSMutableArray> sheets_; - scoped_nsobject<NSWindow> parentWindow_; - scoped_nsobject<NSView> activeView_; + base::scoped_nsobject<NSMutableArray> sheets_; + base::scoped_nsobject<NSWindow> parentWindow_; + base::scoped_nsobject<NSView> activeView_; } // Returns a sheet controller for |parentWindow|. If a sheet controller does not diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm index c801d25..b4b4236 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm @@ -25,7 +25,7 @@ NSValue* GetKeyForParentWindow(NSWindow* parent_window) { // An invisible overlay window placed on top of the sheet's parent view. // This window blocks interaction with the underlying view. @interface CWSheetOverlayWindow : NSWindow { - scoped_nsobject<ConstrainedWindowSheetController> controller_; + base::scoped_nsobject<ConstrainedWindowSheetController> controller_; } @end @@ -78,7 +78,7 @@ NSValue* GetKeyForParentWindow(NSWindow* parent_window) { if (controller) return controller; - scoped_nsobject<ConstrainedWindowSheetController> new_controller( + base::scoped_nsobject<ConstrainedWindowSheetController> new_controller( [[ConstrainedWindowSheetController alloc] initWithParentWindow:parentWindow]); if (!g_sheetControllers) @@ -140,14 +140,13 @@ NSValue* GetKeyForParentWindow(NSWindow* parent_window) { // Create an invisible overlay window. NSRect rect = [self overlayWindowFrameForParentView:parentView]; - scoped_nsobject<NSWindow> overlayWindow( - [[CWSheetOverlayWindow alloc] initWithContentRect:rect - controller:self]); + base::scoped_nsobject<NSWindow> overlayWindow( + [[CWSheetOverlayWindow alloc] initWithContentRect:rect controller:self]); [parentWindow_ addChildWindow:overlayWindow ordered:NSWindowAbove]; // Add an entry for the sheet. - scoped_nsobject<ConstrainedWindowSheetInfo> info( + base::scoped_nsobject<ConstrainedWindowSheetInfo> info( [[ConstrainedWindowSheetInfo alloc] initWithSheet:sheet parentView:parentView overlayWindow:overlayWindow]); diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller_unittest.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller_unittest.mm index fdba717..562155a 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller_unittest.mm @@ -79,7 +79,8 @@ class ConstrainedWindowSheetControllerTest : public CocoaTest { NSRect dummyRect = NSMakeRect(0, 0, 50, 50); tab_views_.reset([[NSMutableArray alloc] init]); for (int i = 0; i < 2; ++i) { - scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:dummyRect]); + base::scoped_nsobject<NSView> view( + [[NSView alloc] initWithFrame:dummyRect]); [tab_views_ addObject:view]; } tab0_.reset([[tab_views_ objectAtIndex:0] retain]); @@ -135,13 +136,13 @@ class ConstrainedWindowSheetControllerTest : public CocoaTest { EXPECT_EQ(expected_x, NSMinX(sheet_frame)); } - scoped_nsobject<NSWindow> sheet_window_; - scoped_nsobject<CustomConstrainedWindowSheet> sheet_; - scoped_nsobject<ConstrainedWindowSheetController> controller_; - scoped_nsobject<NSMutableArray> tab_views_; - scoped_nsobject<NSView> active_tab_view_; - scoped_nsobject<NSView> tab0_; - scoped_nsobject<NSView> tab1_; + base::scoped_nsobject<NSWindow> sheet_window_; + base::scoped_nsobject<CustomConstrainedWindowSheet> sheet_; + base::scoped_nsobject<ConstrainedWindowSheetController> controller_; + base::scoped_nsobject<NSMutableArray> tab_views_; + base::scoped_nsobject<NSView> active_tab_view_; + base::scoped_nsobject<NSView> tab0_; + base::scoped_nsobject<NSView> tab1_; }; // Test showing then hiding the sheet. @@ -183,11 +184,11 @@ TEST_F(ConstrainedWindowSheetControllerTest, AddToInactiveTab) { // Test that two parent windows with two sheet controllers don't conflict. TEST_F(ConstrainedWindowSheetControllerTest, TwoParentWindows) { - scoped_nsobject<NSWindow> parent_window2([[NSWindow alloc] - initWithContentRect:NSMakeRect(0, 0, 30, 30) - styleMask:NSTitledWindowMask - backing:NSBackingStoreBuffered - defer:NO]); + base::scoped_nsobject<NSWindow> parent_window2( + [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 30, 30) + styleMask:NSTitledWindowMask + backing:NSBackingStoreBuffered + defer:NO]); [parent_window2 setReleasedWhenClosed:NO]; ConstrainedWindowSheetController* controller2 = @@ -255,9 +256,9 @@ TEST_F(ConstrainedWindowSheetControllerTest, ResizeHiddenSheet) { // Test system sheets. TEST_F(ConstrainedWindowSheetControllerTest, SystemSheet) { - scoped_nsobject<ConstrainedWindowSystemSheetTest> system_sheet( + base::scoped_nsobject<ConstrainedWindowSystemSheetTest> system_sheet( [[ConstrainedWindowSystemSheetTest alloc] init]); - scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]); + base::scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]); [system_sheet setAlert:alert]; EXPECT_FALSE([[alert window] isVisible]); @@ -272,9 +273,9 @@ TEST_F(ConstrainedWindowSheetControllerTest, SystemSheet) { // Test showing a system sheet on an inactive tab. TEST_F(ConstrainedWindowSheetControllerTest, SystemSheetAddToInactiveTab) { - scoped_nsobject<ConstrainedWindowSystemSheetTest> system_sheet( + base::scoped_nsobject<ConstrainedWindowSystemSheetTest> system_sheet( [[ConstrainedWindowSystemSheetTest alloc] init]); - scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]); + base::scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]); [system_sheet setAlert:alert]; EXPECT_FALSE([[alert window] isVisible]); diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_info.h b/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_info.h index 0c3c19b..b72e4f6 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_info.h +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_info.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" @protocol ConstrainedWindowSheet; @@ -16,9 +16,9 @@ // public use. @interface ConstrainedWindowSheetInfo : NSObject { @private - scoped_nsprotocol<id<ConstrainedWindowSheet>> sheet_; - scoped_nsobject<NSView> parentView_; - scoped_nsobject<NSWindow> overlayWindow_; + base::scoped_nsprotocol<id<ConstrainedWindowSheet>> sheet_; + base::scoped_nsobject<NSView> parentView_; + base::scoped_nsobject<NSWindow> overlayWindow_; BOOL sheetDidShow_; } diff --git a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h index 2d0c06b..71d193f 100644 --- a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h +++ b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/browsing_data/cookies_tree_model.h" #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" @@ -48,7 +48,7 @@ class CollectedCookiesMac : public ConstrainedWindowMacDelegate, scoped_ptr<ConstrainedWindowMac> window_; - scoped_nsobject<CollectedCookiesWindowController> sheet_controller_; + base::scoped_nsobject<CollectedCookiesWindowController> sheet_controller_; DISALLOW_COPY_AND_ASSIGN(CollectedCookiesMac); }; @@ -68,11 +68,11 @@ class CollectedCookiesMac : public ConstrainedWindowMacDelegate, scoped_ptr<CookiesTreeModel> blockedTreeModel_; // Cached array of icons. - scoped_nsobject<NSMutableArray> icons_; + base::scoped_nsobject<NSMutableArray> icons_; // Our Cocoa copy of the model. - scoped_nsobject<CocoaCookieTreeNode> cocoaAllowedTreeModel_; - scoped_nsobject<CocoaCookieTreeNode> cocoaBlockedTreeModel_; + base::scoped_nsobject<CocoaCookieTreeNode> cocoaAllowedTreeModel_; + base::scoped_nsobject<CocoaCookieTreeNode> cocoaBlockedTreeModel_; BOOL allowedCookiesButtonsEnabled_; BOOL blockedCookiesButtonsEnabled_; @@ -89,9 +89,9 @@ class CollectedCookiesMac : public ConstrainedWindowMacDelegate, IBOutlet NSTextField* blockedCookiesText_; IBOutlet NSView* cookieDetailsViewPlaceholder_; - scoped_nsobject<NSViewAnimation> animation_; + base::scoped_nsobject<NSViewAnimation> animation_; - scoped_nsobject<CookieDetailsViewController> detailsViewController_; + base::scoped_nsobject<CookieDetailsViewController> detailsViewController_; content::WebContents* webContents_; // weak diff --git a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm index f1e44d9..93e537c 100644 --- a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm +++ b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm @@ -82,7 +82,7 @@ CollectedCookiesMac::CollectedCookiesMac(content::WebContents* web_contents) { initWithWebContents:web_contents collectedCookiesMac:this]); - scoped_nsobject<CustomConstrainedWindowSheet> sheet( + base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:[sheet_controller_ window]]); window_.reset(new ConstrainedWindowMac( @@ -170,7 +170,7 @@ void CollectedCookiesMac::OnConstrainedWindowClosed( green:kBannerGradientColorBottom[1] blue:kBannerGradientColorBottom[2] alpha:1.0]; - scoped_nsobject<NSGradient> bannerGradient( + base::scoped_nsobject<NSGradient> bannerGradient( [[NSGradient alloc] initWithStartingColor:bannerStartingColor endingColor:bannerEndingColor]); [infoBar_ setGradient:bannerGradient]; @@ -382,7 +382,7 @@ void CollectedCookiesMac::OnConstrainedWindowClosed( // Create the Cocoa model. CookieTreeNode* root = static_cast<CookieTreeNode*>(allowedTreeModel_->GetRoot()); - scoped_nsobject<CocoaCookieTreeNode> model( + base::scoped_nsobject<CocoaCookieTreeNode> model( [[CocoaCookieTreeNode alloc] initWithNode:root]); [self setCocoaAllowedTreeModel:model.get()]; // Takes ownership. root = static_cast<CookieTreeNode*>(blockedTreeModel_->GetRoot()); diff --git a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h index d6097dd..081f98d 100644 --- a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h +++ b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h @@ -6,7 +6,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/base_bubble_controller.h" #include "content/public/common/media_stream_request.h" @@ -91,4 +91,4 @@ typedef std::map<NSPopUpButton*, MediaMenuParts*> MediaMenuPartsMap; // Returns the weak reference to the |mediaMenus_|. - (content_setting_bubble::MediaMenuPartsMap*)mediaMenus; -@end
\ No newline at end of file +@end diff --git a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm index 7d1c13c..5040e5b 100644 --- a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm +++ b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm @@ -90,7 +90,7 @@ NSTextField* LabelWithFrame(NSString* text, const NSRect& frame) { // Sets the title for the popup button. void SetTitleForPopUpButton(NSPopUpButton* button, NSString* title) { - scoped_nsobject<NSMenuItem> titleItem([[NSMenuItem alloc] init]); + base::scoped_nsobject<NSMenuItem> titleItem([[NSMenuItem alloc] init]); [titleItem setTitle:title]; [[button cell] setUsesItemFromMenu:NO]; [[button cell] setMenuItem:titleItem.get()]; @@ -293,8 +293,8 @@ MediaMenuParts::~MediaMenuParts() {} title:(NSString*)title icon:(NSImage*)icon referenceFrame:(NSRect)referenceFrame { - scoped_nsobject<HyperlinkButtonCell> cell([[HyperlinkButtonCell alloc] - initTextCell:title]); + base::scoped_nsobject<HyperlinkButtonCell> cell( + [[HyperlinkButtonCell alloc] initTextCell:title]); [cell.get() setAlignment:NSNaturalTextAlignment]; if (icon) { [cell.get() setImagePosition:NSImageLeft]; @@ -410,7 +410,7 @@ MediaMenuParts::~MediaMenuParts() {} // "Clear" button / text field. if (!content.custom_link.empty()) { - scoped_nsobject<NSControl> control; + base::scoped_nsobject<NSControl> control; if(content.custom_link_enabled) { NSRect buttonFrame = NSMakeRect(0, 0, NSWidth(containerFrame), @@ -512,7 +512,7 @@ MediaMenuParts::~MediaMenuParts() {} // |buttonFrame| will be resized and repositioned later on. NSRect buttonFrame = NSMakeRect(NSMinX(radioFrame), 0, 0, 0); - scoped_nsobject<NSPopUpButton> button( + base::scoped_nsobject<NSPopUpButton> button( [[NSPopUpButton alloc] initWithFrame:buttonFrame]); [button setTarget:self]; diff --git a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm index f7f1a43..fee3a79 100644 --- a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm +++ b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_unittest.mm @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> #include "base/mac/scoped_nsautorelease_pool.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/media/media_capture_devices_dispatcher.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" @@ -48,7 +48,7 @@ class ContentSettingBubbleControllerTest ContentSettingBubbleController* CreateBubbleController( ContentSettingsType settingsType); - scoped_nsobject<NSWindow> parent_; + base::scoped_nsobject<NSWindow> parent_; private: base::mac::ScopedNSAutoreleasePool pool_; diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_details.h b/chrome/browser/ui/cocoa/content_settings/cookie_details.h index ca439d8..c0c9c84 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_details.h +++ b/chrome/browser/ui/cocoa/content_settings/cookie_details.h @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/browsing_data/browsing_data_database_helper.h" #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" @@ -75,52 +75,52 @@ enum CocoaCookieDetailsType { BOOL hasExpiration_; // Only set for type kCocoaCookieDetailsTypeCookie. - scoped_nsobject<NSString> content_; - scoped_nsobject<NSString> path_; - scoped_nsobject<NSString> sendFor_; + base::scoped_nsobject<NSString> content_; + base::scoped_nsobject<NSString> path_; + base::scoped_nsobject<NSString> sendFor_; // Stringifed dates. - scoped_nsobject<NSString> expires_; + base::scoped_nsobject<NSString> expires_; // Only set for type kCocoaCookieDetailsTypeCookie and // kCocoaCookieDetailsTypeTreeAppCache nodes. - scoped_nsobject<NSString> created_; + base::scoped_nsobject<NSString> created_; // Only set for types kCocoaCookieDetailsTypeCookie, and // kCocoaCookieDetailsTypePromptDatabase nodes. - scoped_nsobject<NSString> name_; + base::scoped_nsobject<NSString> name_; // Only set for type kCocoaCookieDetailsTypeTreeLocalStorage, // kCocoaCookieDetailsTypeTreeDatabase, // kCocoaCookieDetailsTypePromptDatabase, // kCocoaCookieDetailsTypeTreeIndexedDB, and // kCocoaCookieDetailsTypeTreeAppCache nodes. - scoped_nsobject<NSString> fileSize_; + base::scoped_nsobject<NSString> fileSize_; // Only set for types kCocoaCookieDetailsTypeTreeLocalStorage, // kCocoaCookieDetailsTypeTreeDatabase, and // kCocoaCookieDetailsTypeTreeIndexedDB nodes. - scoped_nsobject<NSString> lastModified_; + base::scoped_nsobject<NSString> lastModified_; // Only set for type kCocoaCookieDetailsTypeTreeAppCache nodes. - scoped_nsobject<NSString> lastAccessed_; + base::scoped_nsobject<NSString> lastAccessed_; // Only set for type kCocoaCookieDetailsTypeCookie, // kCocoaCookieDetailsTypePromptDatabase, // kCocoaCookieDetailsTypePromptLocalStorage, and // kCocoaCookieDetailsTypeTreeIndexedDB nodes. - scoped_nsobject<NSString> domain_; + base::scoped_nsobject<NSString> domain_; // Only set for type kCocoaCookieTreeNodeTypeDatabaseStorage and // kCocoaCookieDetailsTypePromptDatabase nodes. - scoped_nsobject<NSString> databaseDescription_; + base::scoped_nsobject<NSString> databaseDescription_; // Only set for type kCocoaCookieDetailsTypePromptLocalStorage. - scoped_nsobject<NSString> localStorageKey_; - scoped_nsobject<NSString> localStorageValue_; + base::scoped_nsobject<NSString> localStorageKey_; + base::scoped_nsobject<NSString> localStorageValue_; // Only set for type kCocoaCookieDetailsTypeTreeAppCache and // kCocoaCookieDetailsTypePromptAppCache. - scoped_nsobject<NSString> manifestURL_; + base::scoped_nsobject<NSString> manifestURL_; } @property(nonatomic, readonly) BOOL canEditExpiration; @@ -213,7 +213,7 @@ enum CocoaCookieDetailsType { // |CocoaCookieDetails| object for the cookie prompt. @interface CookiePromptContentDetailsAdapter : NSObject { @private - scoped_nsobject<CocoaCookieDetails> details_; + base::scoped_nsobject<CocoaCookieDetails> details_; } - (CocoaCookieDetails*)details; diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm b/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm index 37cda45..fed777c 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm +++ b/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm @@ -16,14 +16,14 @@ class CookiesDetailsTest : public CocoaTest { }; TEST_F(CookiesDetailsTest, CreateForFolder) { - scoped_nsobject<CocoaCookieDetails> details; + base::scoped_nsobject<CocoaCookieDetails> details; details.reset([[CocoaCookieDetails alloc] initAsFolder]); EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeFolder); } TEST_F(CookiesDetailsTest, CreateForCookie) { - scoped_nsobject<CocoaCookieDetails> details; + base::scoped_nsobject<CocoaCookieDetails> details; GURL url("http://chromium.org"); std::string cookieLine( "PHPSESSID=0123456789abcdef0123456789abcdef; path=/"); @@ -53,7 +53,7 @@ TEST_F(CookiesDetailsTest, CreateForCookie) { } TEST_F(CookiesDetailsTest, CreateForTreeDatabase) { - scoped_nsobject<CocoaCookieDetails> details; + base::scoped_nsobject<CocoaCookieDetails> details; GURL origin("http://chromium.org"); std::string database_name("sassolungo"); std::string description("a great place to climb"); @@ -80,7 +80,7 @@ TEST_F(CookiesDetailsTest, CreateForTreeDatabase) { } TEST_F(CookiesDetailsTest, CreateForTreeLocalStorage) { - scoped_nsobject<CocoaCookieDetails> details; + base::scoped_nsobject<CocoaCookieDetails> details; const GURL kOrigin("http://chromium.org/"); int64 size = 1234; base::Time last_modified = base::Time::Now(); @@ -104,7 +104,7 @@ TEST_F(CookiesDetailsTest, CreateForTreeLocalStorage) { } TEST_F(CookiesDetailsTest, CreateForTreeAppCache) { - scoped_nsobject<CocoaCookieDetails> details; + base::scoped_nsobject<CocoaCookieDetails> details; GURL url("http://chromium.org/stuff.manifest"); appcache::AppCacheInfo info; @@ -133,7 +133,7 @@ TEST_F(CookiesDetailsTest, CreateForTreeAppCache) { } TEST_F(CookiesDetailsTest, CreateForTreeIndexedDB) { - scoped_nsobject<CocoaCookieDetails> details; + base::scoped_nsobject<CocoaCookieDetails> details; GURL origin("http://moose.org/"); int64 size = 1234; @@ -162,7 +162,7 @@ TEST_F(CookiesDetailsTest, CreateForTreeIndexedDB) { } TEST_F(CookiesDetailsTest, CreateForPromptDatabase) { - scoped_nsobject<CocoaCookieDetails> details; + base::scoped_nsobject<CocoaCookieDetails> details; std::string domain("chromium.org"); string16 name(base::SysNSStringToUTF16(@"wicked_name")); string16 desc(base::SysNSStringToUTF16(@"desc")); @@ -188,7 +188,7 @@ TEST_F(CookiesDetailsTest, CreateForPromptDatabase) { } TEST_F(CookiesDetailsTest, CreateForPromptLocalStorage) { - scoped_nsobject<CocoaCookieDetails> details; + base::scoped_nsobject<CocoaCookieDetails> details; std::string domain("chromium.org"); string16 key(base::SysNSStringToUTF16(@"testKey")); string16 value(base::SysNSStringToUTF16(@"testValue")); @@ -212,7 +212,7 @@ TEST_F(CookiesDetailsTest, CreateForPromptLocalStorage) { } TEST_F(CookiesDetailsTest, CreateForPromptAppCache) { - scoped_nsobject<CocoaCookieDetails> details; + base::scoped_nsobject<CocoaCookieDetails> details; std::string manifestURL("http://html5demos.com/html5demo.manifest"); details.reset([[CocoaCookieDetails alloc] initWithAppCacheManifestURL:manifestURL.c_str()]); diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller_unittest.mm b/chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller_unittest.mm index 29a0806..c901c71 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller_unittest.mm @@ -52,14 +52,14 @@ static CookiePromptContentDetailsAdapter* CreateDatabaseTestContent() { } TEST_F(CookieDetailsViewControllerTest, Create) { - scoped_nsobject<CookieDetailsViewController> detailsViewController( + base::scoped_nsobject<CookieDetailsViewController> detailsViewController( [[CookieDetailsViewController alloc] init]); } TEST_F(CookieDetailsViewControllerTest, ShrinkToFit) { - scoped_nsobject<CookieDetailsViewController> detailsViewController( + base::scoped_nsobject<CookieDetailsViewController> detailsViewController( [[CookieDetailsViewController alloc] init]); - scoped_nsobject<CookiePromptContentDetailsAdapter> adapter( + base::scoped_nsobject<CookiePromptContentDetailsAdapter> adapter( [CreateDatabaseTestContent() retain]); [detailsViewController.get() setContentObject:adapter.get()]; NSRect beforeFrame = [[detailsViewController.get() view] frame]; @@ -70,10 +70,10 @@ TEST_F(CookieDetailsViewControllerTest, ShrinkToFit) { } TEST_F(CookieDetailsViewControllerTest, ExpirationEditability) { - scoped_nsobject<CookieDetailsViewController> detailsViewController( + base::scoped_nsobject<CookieDetailsViewController> detailsViewController( [[CookieDetailsViewController alloc] init]); [detailsViewController view]; - scoped_nsobject<CookiePromptContentDetailsAdapter> adapter( + base::scoped_nsobject<CookiePromptContentDetailsAdapter> adapter( [CreateCookieTestContent(YES) retain]); [detailsViewController.get() setContentObject:adapter.get()]; diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_tree_node.h b/chrome/browser/ui/cocoa/content_settings/cookie_tree_node.h index 2b95914..1af0a75 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_tree_node.h +++ b/chrome/browser/ui/cocoa/content_settings/cookie_tree_node.h @@ -4,14 +4,14 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/browsing_data/cookies_tree_model.h" #include "chrome/browser/ui/cocoa/content_settings/cookie_details.h" @interface CocoaCookieTreeNode : NSObject { - scoped_nsobject<NSString> title_; - scoped_nsobject<NSMutableArray> children_; - scoped_nsobject<CocoaCookieDetails> details_; + base::scoped_nsobject<NSString> title_; + base::scoped_nsobject<NSMutableArray> children_; + base::scoped_nsobject<CocoaCookieDetails> details_; CookieTreeNode* treeNode_; // weak } diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_tree_node.mm b/chrome/browser/ui/cocoa/content_settings/cookie_tree_node.mm index a459194..44b97d0 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_tree_node.mm +++ b/chrome/browser/ui/cocoa/content_settings/cookie_tree_node.mm @@ -43,7 +43,7 @@ children_.reset([[NSMutableArray alloc] initWithCapacity:childCount]); for (int i = 0; i < childCount; ++i) { CookieTreeNode* child = treeNode_->GetChild(i); - scoped_nsobject<CocoaCookieTreeNode> childNode( + base::scoped_nsobject<CocoaCookieTreeNode> childNode( [[CocoaCookieTreeNode alloc] initWithNode:child]); [children_ addObject:childNode.get()]; } diff --git a/chrome/browser/ui/cocoa/custom_frame_view_unittest.mm b/chrome/browser/ui/cocoa/custom_frame_view_unittest.mm index ee4a5f8..4f061cd 100644 --- a/chrome/browser/ui/cocoa/custom_frame_view_unittest.mm +++ b/chrome/browser/ui/cocoa/custom_frame_view_unittest.mm @@ -6,7 +6,7 @@ #include <objc/runtime.h> #include "base/mac/mac_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/custom_frame_view.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -24,7 +24,7 @@ class CustomFrameViewTest : public PlatformTest { view_.reset([[customFrameClass alloc] initWithFrame:frame]); } - scoped_nsobject<NSView> view_; + base::scoped_nsobject<NSView> view_; }; // Test to make sure our class modifications were successful. diff --git a/chrome/browser/ui/cocoa/dev_tools_controller.h b/chrome/browser/ui/cocoa/dev_tools_controller.h index 554b8ab..99416e6 100644 --- a/chrome/browser/ui/cocoa/dev_tools_controller.h +++ b/chrome/browser/ui/cocoa/dev_tools_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/devtools/devtools_window.h" @class GraySplitView; @@ -23,7 +23,7 @@ class WebContents; @interface DevToolsController : NSObject<NSSplitViewDelegate> { @private // A view hosting docked devTools contents. - scoped_nsobject<GraySplitView> splitView_; + base::scoped_nsobject<GraySplitView> splitView_; DevToolsDockSide dockSide_; diff --git a/chrome/browser/ui/cocoa/dev_tools_controller.mm b/chrome/browser/ui/cocoa/dev_tools_controller.mm index c495d1f..7c97686 100644 --- a/chrome/browser/ui/cocoa/dev_tools_controller.mm +++ b/chrome/browser/ui/cocoa/dev_tools_controller.mm @@ -159,7 +159,7 @@ using content::WebContents; [devToolsView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; NSRect containerRect = NSMakeRect(0, 0, 100, 100); - scoped_nsobject<NSView> devToolsContainerView( + base::scoped_nsobject<NSView> devToolsContainerView( [[NSView alloc] initWithFrame:containerRect]); [devToolsContainerView addSubview:devToolsView]; [splitView_ addSubview:devToolsContainerView]; diff --git a/chrome/browser/ui/cocoa/dock_icon.mm b/chrome/browser/ui/cocoa/dock_icon.mm index d70618d..f6bf5ae 100644 --- a/chrome/browser/ui/cocoa/dock_icon.mm +++ b/chrome/browser/ui/cocoa/dock_icon.mm @@ -6,7 +6,7 @@ #include "base/logging.h" #include "base/mac/bundle_locations.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "content/public/browser/browser_thread.h" #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" @@ -85,7 +85,7 @@ const int64 kUpdateFrequencyMs = 200; NSColor* backgroundHighlight = [backgroundColor blendedColorWithFraction:0.85 ofColor:[NSColor whiteColor]]; - scoped_nsobject<NSGradient> backgroundGradient( + base::scoped_nsobject<NSGradient> backgroundGradient( [[NSGradient alloc] initWithStartingColor:backgroundHighlight endingColor:backgroundColor]); NSBezierPath* badgeEdge = [NSBezierPath bezierPathWithOvalInRect:badgeRect]; @@ -108,7 +108,7 @@ const int64 kUpdateFrequencyMs = 200; NSColor* sliceHighlight = [sliceColor blendedColorWithFraction:0.4 ofColor:[NSColor whiteColor]]; - scoped_nsobject<NSGradient> sliceGradient( + base::scoped_nsobject<NSGradient> sliceGradient( [[NSGradient alloc] initWithStartingColor:sliceHighlight endingColor:sliceColor]); NSBezierPath* progressSlice; @@ -140,7 +140,7 @@ const int64 kUpdateFrequencyMs = 200; { gfx::ScopedNSGraphicsContextSaveGState scopedGState; [[NSColor whiteColor] set]; - scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); + base::scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); [shadow.get() setShadowOffset:NSMakeSize(0, -2)]; [shadow setShadowBlurRadius:2]; [shadow set]; @@ -149,12 +149,12 @@ const int64 kUpdateFrequencyMs = 200; } // Download count - scoped_nsobject<NSNumberFormatter> formatter( + base::scoped_nsobject<NSNumberFormatter> formatter( [[NSNumberFormatter alloc] init]); NSString* countString = [formatter stringFromNumber:[NSNumber numberWithInt:downloads_]]; - scoped_nsobject<NSShadow> countShadow([[NSShadow alloc] init]); + base::scoped_nsobject<NSShadow> countShadow([[NSShadow alloc] init]); [countShadow setShadowBlurRadius:3.0]; [countShadow.get() setShadowColor:[NSColor whiteColor]]; [countShadow.get() setShadowOffset:NSMakeSize(0.0, 0.0)]; @@ -165,7 +165,7 @@ const int64 kUpdateFrequencyMs = 200; nil]; CGFloat countFontSize = badgeRadius; NSSize countSize = NSZeroSize; - scoped_nsobject<NSAttributedString> countAttrString; + base::scoped_nsobject<NSAttributedString> countAttrString; while (1) { NSFont* countFont = [NSFont fontWithName:@"Helvetica-Bold" size:countFontSize]; @@ -207,7 +207,8 @@ const int64 kUpdateFrequencyMs = 200; if (!icon) { NSDockTile* dockTile = [[NSApplication sharedApplication] dockTile]; - scoped_nsobject<DockTileView> dockTileView([[DockTileView alloc] init]); + base::scoped_nsobject<DockTileView> dockTileView( + [[DockTileView alloc] init]); [dockTile setContentView:dockTileView]; icon = [[DockIcon alloc] init]; diff --git a/chrome/browser/ui/cocoa/download/background_theme.h b/chrome/browser/ui/cocoa/download/background_theme.h index 7751965..d044fe1 100644 --- a/chrome/browser/ui/cocoa/download/background_theme.h +++ b/chrome/browser/ui/cocoa/download/background_theme.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "ui/base/theme_provider.h" class BackgroundTheme : public ui::ThemeProvider { @@ -33,9 +33,9 @@ class BackgroundTheme : public ui::ThemeProvider { private: ui::ThemeProvider* provider_; - scoped_nsobject<NSGradient> buttonGradient_; - scoped_nsobject<NSGradient> buttonPressedGradient_; - scoped_nsobject<NSColor> borderColor_; + base::scoped_nsobject<NSGradient> buttonGradient_; + base::scoped_nsobject<NSGradient> buttonPressedGradient_; + base::scoped_nsobject<NSColor> borderColor_; }; #endif // CHROME_BROWSER_UI_COCOA_DOWNLOAD_BACKGROUND_THEME_H_ diff --git a/chrome/browser/ui/cocoa/download/download_item_button.mm b/chrome/browser/ui/cocoa/download/download_item_button.mm index 67920fe..4bfd70f 100644 --- a/chrome/browser/ui/cocoa/download/download_item_button.mm +++ b/chrome/browser/ui/cocoa/download/download_item_button.mm @@ -34,7 +34,7 @@ } else { // Hold a reference to our controller in case the download completes and we // represent a file that's auto-removed (e.g. a theme). - scoped_nsobject<DownloadItemController> ref([controller_ retain]); + base::scoped_nsobject<DownloadItemController> ref([controller_ retain]); [cell setHighlighted:YES]; [[self menu] setDelegate:self]; [NSMenu popUpContextMenu:[self menu] @@ -46,7 +46,7 @@ // Override to retain the controller, in case a closure is pumped that deletes // the DownloadItemController while the menu is open <http://crbug.com/129826>. - (void)rightMouseDown:(NSEvent*)event { - scoped_nsobject<DownloadItemController> ref([controller_ retain]); + base::scoped_nsobject<DownloadItemController> ref([controller_ retain]); [super rightMouseDown:event]; } diff --git a/chrome/browser/ui/cocoa/download/download_item_button_unittest.mm b/chrome/browser/ui/cocoa/download/download_item_button_unittest.mm index 6fc6b43..e6f07e9 100644 --- a/chrome/browser/ui/cocoa/download/download_item_button_unittest.mm +++ b/chrome/browser/ui/cocoa/download/download_item_button_unittest.mm @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/memory/scoped_nsobject.h" -#import "chrome/browser/ui/cocoa/download/download_item_button.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" +#import "chrome/browser/ui/cocoa/download/download_item_button.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" // Make sure nothing leaks. TEST(DownloadItemButtonTest, Create) { - scoped_nsobject<DownloadItemButton> button; + base::scoped_nsobject<DownloadItemButton> button; button.reset([[DownloadItemButton alloc] initWithFrame:NSMakeRect(0,0,500,500)]); diff --git a/chrome/browser/ui/cocoa/download/download_item_cell.h b/chrome/browser/ui/cocoa/download/download_item_cell.h index c73f9c8..9e01975 100644 --- a/chrome/browser/ui/cocoa/download/download_item_cell.h +++ b/chrome/browser/ui/cocoa/download/download_item_cell.h @@ -30,23 +30,23 @@ enum DownloadItemMousePosition { // Track which part of the button the mouse is over DownloadItemMousePosition mousePosition_; int mouseInsideCount_; - scoped_nsobject<NSTrackingArea> trackingAreaButton_; - scoped_nsobject<NSTrackingArea> trackingAreaDropdown_; + base::scoped_nsobject<NSTrackingArea> trackingAreaButton_; + base::scoped_nsobject<NSTrackingArea> trackingAreaDropdown_; base::FilePath downloadPath_; // stored unelided NSString* secondaryTitle_; NSFont* secondaryFont_; int percentDone_; - scoped_nsobject<NSAnimation> completionAnimation_; + base::scoped_nsobject<NSAnimation> completionAnimation_; // In degrees, for downloads with no known total size. int indeterminateProgressAngle_; - scoped_nsobject<IndeterminateProgressTimer> indeterminateProgressTimer_; + base::scoped_nsobject<IndeterminateProgressTimer> indeterminateProgressTimer_; BOOL isStatusTextVisible_; CGFloat titleY_; CGFloat statusAlpha_; - scoped_nsobject<NSAnimation> toggleStatusVisibilityAnimation_; + base::scoped_nsobject<NSAnimation> toggleStatusVisibilityAnimation_; scoped_ptr<ui::ThemeProvider> themeProvider_; } diff --git a/chrome/browser/ui/cocoa/download/download_item_cell.mm b/chrome/browser/ui/cocoa/download/download_item_cell.mm index 2a47782..f6af374 100644 --- a/chrome/browser/ui/cocoa/download/download_item_cell.mm +++ b/chrome/browser/ui/cocoa/download/download_item_cell.mm @@ -96,7 +96,7 @@ using content::DownloadItem; @interface IndeterminateProgressTimer : NSObject { @private DownloadItemCell* cell_; - scoped_nsobject<NSTimer> timer_; + base::scoped_nsobject<NSTimer> timer_; } - (id)initWithDownloadItemCell:(DownloadItemCell*)cell; @@ -621,7 +621,7 @@ using content::DownloadItem; gfx::ScopedNSGraphicsContextSaveGState scopedGState; - scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); + base::scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); [shadow.get() setShadowColor:[NSColor whiteColor]]; [shadow.get() setShadowOffset:NSMakeSize(0, -1)]; [shadow setShadowBlurRadius:0.0]; diff --git a/chrome/browser/ui/cocoa/download/download_item_cell_unittest.mm b/chrome/browser/ui/cocoa/download/download_item_cell_unittest.mm index b68f36f..ef4aa54 100644 --- a/chrome/browser/ui/cocoa/download/download_item_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/download/download_item_cell_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/download/download_item_model.h" -#import "chrome/browser/ui/cocoa/download/download_item_cell.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" +#import "chrome/browser/ui/cocoa/download/download_item_cell.h" #include "content/public/test/mock_download_item.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -32,8 +32,8 @@ class DownloadItemCellTest : public CocoaTest { } protected: - scoped_nsobject<DownloadItemCell> cell_; - scoped_nsobject<NSButton> button_; + base::scoped_nsobject<DownloadItemCell> cell_; + base::scoped_nsobject<NSButton> button_; private: DISALLOW_COPY_AND_ASSIGN(DownloadItemCellTest); diff --git a/chrome/browser/ui/cocoa/download/download_item_mac.h b/chrome/browser/ui/cocoa/download/download_item_mac.h index 363dd33..2bbd754 100644 --- a/chrome/browser/ui/cocoa/download/download_item_mac.h +++ b/chrome/browser/ui/cocoa/download/download_item_mac.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/download/download_item_model.h" #include "chrome/browser/icon_manager.h" diff --git a/chrome/browser/ui/cocoa/download/download_shelf_controller.h b/chrome/browser/ui/cocoa/download/download_shelf_controller.h index a71cf8e..c264571 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_controller.h +++ b/chrome/browser/ui/cocoa/download/download_shelf_controller.h @@ -4,10 +4,10 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" -#include "ui/base/cocoa/tracking_area.h" #import "chrome/browser/ui/cocoa/view_resizer.h" +#include "ui/base/cocoa/tracking_area.h" @class AnimatableView; class Browser; @@ -71,7 +71,7 @@ class PageNavigator; ui::ScopedCrTrackingArea trackingArea_; // The download items we have added to our shelf. - scoped_nsobject<NSMutableArray> downloadItemControllers_; + base::scoped_nsobject<NSMutableArray> downloadItemControllers_; // The container that contains (and clamps) all the download items. IBOutlet NSView* itemContainerView_; diff --git a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm index e0b8eae..be8355b 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm +++ b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm @@ -300,7 +300,7 @@ const NSSize kHoverCloseButtonDefaultSize = { 18, 18 }; - (void)addDownloadItem:(DownloadItem*)downloadItem { DCHECK([NSThread isMainThread]); - scoped_nsobject<DownloadItemController> controller( + base::scoped_nsobject<DownloadItemController> controller( [[DownloadItemController alloc] initWithDownload:downloadItem shelf:self navigator:navigator_]); diff --git a/chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm b/chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm index ed952c34..8ce96cad 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/download/download_shelf.h" #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" @@ -110,8 +110,8 @@ class DownloadShelfControllerTest : public CocoaProfileTest { protected: id CreateItemController(); - scoped_nsobject<CountingDownloadShelfController> shelf_; - scoped_nsobject<ViewResizerPong> resize_delegate_; + base::scoped_nsobject<CountingDownloadShelfController> shelf_; + base::scoped_nsobject<ViewResizerPong> resize_delegate_; }; id DownloadShelfControllerTest::CreateItemController() { @@ -122,12 +122,12 @@ id DownloadShelfControllerTest::CreateItemController() { ON_CALL(*download.get(), GetState()) .WillByDefault(Return(content::DownloadItem::IN_PROGRESS)); - scoped_nsobject<WrappedMockDownloadItem> wrappedMockDownload( + base::scoped_nsobject<WrappedMockDownloadItem> wrappedMockDownload( [[WrappedMockDownloadItem alloc] initWithMockDownload:download.Pass()]); id item_controller = [OCMockObject mockForClass:[DownloadItemController class]]; - scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:NSZeroRect]); [[[item_controller stub] andCall:@selector(download) onObject:wrappedMockDownload.get()] download]; [[item_controller stub] updateVisibility:[OCMArg any]]; @@ -144,7 +144,7 @@ TEST_VIEW(DownloadShelfControllerTest, [shelf_ view]); // Removing the last download from the shelf should cause it to close // immediately. TEST_F(DownloadShelfControllerTest, AddAndRemoveDownload) { - scoped_nsobject<DownloadItemController> item(CreateItemController()); + base::scoped_nsobject<DownloadItemController> item(CreateItemController()); [shelf_ showDownloadShelf:YES isUserAction:NO]; EXPECT_TRUE([shelf_ isVisible]); @@ -160,8 +160,8 @@ TEST_F(DownloadShelfControllerTest, AddAndRemoveDownload) { // Test that the shelf doesn't close automatically after a removal if there are // active download items still on the shelf. TEST_F(DownloadShelfControllerTest, AddAndRemoveWithActiveItem) { - scoped_nsobject<DownloadItemController> item1(CreateItemController()); - scoped_nsobject<DownloadItemController> item2(CreateItemController()); + base::scoped_nsobject<DownloadItemController> item1(CreateItemController()); + base::scoped_nsobject<DownloadItemController> item2(CreateItemController()); [shelf_ showDownloadShelf:YES isUserAction:NO]; EXPECT_TRUE([shelf_ isVisible]); @@ -177,7 +177,7 @@ TEST_F(DownloadShelfControllerTest, AddAndRemoveWithActiveItem) { // DownloadShelf::Unhide() should cause the shelf to be displayed if there are // active downloads on it. TEST_F(DownloadShelfControllerTest, HideAndUnhide) { - scoped_nsobject<DownloadItemController> item(CreateItemController()); + base::scoped_nsobject<DownloadItemController> item(CreateItemController()); [shelf_ showDownloadShelf:YES isUserAction:NO]; EXPECT_TRUE([shelf_ isVisible]); @@ -193,7 +193,7 @@ TEST_F(DownloadShelfControllerTest, HideAndUnhide) { // DownloadShelf::Unhide() shouldn't cause the shelf to be displayed if all // active downloads are removed from the shelf while the shelf was hidden. TEST_F(DownloadShelfControllerTest, HideAutocloseUnhide) { - scoped_nsobject<DownloadItemController> item(CreateItemController()); + base::scoped_nsobject<DownloadItemController> item(CreateItemController()); [shelf_ showDownloadShelf:YES isUserAction:NO]; EXPECT_TRUE([shelf_ isVisible]); @@ -209,7 +209,7 @@ TEST_F(DownloadShelfControllerTest, HideAutocloseUnhide) { // Test of autoclosing behavior after opening a download item. The mouse is on // the download shelf at the time the autoclose is scheduled. TEST_F(DownloadShelfControllerTest, AutoCloseAfterOpenWithMouseInShelf) { - scoped_nsobject<DownloadItemController> item(CreateItemController()); + base::scoped_nsobject<DownloadItemController> item(CreateItemController()); [shelf_ showDownloadShelf:YES isUserAction:NO]; EXPECT_TRUE([shelf_ isVisible]); @@ -246,7 +246,7 @@ TEST_F(DownloadShelfControllerTest, AutoCloseAfterOpenWithMouseInShelf) { // Test of autoclosing behavior after opening a download item. TEST_F(DownloadShelfControllerTest, AutoCloseAfterOpenWithMouseOffShelf) { - scoped_nsobject<DownloadItemController> item(CreateItemController()); + base::scoped_nsobject<DownloadItemController> item(CreateItemController()); [shelf_ showDownloadShelf:YES isUserAction:NO]; EXPECT_TRUE([shelf_ isVisible]); @@ -265,7 +265,7 @@ TEST_F(DownloadShelfControllerTest, AutoCloseAfterOpenWithMouseOffShelf) { // Test that if the shelf is closed while an autoClose is pending, the pending // autoClose is cancelled. TEST_F(DownloadShelfControllerTest, CloseWithPendingAutoClose) { - scoped_nsobject<DownloadItemController> item(CreateItemController()); + base::scoped_nsobject<DownloadItemController> item(CreateItemController()); [shelf_ showDownloadShelf:YES isUserAction:NO]; EXPECT_TRUE([shelf_ isVisible]); @@ -306,7 +306,7 @@ TEST_F(DownloadShelfControllerTest, CloseWithPendingAutoClose) { // That that the shelf cancels a pending autoClose if a new download item is // added to it. TEST_F(DownloadShelfControllerTest, AddItemWithPendingAutoClose) { - scoped_nsobject<DownloadItemController> item(CreateItemController()); + base::scoped_nsobject<DownloadItemController> item(CreateItemController()); [shelf_ showDownloadShelf:YES isUserAction:NO]; EXPECT_TRUE([shelf_ isVisible]); @@ -337,7 +337,7 @@ TEST_F(DownloadShelfControllerTest, AddItemWithPendingAutoClose) { EXPECT_EQ(0, shelf_.get()->cancelAutoCloseCount_); // Add a new download item. The pending autoClose should be cancelled. - scoped_nsobject<DownloadItemController> item2(CreateItemController()); + base::scoped_nsobject<DownloadItemController> item2(CreateItemController()); [shelf_ add:item.get()]; EXPECT_EQ(1, shelf_.get()->scheduleAutoCloseCount_); EXPECT_EQ(1, shelf_.get()->cancelAutoCloseCount_); @@ -346,7 +346,7 @@ TEST_F(DownloadShelfControllerTest, AddItemWithPendingAutoClose) { // Test that pending autoClose calls are cancelled when exiting. TEST_F(DownloadShelfControllerTest, CancelAutoCloseOnExit) { - scoped_nsobject<DownloadItemController> item(CreateItemController()); + base::scoped_nsobject<DownloadItemController> item(CreateItemController()); [shelf_ showDownloadShelf:YES isUserAction:NO]; EXPECT_TRUE([shelf_ isVisible]); diff --git a/chrome/browser/ui/cocoa/download/download_shelf_mac_unittest.mm b/chrome/browser/ui/cocoa/download/download_shelf_mac_unittest.mm index 32354e2..c38dedf 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_mac_unittest.mm +++ b/chrome/browser/ui/cocoa/download/download_shelf_mac_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. -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" #include "chrome/browser/ui/cocoa/download/download_shelf_mac.h" #include "testing/gtest/include/gtest/gtest.h" @@ -56,7 +56,7 @@ class DownloadShelfMacTest : public CocoaProfileTest { } protected: - scoped_nsobject<FakeDownloadShelfController> shelf_controller_; + base::scoped_nsobject<FakeDownloadShelfController> shelf_controller_; }; TEST_F(DownloadShelfMacTest, CreationDoesNotCallShow) { diff --git a/chrome/browser/ui/cocoa/download/download_shelf_view.mm b/chrome/browser/ui/cocoa/download/download_shelf_view.mm index d5a6743..203b66c 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_view.mm +++ b/chrome/browser/ui/cocoa/download/download_shelf_view.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/download/download_shelf_view.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/themes/theme_service.h" #import "chrome/browser/ui/cocoa/nsview_additions.h" diff --git a/chrome/browser/ui/cocoa/download/download_shelf_view_unittest.mm b/chrome/browser/ui/cocoa/download/download_shelf_view_unittest.mm index b7263fc..cf22c69 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_view_unittest.mm +++ b/chrome/browser/ui/cocoa/download/download_shelf_view_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/download/download_shelf_view.h" #include "testing/gtest/include/gtest/gtest.h" @@ -16,7 +16,8 @@ class DownloadShelfViewTest : public CocoaTest { // This class only needs to do one thing: prevent mouse down events from moving // the parent window around. TEST_F(DownloadShelfViewTest, CanDragWindow) { - scoped_nsobject<DownloadShelfView> view([[DownloadShelfView alloc] init]); + base::scoped_nsobject<DownloadShelfView> view( + [[DownloadShelfView alloc] init]); EXPECT_FALSE([view mouseDownCanMoveWindow]); } diff --git a/chrome/browser/ui/cocoa/draggable_button.h b/chrome/browser/ui/cocoa/draggable_button.h index 5e126b2..0cd0d9b 100644 --- a/chrome/browser/ui/cocoa/draggable_button.h +++ b/chrome/browser/ui/cocoa/draggable_button.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/draggable_button_mixin.h" // Class for buttons that can be drag sources. If the mouse is clicked and moved @@ -15,7 +15,7 @@ // |-performClick:|. Subclasses should override these two methods. @interface DraggableButton : NSButton<DraggableButtonMixin> { @private - scoped_nsobject<DraggableButtonImpl> draggableButtonImpl_; + base::scoped_nsobject<DraggableButtonImpl> draggableButtonImpl_; } @property(readonly, nonatomic) DraggableButtonImpl* draggableButton; diff --git a/chrome/browser/ui/cocoa/draggable_button.mm b/chrome/browser/ui/cocoa/draggable_button.mm index 1eb7d7d..0b3bcd8 100644 --- a/chrome/browser/ui/cocoa/draggable_button.mm +++ b/chrome/browser/ui/cocoa/draggable_button.mm @@ -39,7 +39,7 @@ // The impl spins an event loop to distinguish clicks from drags, // which could result in our destruction. Wire ourselves down for // the duration. - scoped_nsobject<DraggableButton> keepAlive([self retain]); + base::scoped_nsobject<DraggableButton> keepAlive([self retain]); if ([draggableButtonImpl_ mouseDownImpl:theEvent] == kDraggableButtonMixinCallSuper) { diff --git a/chrome/browser/ui/cocoa/draggable_button_mixin.mm b/chrome/browser/ui/cocoa/draggable_button_mixin.mm index e28f674..934e429 100644 --- a/chrome/browser/ui/cocoa/draggable_button_mixin.mm +++ b/chrome/browser/ui/cocoa/draggable_button_mixin.mm @@ -7,7 +7,7 @@ #include <cmath> #include "base/logging.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" namespace { diff --git a/chrome/browser/ui/cocoa/draggable_button_unittest.mm b/chrome/browser/ui/cocoa/draggable_button_unittest.mm index 6ee44a4..3cada7e 100644 --- a/chrome/browser/ui/cocoa/draggable_button_unittest.mm +++ b/chrome/browser/ui/cocoa/draggable_button_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/draggable_button.h" #include "testing/gtest/include/gtest/gtest.h" @@ -47,8 +47,9 @@ class DraggableButtonTest : public CocoaTest {}; // Make sure the basic case of "click" still works. TEST_F(DraggableButtonTest, DownUp) { - scoped_nsobject<TestableDraggableButton> button( - [[TestableDraggableButton alloc] initWithFrame:NSMakeRect(0,0,500,500)]); + base::scoped_nsobject<TestableDraggableButton> button( + [[TestableDraggableButton alloc] + initWithFrame:NSMakeRect(0, 0, 500, 500)]); [[test_window() contentView] addSubview:button.get()]; [button setTarget:button]; [button setAction:@selector(trigger:)]; @@ -67,8 +68,9 @@ TEST_F(DraggableButtonTest, DownUp) { } TEST_F(DraggableButtonTest, DraggableHysteresis) { - scoped_nsobject<TestableDraggableButton> button( - [[TestableDraggableButton alloc] initWithFrame:NSMakeRect(0,0,500,500)]); + base::scoped_nsobject<TestableDraggableButton> button( + [[TestableDraggableButton alloc] + initWithFrame:NSMakeRect(0, 0, 500, 500)]); [[test_window() contentView] addSubview:button.get()]; NSEvent* downEvent = cocoa_test_event_utils::MouseEventAtPoint(NSMakePoint(10,10), @@ -106,8 +108,9 @@ TEST_F(DraggableButtonTest, DraggableHysteresis) { } TEST_F(DraggableButtonTest, ResetState) { - scoped_nsobject<TestableDraggableButton> button( - [[TestableDraggableButton alloc] initWithFrame:NSMakeRect(0,0,500,500)]); + base::scoped_nsobject<TestableDraggableButton> button( + [[TestableDraggableButton alloc] + initWithFrame:NSMakeRect(0, 0, 500, 500)]); [[test_window() contentView] addSubview:button.get()]; NSEvent* downEvent = cocoa_test_event_utils::MouseEventAtPoint(NSMakePoint(10,10), diff --git a/chrome/browser/ui/cocoa/extensions/browser_action_button.h b/chrome/browser/ui/cocoa/extensions/browser_action_button.h index 7a083d3..fa5a46b 100644 --- a/chrome/browser/ui/cocoa/extensions/browser_action_button.h +++ b/chrome/browser/ui/cocoa/extensions/browser_action_button.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/image_button_cell.h" @@ -31,7 +31,7 @@ extern NSString* const kBrowserActionButtonDragEndNotification; scoped_ptr<ExtensionActionIconFactoryBridge> iconFactoryBridge_; // Used to move the button and query whether a button is currently animating. - scoped_nsobject<NSViewAnimation> moveAnimation_; + base::scoped_nsobject<NSViewAnimation> moveAnimation_; // The extension for this button. Weak. const extensions::Extension* extension_; diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm index c6b1fa6..b528c70 100644 --- a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm +++ b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm @@ -7,7 +7,7 @@ #include <algorithm> #include "base/basictypes.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/view_id_util.h" NSString* const kBrowserActionGrippyDragStartedNotification = diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view_unittest.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view_unittest.mm index 14b5c1b..8e8d077 100644 --- a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view_unittest.mm +++ b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h" #include "testing/gtest/include/gtest/gtest.h" @@ -21,7 +21,7 @@ class BrowserActionsContainerViewTest : public CocoaTest { initWithFrame:NSMakeRect(0, 0, 0, kContainerHeight)]); } - scoped_nsobject<BrowserActionsContainerView> view_; + base::scoped_nsobject<BrowserActionsContainerView> view_; }; TEST_F(BrowserActionsContainerViewTest, BasicTests) { diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.h b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.h index f24a8d1..37cd3f0 100644 --- a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.h +++ b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" class Browser; @@ -52,19 +52,19 @@ extern NSString* const kBrowserActionVisibilityChangedNotification; // A dictionary of Extension ID -> BrowserActionButton pairs representing the // buttons present in the container view. The ID is a string unique to each // extension. - scoped_nsobject<NSMutableDictionary> buttons_; + base::scoped_nsobject<NSMutableDictionary> buttons_; // Array of hidden buttons in the correct order in which the user specified. - scoped_nsobject<NSMutableArray> hiddenButtons_; + base::scoped_nsobject<NSMutableArray> hiddenButtons_; // The currently running chevron animation (fade in/out). - scoped_nsobject<NSViewAnimation> chevronAnimation_; + base::scoped_nsobject<NSViewAnimation> chevronAnimation_; // The chevron button used when Browser Actions are hidden. - scoped_nsobject<MenuButton> chevronMenuButton_; + base::scoped_nsobject<MenuButton> chevronMenuButton_; // The Browser Actions overflow menu. - scoped_nsobject<NSMenu> overflowMenu_; + base::scoped_nsobject<NSMenu> overflowMenu_; } @property(readonly, nonatomic) BrowserActionsContainerView* containerView; diff --git a/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h b/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h index b6b50f8..6c08460 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h +++ b/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" class AsyncUninstaller; diff --git a/chrome/browser/ui/cocoa/extensions/extension_action_context_menu_browsertest.mm b/chrome/browser/ui/cocoa/extensions/extension_action_context_menu_browsertest.mm index a92c9cc..7aee38c 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_action_context_menu_browsertest.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_action_context_menu_browsertest.mm @@ -64,7 +64,7 @@ public: IN_PROC_BROWSER_TEST_F(ExtensionActionContextMenuTest, BasicTest) { SetupPageAction(); - scoped_nsobject<ExtensionActionContextMenu> menu; + base::scoped_nsobject<ExtensionActionContextMenu> menu; menu.reset([[ExtensionActionContextMenu alloc] initWithExtension:extension_ browser:browser() extensionAction:action_]); @@ -103,7 +103,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionActionContextMenuTest, BrowserAction) { new Browser(Browser::CreateParams(browser()->profile(), browser()->host_desktop_type()))); - scoped_nsobject<ExtensionActionContextMenu> menu; + base::scoped_nsobject<ExtensionActionContextMenu> menu; menu.reset([[ExtensionActionContextMenu alloc] initWithExtension:extension_ browser:empty_browser @@ -158,7 +158,7 @@ class DevToolsAttachedObserver { IN_PROC_BROWSER_TEST_F( ExtensionActionContextMenuTest, DISABLED_RunInspectPopup) { SetupPageAction(); - scoped_nsobject<ExtensionActionContextMenu> menu; + base::scoped_nsobject<ExtensionActionContextMenu> menu; menu.reset([[ExtensionActionContextMenu alloc] initWithExtension:extension_ browser:browser() extensionAction:action_]); diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h index c9ada3a..18478ab 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h +++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/extensions/extension_install_prompt.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" @@ -46,7 +46,7 @@ class ExtensionInstallDialogController : private: ExtensionInstallPrompt::Delegate* delegate_; - scoped_nsobject<ExtensionInstallViewController> view_controller_; + base::scoped_nsobject<ExtensionInstallViewController> view_controller_; scoped_ptr<ConstrainedWindowMac> constrained_window_; }; diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm index eb08510..066f3f4 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm @@ -42,13 +42,12 @@ ExtensionInstallDialogController::ExtensionInstallDialogController( delegate:this prompt:prompt]); - scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc] + base::scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc] initWithContentRect:[[view_controller_ view] bounds]]); [[window contentView] addSubview:[view_controller_ view]]; - scoped_nsobject<CustomConstrainedWindowSheet> sheet( - [[CustomConstrainedWindowSheet alloc] - initWithCustomWindow:window]); + base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( + [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window]); constrained_window_.reset(new ConstrainedWindowMac( this, show_params.parent_web_contents, sheet)); } diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller_browsertest.mm b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller_browsertest.mm index 402dcfb..9c46502 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller_browsertest.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller_browsertest.mm @@ -37,7 +37,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionInstallDialogControllerTest, BasicTest) { &delegate, prompt); - scoped_nsobject<NSWindow> window( + base::scoped_nsobject<NSWindow> window( [[[controller->view_controller() view] window] retain]); EXPECT_TRUE([window isVisible]); @@ -61,7 +61,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionInstallDialogControllerTest, Permissions) { &delegate, prompt); - scoped_nsobject<NSWindow> window( + base::scoped_nsobject<NSWindow> window( [[[controller->view_controller() view] window] retain]); EXPECT_TRUE([window isVisible]); diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h index ba3f192..3ba7292 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h +++ b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h @@ -9,7 +9,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "chrome/browser/extensions/extension_install_prompt.h" @@ -45,7 +45,7 @@ class PageNavigator; ExtensionInstallPrompt::Delegate* delegate_; // weak scoped_ptr<ExtensionInstallPrompt::Prompt> prompt_; - scoped_nsobject<NSArray> warnings_; + base::scoped_nsobject<NSArray> warnings_; BOOL isComputingRowHeight_; } diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm index 088f5ff..edd9c0d 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm @@ -314,7 +314,8 @@ void DrawBulletInFrame(NSRect frame) { NSImage* image = gfx::NSImageFromImageSkiaWithColorSpace( *skiaImage, base::mac::GetSystemColorSpace()); NSRect frame = NSMakeRect(0, 0, skiaImage->width(), skiaImage->height()); - scoped_nsobject<NSImageView> view([[NSImageView alloc] initWithFrame:frame]); + base::scoped_nsobject<NSImageView> view( + [[NSImageView alloc] initWithFrame:frame]); [view setImage:image]; // Add this star after all the other ones diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller_unittest.mm b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller_unittest.mm index ed72350..a899064 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #import "chrome/browser/extensions/extension_install_prompt.h" @@ -40,11 +40,10 @@ TEST_F(ExtensionInstallViewControllerTest, BasicsNormalCancel) { permissions.push_back(UTF8ToUTF16("warning 1")); prompt.SetPermissions(permissions); - scoped_nsobject<ExtensionInstallViewController> - controller([[ExtensionInstallViewController alloc] - initWithNavigator:browser() - delegate:&delegate - prompt:prompt]); + base::scoped_nsobject<ExtensionInstallViewController> controller( + [[ExtensionInstallViewController alloc] initWithNavigator:browser() + delegate:&delegate + prompt:prompt]); [controller view]; // Force nib load. @@ -93,11 +92,10 @@ TEST_F(ExtensionInstallViewControllerTest, BasicsNormalOK) { permissions.push_back(UTF8ToUTF16("warning 1")); prompt.SetPermissions(permissions); - scoped_nsobject<ExtensionInstallViewController> - controller([[ExtensionInstallViewController alloc] - initWithNavigator:browser() - delegate:&delegate - prompt:prompt]); + base::scoped_nsobject<ExtensionInstallViewController> controller( + [[ExtensionInstallViewController alloc] initWithNavigator:browser() + delegate:&delegate + prompt:prompt]); [controller view]; // Force nib load. [controller ok:nil]; @@ -123,19 +121,19 @@ TEST_F(ExtensionInstallViewControllerTest, MultipleWarnings) { permissions.push_back(UTF8ToUTF16("warning 2")); two_warnings_prompt.SetPermissions(permissions); - scoped_nsobject<ExtensionInstallViewController> - controller1([[ExtensionInstallViewController alloc] - initWithNavigator:browser() - delegate:&delegate1 - prompt:one_warning_prompt]); + base::scoped_nsobject<ExtensionInstallViewController> controller1( + [[ExtensionInstallViewController alloc] + initWithNavigator:browser() + delegate:&delegate1 + prompt:one_warning_prompt]); [controller1 view]; // Force nib load. - scoped_nsobject<ExtensionInstallViewController> - controller2([[ExtensionInstallViewController alloc] - initWithNavigator:browser() - delegate:&delegate2 - prompt:two_warnings_prompt]); + base::scoped_nsobject<ExtensionInstallViewController> controller2( + [[ExtensionInstallViewController alloc] + initWithNavigator:browser() + delegate:&delegate2 + prompt:two_warnings_prompt]); [controller2 view]; // Force nib load. @@ -158,11 +156,11 @@ TEST_F(ExtensionInstallViewControllerTest, BasicsSkinny) { ExtensionInstallPrompt::Prompt no_warnings_prompt = chrome::BuildExtensionInstallPrompt(extension_.get()); - scoped_nsobject<ExtensionInstallViewController> - controller([[ExtensionInstallViewController alloc] - initWithNavigator:browser() - delegate:&delegate - prompt:no_warnings_prompt]); + base::scoped_nsobject<ExtensionInstallViewController> controller( + [[ExtensionInstallViewController alloc] + initWithNavigator:browser() + delegate:&delegate + prompt:no_warnings_prompt]); [controller view]; // Force nib load. @@ -202,11 +200,10 @@ TEST_F(ExtensionInstallViewControllerTest, BasicsInline) { inline_prompt.set_extension(extension_.get()); inline_prompt.set_icon(chrome::LoadInstallPromptIcon()); - scoped_nsobject<ExtensionInstallViewController> - controller([[ExtensionInstallViewController alloc] - initWithNavigator:browser() - delegate:&delegate - prompt:inline_prompt]); + base::scoped_nsobject<ExtensionInstallViewController> controller( + [[ExtensionInstallViewController alloc] initWithNavigator:browser() + delegate:&delegate + prompt:inline_prompt]); [controller view]; // Force nib load. @@ -265,11 +262,10 @@ TEST_F(ExtensionInstallViewControllerTest, OAuthIssues) { issues.push_back(issue); prompt.SetOAuthIssueAdvice(issues); - scoped_nsobject<ExtensionInstallViewController> - controller([[ExtensionInstallViewController alloc] - initWithNavigator:browser() - delegate:&delegate - prompt:prompt]); + base::scoped_nsobject<ExtensionInstallViewController> controller( + [[ExtensionInstallViewController alloc] initWithNavigator:browser() + delegate:&delegate + prompt:prompt]); [controller view]; // Force nib load. NSOutlineView* outlineView = [controller outlineView]; @@ -290,11 +286,10 @@ TEST_F(ExtensionInstallViewControllerTest, PostInstallPermissionsPrompt) { permissions.push_back(UTF8ToUTF16("warning 1")); prompt.SetPermissions(permissions); - scoped_nsobject<ExtensionInstallViewController> - controller([[ExtensionInstallViewController alloc] - initWithNavigator:browser() - delegate:&delegate - prompt:prompt]); + base::scoped_nsobject<ExtensionInstallViewController> controller( + [[ExtensionInstallViewController alloc] initWithNavigator:browser() + delegate:&delegate + prompt:prompt]); [controller view]; // Force nib load. diff --git a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.h b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.h index 803a77d..aec6898 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.h +++ b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.h @@ -60,7 +60,7 @@ typedef enum { const extensions::Extension* extension_; // weak const extensions::BundleInstaller* bundle_; // weak Browser* browser_; // weak - scoped_nsobject<NSImage> icon_; + base::scoped_nsobject<NSImage> icon_; extension_installed_bubble::ExtensionType type_; @@ -91,7 +91,7 @@ typedef enum { // text views cannot conveniently be created in IB. The xib file contains // a text field |promoPlaceholder_| that's replaced by this text view |promo_| // in -awakeFromNib. - scoped_nsobject<HyperlinkTextView> promo_; + base::scoped_nsobject<HyperlinkTextView> promo_; // Only shown for bundle installs. IBOutlet NSTextField* installedHeadingMsg_; IBOutlet NSTextField* installedItemsMsg_; diff --git a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.h b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.h index 782505d..014f0a4 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.h +++ b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/base_bubble_controller.h" #import "chrome/browser/ui/cocoa/info_bubble_view.h" diff --git a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm index b2af054..d5dc47a 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm @@ -149,12 +149,11 @@ class DevtoolsNotificationBridge : public content::NotificationObserver { anchoredAt:(NSPoint)anchoredAt arrowLocation:(info_bubble::BubbleArrowLocation)arrowLocation devMode:(BOOL)devMode { - scoped_nsobject<InfoBubbleWindow> window( - [[InfoBubbleWindow alloc] - initWithContentRect:ui::kWindowSizeDeterminedLater - styleMask:NSBorderlessWindowMask - backing:NSBackingStoreBuffered - defer:YES]); + base::scoped_nsobject<InfoBubbleWindow> window([[InfoBubbleWindow alloc] + initWithContentRect:ui::kWindowSizeDeterminedLater + styleMask:NSBorderlessWindowMask + backing:NSBackingStoreBuffered + defer:YES]); if (!window.get()) return nil; diff --git a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h index 74e39cb..54559af 100644 --- a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h +++ b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h @@ -74,22 +74,22 @@ class MediaGalleriesDialogCocoa : public ConstrainedWindowMacDelegate, scoped_ptr<ConstrainedWindowMac> window_; // The alert that the dialog is being displayed as. - scoped_nsobject<ConstrainedWindowAlert> alert_; + base::scoped_nsobject<ConstrainedWindowAlert> alert_; // True if the user has pressed accept. bool accepted_; // List of checkboxes ordered from bottom to top. - scoped_nsobject<NSMutableArray> checkboxes_; + base::scoped_nsobject<NSMutableArray> checkboxes_; // Container view for checkboxes. - scoped_nsobject<NSView> checkbox_container_; + base::scoped_nsobject<NSView> checkbox_container_; // Container view for the main dialog contents. - scoped_nsobject<NSBox> accessory_; + base::scoped_nsobject<NSBox> accessory_; // An Objective-C class to route callbacks from Cocoa code. - scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller_; + base::scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller_; DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogCocoa); }; diff --git a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.mm b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.mm index 807a666..5e9940c 100644 --- a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.mm +++ b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.mm @@ -98,7 +98,7 @@ MediaGalleriesDialogCocoa::MediaGalleriesDialogCocoa( // May be NULL during tests. if (controller->web_contents()) { - scoped_nsobject<CustomConstrainedWindowSheet> sheet( + base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:[alert_ window]]); window_.reset(new ConstrainedWindowMac( @@ -121,9 +121,8 @@ void MediaGalleriesDialogCocoa::InitDialogControls() { blue:0.625 alpha:1.0]]; - scoped_nsobject<NSScrollView> scroll_view( - [[NSScrollView alloc] initWithFrame:NSMakeRect( - 0, 0, kCheckboxMaxWidth, kScrollAreaHeight)]); + base::scoped_nsobject<NSScrollView> scroll_view([[NSScrollView alloc] + initWithFrame:NSMakeRect(0, 0, kCheckboxMaxWidth, kScrollAreaHeight)]); [scroll_view setHasVerticalScroller:YES]; [scroll_view setHasHorizontalScroller:NO]; [scroll_view setBorderType:NSNoBorder]; @@ -203,7 +202,8 @@ CGFloat MediaGalleriesDialogCocoa::CreateUnattachedCheckboxes( } CGFloat MediaGalleriesDialogCocoa::CreateCheckboxSeparator(CGFloat y_pos) { - scoped_nsobject<NSBox> separator([[NSBox alloc] initWithFrame:NSMakeRect( + base::scoped_nsobject<NSBox> separator( + [[NSBox alloc] initWithFrame:NSMakeRect( 0, y_pos + kCheckboxMargin * 0.5, kCheckboxMaxWidth, 1.0)]); [separator setBoxType:NSBoxSeparator]; [separator setBorderType:NSLineBorder]; @@ -211,7 +211,7 @@ CGFloat MediaGalleriesDialogCocoa::CreateCheckboxSeparator(CGFloat y_pos) { [checkbox_container_ addSubview:separator]; y_pos += kCheckboxMargin * 0.5 + 4; - scoped_nsobject<NSTextField> unattached_label( + base::scoped_nsobject<NSTextField> unattached_label( [[NSTextField alloc] initWithFrame:NSZeroRect]); [unattached_label setEditable:NO]; [unattached_label setSelectable:NO]; @@ -288,7 +288,7 @@ void MediaGalleriesDialogCocoa::UpdateGalleryCheckbox( const MediaGalleryPrefInfo& gallery, bool permitted, CGFloat y_pos) { - scoped_nsobject<NSButton> checkbox( + base::scoped_nsobject<NSButton> checkbox( [[NSButton alloc] initWithFrame:NSZeroRect]); NSString* unique_id = GetUniqueIDForGallery(gallery); [[checkbox cell] setRepresentedObject:unique_id]; @@ -311,8 +311,8 @@ void MediaGalleriesDialogCocoa::UpdateGalleryCheckbox( [checkbox setFrame:rect]; [checkbox_container_ addSubview:checkbox]; - scoped_nsobject<NSTextField> details( - [[NSTextField alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSTextField> details( + [[NSTextField alloc] initWithFrame:NSZeroRect]); [details setEditable:NO]; [details setSelectable:NO]; [details setBezeled:NO]; @@ -355,7 +355,7 @@ void MediaGalleriesDialogCocoa::OnConstrainedWindowClosed( // static MediaGalleriesDialog* MediaGalleriesDialog::Create( MediaGalleriesDialogController* controller) { - scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller( + base::scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller( [[MediaGalleriesCocoaController alloc] init]); return new MediaGalleriesDialogCocoa(controller, cocoa_controller); } diff --git a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_browsertest.mm b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_browsertest.mm index 19b09ab..81dca35 100644 --- a/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_browsertest.mm +++ b/chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa_browsertest.mm @@ -44,7 +44,7 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesDialogBrowserTest, Close) { scoped_ptr<MediaGalleriesDialogCocoa> dialog( static_cast<MediaGalleriesDialogCocoa*>( MediaGalleriesDialog::Create(&controller))); - scoped_nsobject<NSWindow> window([[dialog->alert_ window] retain]); + base::scoped_nsobject<NSWindow> window([[dialog->alert_ window] retain]); EXPECT_TRUE([window isVisible]); WebContentsModalDialogManager* web_contents_modal_dialog_manager = diff --git a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h index f92d833..e32534e 100644 --- a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h +++ b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h @@ -8,7 +8,7 @@ #import <Cocoa/Cocoa.h> #include <vector> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/browser_command_executor.h" #include "chrome/browser/ui/extensions/native_app_window.h" @@ -159,7 +159,7 @@ class NativeAppWindowCocoa : public NativeAppWindow { gfx::Size max_size_; bool resizable_; - scoped_nsobject<NativeAppWindowController> window_controller_; + base::scoped_nsobject<NativeAppWindowController> window_controller_; NSInteger attention_request_id_; // identifier from requestUserAttention // Indicates whether system drag or custom drag should be used, depending on diff --git a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm index 460ac10..583f7e9 100644 --- a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm +++ b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm @@ -226,7 +226,7 @@ NativeAppWindowCocoa::NativeAppWindowCocoa( NSTexturedBackgroundWindowMask; if (resizable_) style_mask |= NSResizableWindowMask; - scoped_nsobject<NSWindow> window; + base::scoped_nsobject<NSWindow> window; if (has_frame_) { window.reset([[ShellNSWindow alloc] initWithContentRect:cocoa_bounds @@ -656,7 +656,7 @@ void NativeAppWindowCocoa::InstallDraggableRegionViews() { // Note that [webView subviews] returns the view's mutable internal array and // it should be copied to avoid mutating the original array while enumerating // it. - scoped_nsobject<NSArray> subviews([[webView subviews] copy]); + base::scoped_nsobject<NSArray> subviews([[webView subviews] copy]); for (NSView* subview in subviews.get()) if ([subview isKindOfClass:[ControlRegionView class]]) [subview removeFromSuperview]; @@ -667,7 +667,7 @@ void NativeAppWindowCocoa::InstallDraggableRegionViews() { system_drag_exclude_areas_.begin(); iter != system_drag_exclude_areas_.end(); ++iter) { - scoped_nsobject<NSView> controlRegion( + base::scoped_nsobject<NSView> controlRegion( [[ControlRegionView alloc] initWithAppWindow:this]); [controlRegion setFrame:NSMakeRect(iter->x(), webViewHeight - iter->bottom(), diff --git a/chrome/browser/ui/cocoa/fast_resize_view_unittest.mm b/chrome/browser/ui/cocoa/fast_resize_view_unittest.mm index 02ac295..edfea60 100644 --- a/chrome/browser/ui/cocoa/fast_resize_view_unittest.mm +++ b/chrome/browser/ui/cocoa/fast_resize_view_unittest.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. -#include "base/memory/scoped_nsobject.h" -#import "chrome/browser/ui/cocoa/fast_resize_view.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" +#import "chrome/browser/ui/cocoa/fast_resize_view.h" namespace { @@ -12,12 +12,13 @@ class FastResizeViewTest : public CocoaTest { public: FastResizeViewTest() { NSRect frame = NSMakeRect(0, 0, 100, 30); - scoped_nsobject<FastResizeView> view( + base::scoped_nsobject<FastResizeView> view( [[FastResizeView alloc] initWithFrame:frame]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; - scoped_nsobject<NSView> childView([[NSView alloc] initWithFrame:frame]); + base::scoped_nsobject<NSView> childView( + [[NSView alloc] initWithFrame:frame]); childView_ = childView.get(); [view_ addSubview:childView_]; } diff --git a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h index e5c482b..4c5a018 100644 --- a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h +++ b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" #include "ui/gfx/point.h" @@ -33,19 +33,19 @@ class FindNotificationDetails; Browser* browser_; - scoped_nsobject<FocusTracker> focusTracker_; + base::scoped_nsobject<FocusTracker> focusTracker_; // The show/hide animation. This is defined to be non-nil if the // animation is running, and is always nil otherwise. The // FindBarCocoaController should not be deallocated while an animation is // running (stopAnimation is currently called before the last tab in a // window is removed). - scoped_nsobject<NSViewAnimation> showHideAnimation_; + base::scoped_nsobject<NSViewAnimation> showHideAnimation_; // The horizontal-moving animation, to avoid occluding find results. This // is nil when the animation is not running, and is also stopped by // stopAnimation. - scoped_nsobject<NSViewAnimation> moveAnimation_; + base::scoped_nsobject<NSViewAnimation> moveAnimation_; // If YES, do nothing as a result of find pasteboard update notifications. BOOL suppressPboardUpdateActions_; diff --git a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller_unittest.mm b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller_unittest.mm index 20aae91..9cd4db5 100644 --- a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller_unittest.mm @@ -53,7 +53,7 @@ class FindBarCocoaControllerTest : public CocoaTest { } protected: - scoped_nsobject<FindBarCocoaController> controller_; + base::scoped_nsobject<FindBarCocoaController> controller_; }; TEST_VIEW(FindBarCocoaControllerTest, [controller_ view]) @@ -110,7 +110,7 @@ TEST_F(FindBarCocoaControllerTest, ResultLabelUpdatesCorrectly) { } TEST_F(FindBarCocoaControllerTest, FindTextIsGlobal) { - scoped_nsobject<FindBarCocoaController> otherController( + base::scoped_nsobject<FindBarCocoaController> otherController( [[FindBarCocoaController alloc] initWithBrowser:nil]); [[test_window() contentView] addSubview:[otherController view]]; diff --git a/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.h b/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.h index ec61dc5..130009f 100644 --- a/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.h +++ b/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.h @@ -6,14 +6,14 @@ #import "chrome/browser/ui/cocoa/styled_text_field_cell.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" // FindBarTextFieldCell extends StyledTextFieldCell to provide support for a // results label rooted at the right edge of the cell. @interface FindBarTextFieldCell : StyledTextFieldCell { @private // Set if there is a results label to display on the right side of the cell. - scoped_nsobject<NSAttributedString> resultsString_; + base::scoped_nsobject<NSAttributedString> resultsString_; } // Sets the results label to the localized equivalent of "X of Y". diff --git a/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.mm b/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.mm index 3d2095c..82b0bf0 100644 --- a/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.mm +++ b/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.mm @@ -57,7 +57,7 @@ CGFloat WidthForResults(NSAttributedString* resultsString) { // Convenience for the attributes used in the right-justified info // cells. Sets the background color to red if |foundMatches| is YES. - (NSDictionary*)resultsAttributes:(BOOL)foundMatches { - scoped_nsobject<NSMutableParagraphStyle> style( + base::scoped_nsobject<NSMutableParagraphStyle> style( [[NSMutableParagraphStyle alloc] init]); [style setAlignment:NSRightTextAlignment]; diff --git a/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell_unittest.mm b/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell_unittest.mm index 8b33d2a..249ff56 100644 --- a/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell_unittest.mm @@ -4,9 +4,9 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" -#import "chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" +#import "chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -36,13 +36,13 @@ class FindBarTextFieldCellTest : public CocoaTest { // decorations. const NSRect frame = NSMakeRect(0, 0, kWidth, 30); - scoped_nsobject<FindBarTextFieldCell> cell( + base::scoped_nsobject<FindBarTextFieldCell> cell( [[FindBarTextFieldCell alloc] initTextCell:@"Testing"]); cell_ = cell; [cell_ setEditable:YES]; [cell_ setBordered:YES]; - scoped_nsobject<NSTextField> view( + base::scoped_nsobject<NSTextField> view( [[NSTextField alloc] initWithFrame:frame]); view_ = view; [view_ setCell:cell_]; @@ -81,12 +81,12 @@ TEST_F(FindBarTextFieldCellTest, FocusedDisplay) { // appropriately. TEST_F(FindBarTextFieldCellTest, SetAndClearFindResults) { [cell_ setActiveMatch:10 of:30]; - scoped_nsobject<NSAttributedString> tenString( + base::scoped_nsobject<NSAttributedString> tenString( [[cell_ resultsAttributedString] copy]); EXPECT_GT([tenString length], 0U); [cell_ setActiveMatch:0 of:0]; - scoped_nsobject<NSAttributedString> zeroString( + base::scoped_nsobject<NSAttributedString> zeroString( [[cell_ resultsAttributedString] copy]); EXPECT_GT([zeroString length], 0U); EXPECT_FALSE([tenString isEqualToAttributedString:zeroString]); diff --git a/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_unittest.mm b/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_unittest.mm index d205efb..30bc8d6 100644 --- a/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_unittest.mm +++ b/chrome/browser/ui/cocoa/find_bar/find_bar_text_field_unittest.mm @@ -4,10 +4,10 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" +#import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/find_bar/find_bar_text_field.h" #import "chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.h" -#import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -23,7 +23,7 @@ class FindBarTextFieldTest : public CocoaTest { // Make sure this is wide enough to play games with the cell // decorations. NSRect frame = NSMakeRect(0, 0, kWidth, 30); - scoped_nsobject<FindBarTextField> field( + base::scoped_nsobject<FindBarTextField> field( [[FindBarTextField alloc] initWithFrame:frame]); field_ = field.get(); diff --git a/chrome/browser/ui/cocoa/find_bar/find_bar_view_unittest.mm b/chrome/browser/ui/cocoa/find_bar/find_bar_view_unittest.mm index 3714aa5..6f6ea80 100644 --- a/chrome/browser/ui/cocoa/find_bar/find_bar_view_unittest.mm +++ b/chrome/browser/ui/cocoa/find_bar/find_bar_view_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/find_bar/find_bar_view.h" #include "testing/gtest/include/gtest/gtest.h" @@ -31,7 +31,7 @@ class FindBarViewTest : public CocoaTest { public: FindBarViewTest() { NSRect frame = NSMakeRect(0, 0, 100, 30); - scoped_nsobject<FindBarView> view( + base::scoped_nsobject<FindBarView> view( [[FindBarView alloc] initWithFrame:frame]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; @@ -43,7 +43,7 @@ class FindBarViewTest : public CocoaTest { TEST_VIEW(FindBarViewTest, view_) TEST_F(FindBarViewTest, FindBarEatsMouseClicksInBackgroundArea) { - scoped_nsobject<MouseDownViewPong> pongView( + base::scoped_nsobject<MouseDownViewPong> pongView( [[MouseDownViewPong alloc] initWithFrame:NSMakeRect(0, 0, 200, 200)]); // Remove all of the subviews of the findbar, to make sure we don't @@ -68,7 +68,7 @@ TEST_F(FindBarViewTest, FindBarEatsMouseClicksInBackgroundArea) { } TEST_F(FindBarViewTest, FindBarPassesThroughClicksInTransparentArea) { - scoped_nsobject<MouseDownViewPong> pongView( + base::scoped_nsobject<MouseDownViewPong> pongView( [[MouseDownViewPong alloc] initWithFrame:NSMakeRect(0, 0, 200, 200)]); [view_ setFrame:NSMakeRect(0, 0, 200, 200)]; diff --git a/chrome/browser/ui/cocoa/find_pasteboard_unittest.mm b/chrome/browser/ui/cocoa/find_pasteboard_unittest.mm index 049e152..374abc6 100644 --- a/chrome/browser/ui/cocoa/find_pasteboard_unittest.mm +++ b/chrome/browser/ui/cocoa/find_pasteboard_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -68,7 +68,7 @@ class FindPasteboardTest : public CocoaTest { pboard_.reset([[FindPasteboardTesting alloc] init]); } protected: - scoped_nsobject<FindPasteboardTesting> pboard_; + base::scoped_nsobject<FindPasteboardTesting> pboard_; }; TEST_F(FindPasteboardTest, SettingTextUpdatesPboard) { diff --git a/chrome/browser/ui/cocoa/first_run_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/first_run_bubble_controller_unittest.mm index 1d502f4..aee4d06 100644 --- a/chrome/browser/ui/cocoa/first_run_bubble_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/first_run_bubble_controller_unittest.mm @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> #include "base/debug/debugger.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" #include "testing/gtest/include/gtest/gtest.h" @@ -18,11 +18,11 @@ class FirstRunBubbleControllerTest : public CocoaProfileTest { // Check that the bubble doesn't crash or leak. TEST_F(FirstRunBubbleControllerTest, Init) { - scoped_nsobject<NSWindow> parent([[NSWindow alloc] - initWithContentRect:NSMakeRect(0, 0, 800, 600) - styleMask:NSBorderlessWindowMask - backing:NSBackingStoreBuffered - defer:NO]); + base::scoped_nsobject<NSWindow> parent( + [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600) + styleMask:NSBorderlessWindowMask + backing:NSBackingStoreBuffered + defer:NO]); [parent setReleasedWhenClosed:NO]; if (base::debug::BeingDebugged()) [parent.get() orderFront:nil]; diff --git a/chrome/browser/ui/cocoa/first_run_dialog.mm b/chrome/browser/ui/cocoa/first_run_dialog.mm index 658495e..29486ff 100644 --- a/chrome/browser/ui/cocoa/first_run_dialog.mm +++ b/chrome/browser/ui/cocoa/first_run_dialog.mm @@ -7,8 +7,8 @@ #include "base/bind.h" #include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/ref_counted.h" -#import "base/memory/scoped_nsobject.h" #include "base/message_loop.h" #include "base/strings/sys_string_conversions.h" #include "chrome/browser/first_run/first_run.h" @@ -91,7 +91,7 @@ bool ShowFirstRun(Profile* profile) { g_browser_process->local_state()->FindPreference( prefs::kMetricsReportingEnabled); if (!metrics_reporting_pref || !metrics_reporting_pref->IsManaged()) { - scoped_nsobject<FirstRunDialogController> dialog( + base::scoped_nsobject<FirstRunDialogController> dialog( [[FirstRunDialogController alloc] init]); [dialog.get() showWindow:nil]; diff --git a/chrome/browser/ui/cocoa/floating_bar_backing_view_unittest.mm b/chrome/browser/ui/cocoa/floating_bar_backing_view_unittest.mm index bf94628..f4a3a59 100644 --- a/chrome/browser/ui/cocoa/floating_bar_backing_view_unittest.mm +++ b/chrome/browser/ui/cocoa/floating_bar_backing_view_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. -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/floating_bar_backing_view.h" @@ -12,7 +12,7 @@ class FloatingBarBackingViewTest : public CocoaTest { public: FloatingBarBackingViewTest() { NSRect content_frame = [[test_window() contentView] frame]; - scoped_nsobject<FloatingBarBackingView> view( + base::scoped_nsobject<FloatingBarBackingView> view( [[FloatingBarBackingView alloc] initWithFrame:content_frame]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; diff --git a/chrome/browser/ui/cocoa/framed_browser_window.h b/chrome/browser/ui/cocoa/framed_browser_window.h index ee70280..024dc99 100644 --- a/chrome/browser/ui/cocoa/framed_browser_window.h +++ b/chrome/browser/ui/cocoa/framed_browser_window.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/cocoa/chrome_browser_window.h" // Offsets from the top/left of the window frame to the top of the window diff --git a/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm b/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm index 066576e..32322ee 100644 --- a/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm +++ b/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm @@ -5,7 +5,7 @@ #import <Cocoa/Cocoa.h> #include "base/debug/debugger.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/app/chrome_command_ids.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" @@ -54,7 +54,7 @@ class FramedBrowserWindowTest : public CocoaTest { bounds.origin.y += 40; [frameView lockFocus]; - scoped_nsobject<NSBitmapImageRep> bitmap( + base::scoped_nsobject<NSBitmapImageRep> bitmap( [[NSBitmapImageRep alloc] initWithFocusedViewRect:bounds]); [frameView unlockFocus]; diff --git a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h index b48fc87..60b986d 100644 --- a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h +++ b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.h" #include "googleurl/src/gurl.h" @@ -34,10 +34,10 @@ class Browser; // text views cannot conveniently be created in IB. The xib file contains // a text field |exitLabelPlaceholder_| that's replaced by this text view // |exitLabel_| in -awakeFromNib. - scoped_nsobject<NSTextView> exitLabel_; + base::scoped_nsobject<NSTextView> exitLabel_; - scoped_nsobject<NSTimer> hideTimer_; - scoped_nsobject<NSAnimation> hideAnimation_; + base::scoped_nsobject<NSTimer> hideTimer_; + base::scoped_nsobject<NSAnimation> hideAnimation_; }; // Initializes a new InfoBarController. diff --git a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller_unittest.mm index 520755e..c730c99 100644 --- a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller_unittest.mm @@ -72,7 +72,7 @@ class FullscreenExitBubbleControllerTest : public CocoaProfileTest { } scoped_refptr<SiteInstance> site_instance_; - scoped_nsobject<FullscreenExitBubbleController> controller_; + base::scoped_nsobject<FullscreenExitBubbleController> controller_; }; // http://crbug.com/103912 diff --git a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.mm b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.mm index 6c491d6..8d79127 100644 --- a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.mm +++ b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.h" #include "base/mac/mac_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" namespace { @@ -43,7 +43,7 @@ const CGFloat kBubbleCornerRadius = 8.0; [bezier closePath]; [[NSColor whiteColor] set]; gfx::ScopedNSGraphicsContextSaveGState scoped_g_state; - scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); + base::scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); if (base::mac::IsOSLionOrLater()) { [shadow setShadowBlurRadius:kShadowBlurRadiusLion]; } else { diff --git a/chrome/browser/ui/cocoa/fullscreen_window_unittest.mm b/chrome/browser/ui/cocoa/fullscreen_window_unittest.mm index 0ccf365..b80022b 100644 --- a/chrome/browser/ui/cocoa/fullscreen_window_unittest.mm +++ b/chrome/browser/ui/cocoa/fullscreen_window_unittest.mm @@ -25,7 +25,7 @@ class FullscreenWindowTest : public CocoaTest { }; TEST_F(FullscreenWindowTest, Basics) { - scoped_nsobject<FullscreenWindow> window; + base::scoped_nsobject<FullscreenWindow> window; window.reset([[FullscreenWindow alloc] init]); EXPECT_EQ([NSScreen mainScreen], [window screen]); @@ -37,10 +37,10 @@ TEST_F(FullscreenWindowTest, Basics) { } TEST_F(FullscreenWindowTest, CanPerformClose) { - scoped_nsobject<FullscreenWindow> window; + base::scoped_nsobject<FullscreenWindow> window; window.reset([[FullscreenWindow alloc] init]); - scoped_nsobject<PerformCloseUIItem> item; + base::scoped_nsobject<PerformCloseUIItem> item; item.reset([[PerformCloseUIItem alloc] init]); EXPECT_TRUE([window validateUserInterfaceItem:item.get()]); diff --git a/chrome/browser/ui/cocoa/global_error_bubble_controller.mm b/chrome/browser/ui/cocoa/global_error_bubble_controller.mm index bb3377a..4ccb41a 100644 --- a/chrome/browser/ui/cocoa/global_error_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/global_error_bubble_controller.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/global_error_bubble_controller.h" #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -90,10 +90,10 @@ class Bridge : public GlobalErrorBubbleViewBase { std::vector<string16> messages = error_->GetBubbleViewMessages(); string16 message = JoinString(messages, '\n'); - scoped_nsobject<NSMutableAttributedString> messageValue( + base::scoped_nsobject<NSMutableAttributedString> messageValue( [[NSMutableAttributedString alloc] - initWithString:SysUTF16ToNSString(message)]); - scoped_nsobject<NSMutableParagraphStyle> style( + initWithString:SysUTF16ToNSString(message)]); + base::scoped_nsobject<NSMutableParagraphStyle> style( [[NSMutableParagraphStyle alloc] init]); [style setParagraphSpacing:kParagraphSpacing]; [messageValue addAttribute:NSParagraphStyleAttributeName diff --git a/chrome/browser/ui/cocoa/gradient_button_cell.h b/chrome/browser/ui/cocoa/gradient_button_cell.h index 515bc3a..7b03a28 100644 --- a/chrome/browser/ui/cocoa/gradient_button_cell.h +++ b/chrome/browser/ui/cocoa/gradient_button_cell.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" namespace ui { class ThemeProvider; @@ -55,15 +55,15 @@ typedef enum { // Custom drawing means we need to perform our own mouse tracking if // the cell is setShowsBorderOnlyWhileMouseInside:YES. BOOL isMouseInside_; - scoped_nsobject<NSTrackingArea> trackingArea_; + base::scoped_nsobject<NSTrackingArea> trackingArea_; BOOL shouldTheme_; CGFloat hoverAlpha_; // 0-1. Controls the alpha during mouse hover NSTimeInterval lastHoverUpdate_; - scoped_nsobject<NSGradient> gradient_; + base::scoped_nsobject<NSGradient> gradient_; gradient_button_cell::PulseState pulseState_; CGFloat pulseMultiplier_; // for selecting pulse direction when continuous. CGFloat outerStrokeAlphaMult_; // For pulsing. - scoped_nsobject<NSImage> overlayImage_; + base::scoped_nsobject<NSImage> overlayImage_; } // Turn off theming. Temporary work-around. diff --git a/chrome/browser/ui/cocoa/gradient_button_cell.mm b/chrome/browser/ui/cocoa/gradient_button_cell.mm index b5b0d51..959e0d3 100644 --- a/chrome/browser/ui/cocoa/gradient_button_cell.mm +++ b/chrome/browser/ui/cocoa/gradient_button_cell.mm @@ -7,12 +7,12 @@ #include <cmath> #include "base/logging.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "chrome/browser/themes/theme_properties.h" #import "chrome/browser/themes/theme_service.h" #import "chrome/browser/ui/cocoa/nsview_additions.h" -#import "chrome/browser/ui/cocoa/themed_window.h" #import "chrome/browser/ui/cocoa/rect_path_utils.h" +#import "chrome/browser/ui/cocoa/themed_window.h" #include "grit/theme_resources.h" #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" #import "ui/base/cocoa/nsgraphics_context_additions.h" @@ -422,7 +422,7 @@ static const NSTimeInterval kAnimationContinuousCycleDuration = 0.4; // Draw the top inner highlight. NSAffineTransform* highlightTransform = [NSAffineTransform transform]; [highlightTransform translateXBy:1 yBy:1]; - scoped_nsobject<NSBezierPath> highlightPath([innerPath copy]); + base::scoped_nsobject<NSBezierPath> highlightPath([innerPath copy]); [highlightPath transformUsingAffineTransform:highlightTransform]; [[NSColor colorWithCalibratedWhite:1.0 alpha:0.2] setStroke]; [highlightPath stroke]; @@ -604,7 +604,7 @@ static const NSTimeInterval kAnimationContinuousCycleDuration = 0.4; [NSColor blackColor]; if (isTemplate && themeProvider && themeProvider->UsingDefaultTheme()) { - scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); + base::scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); [shadow.get() setShadowColor:themeProvider->GetNSColor( ThemeProperties::COLOR_TOOLBAR_BEZEL, true)]; [shadow.get() setShadowOffset:NSMakeSize(0.0, -lineWidth)]; diff --git a/chrome/browser/ui/cocoa/gradient_button_cell_unittest.mm b/chrome/browser/ui/cocoa/gradient_button_cell_unittest.mm index c174ae6..b9ea960 100644 --- a/chrome/browser/ui/cocoa/gradient_button_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/gradient_button_cell_unittest.mm @@ -4,9 +4,9 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" -#import "chrome/browser/ui/cocoa/gradient_button_cell.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" +#import "chrome/browser/ui/cocoa/gradient_button_cell.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -20,10 +20,11 @@ class GradientButtonCellTest : public CocoaTest { public: GradientButtonCellTest() { NSRect frame = NSMakeRect(0, 0, 50, 30); - scoped_nsobject<NSButton>view([[NSButton alloc] initWithFrame:frame]); + base::scoped_nsobject<NSButton> view( + [[NSButton alloc] initWithFrame:frame]); view_ = view.get(); - scoped_nsobject<GradientButtonCell> cell([[GradientButtonCell alloc] - initTextCell:@"Testing"]); + base::scoped_nsobject<GradientButtonCell> cell( + [[GradientButtonCell alloc] initTextCell:@"Testing"]); [view_ setCell:cell.get()]; [[test_window() contentView] addSubview:view_]; } diff --git a/chrome/browser/ui/cocoa/history_menu_bridge.h b/chrome/browser/ui/cocoa/history_menu_bridge.h index 8f4582e..2ab76ed1 100644 --- a/chrome/browser/ui/cocoa/history_menu_bridge.h +++ b/chrome/browser/ui/cocoa/history_menu_bridge.h @@ -9,8 +9,8 @@ #include <map> #include <vector> +#include "base/mac/scoped_nsobject.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_nsobject.h" #include "chrome/browser/common/cancelable_request.h" #import "chrome/browser/favicon/favicon_service.h" #include "chrome/browser/history/history_service.h" @@ -75,7 +75,7 @@ class HistoryMenuBridge : public content::NotificationObserver, // The URL that will be navigated to if the user selects this item. GURL url; // Favicon for the URL. - scoped_nsobject<NSImage> icon; + base::scoped_nsobject<NSImage> icon; // If the icon is being requested from the FaviconService, |icon_requested| // will be true and |icon_task_id| will be valid. If this is false, then @@ -89,7 +89,7 @@ class HistoryMenuBridge : public content::NotificationObserver, // quickly), the NSMenu can release the item before the HistoryItem has // been fully deleted. If this were a weak pointer, it would result in a // zombie. - scoped_nsobject<NSMenuItem> menu_item; + base::scoped_nsobject<NSMenuItem> menu_item; // This ID is unique for a browser session and can be passed to the // TabRestoreService to re-open the closed window or tab that this @@ -204,7 +204,7 @@ class HistoryMenuBridge : public content::NotificationObserver, friend class ::HistoryMenuBridgeTest; friend class HistoryMenuCocoaControllerTest; - scoped_nsobject<HistoryMenuCocoaController> controller_; // strong + base::scoped_nsobject<HistoryMenuCocoaController> controller_; // strong Profile* profile_; // weak HistoryService* history_service_; // weak @@ -229,7 +229,7 @@ class HistoryMenuBridge : public content::NotificationObserver, bool need_recreate_; // The default favicon if a HistoryItem does not have one. - scoped_nsobject<NSImage> default_favicon_; + base::scoped_nsobject<NSImage> default_favicon_; DISALLOW_COPY_AND_ASSIGN(HistoryMenuBridge); }; diff --git a/chrome/browser/ui/cocoa/history_menu_bridge.mm b/chrome/browser/ui/cocoa/history_menu_bridge.mm index dcf7b8b..0fc7438 100644 --- a/chrome/browser/ui/cocoa/history_menu_bridge.mm +++ b/chrome/browser/ui/cocoa/history_menu_bridge.mm @@ -207,12 +207,12 @@ void HistoryMenuBridge::TabRestoreServiceChanged(TabRestoreService* service) { item->session_id = entry_win->id; // Create the submenu. - scoped_nsobject<NSMenu> submenu([[NSMenu alloc] init]); + base::scoped_nsobject<NSMenu> submenu([[NSMenu alloc] init]); // Create standard items within the window submenu. NSString* restore_title = l10n_util::GetNSString( IDS_HISTORY_CLOSED_RESTORE_WINDOW_MAC); - scoped_nsobject<NSMenuItem> restore_item( + base::scoped_nsobject<NSMenuItem> restore_item( [[NSMenuItem alloc] initWithTitle:restore_title action:@selector(openHistoryMenuItem:) keyEquivalent:@""]); diff --git a/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm b/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm index cccecdb..8ff1cf8 100644 --- a/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm +++ b/chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm @@ -42,7 +42,7 @@ class MockBridge : public HistoryMenuBridge { } private: - scoped_nsobject<NSMenu> menu_; + base::scoped_nsobject<NSMenu> menu_; }; class HistoryMenuBridgeTest : public CocoaProfileTest { diff --git a/chrome/browser/ui/cocoa/history_menu_cocoa_controller_unittest.mm b/chrome/browser/ui/cocoa/history_menu_cocoa_controller_unittest.mm index ddcfa9c..3870efb 100644 --- a/chrome/browser/ui/cocoa/history_menu_cocoa_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/history_menu_cocoa_controller_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" @@ -71,7 +71,7 @@ class HistoryMenuCocoaControllerTest : public CocoaProfileTest { }; TEST_F(HistoryMenuCocoaControllerTest, OpenURLForItem) { - scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@"History"]); + base::scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@"History"]); CreateItems(menu.get()); std::map<NSMenuItem*, HistoryMenuBridge::HistoryItem*>& items = diff --git a/chrome/browser/ui/cocoa/history_overlay_controller.h b/chrome/browser/ui/cocoa/history_overlay_controller.h index 3a83a26..541b2f2 100644 --- a/chrome/browser/ui/cocoa/history_overlay_controller.h +++ b/chrome/browser/ui/cocoa/history_overlay_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" @class HistoryOverlayView; @@ -23,9 +23,9 @@ enum HistoryOverlayMode { @private HistoryOverlayMode mode_; // Strongly typed reference of self.view. - scoped_nsobject<HistoryOverlayView> contentView_; + base::scoped_nsobject<HistoryOverlayView> contentView_; // The view above which self.view is inserted as a subview. - scoped_nsobject<NSView> parent_; + base::scoped_nsobject<NSView> parent_; } // Designated initializer. diff --git a/chrome/browser/ui/cocoa/history_overlay_controller.mm b/chrome/browser/ui/cocoa/history_overlay_controller.mm index f211afc..593a942 100644 --- a/chrome/browser/ui/cocoa/history_overlay_controller.mm +++ b/chrome/browser/ui/cocoa/history_overlay_controller.mm @@ -62,7 +62,7 @@ const CGFloat kGestureCompleteProgress = 0.3; NSRect arrowRect = NSMakeRect(offset, 0, kShieldRadius, kShieldHeight); arrowRect = NSInsetRect(arrowRect, 10, 0); // Give a little padding. - scoped_nsobject<NSImageView> imageView( + base::scoped_nsobject<NSImageView> imageView( [[NSImageView alloc] initWithFrame:arrowRect]); [imageView setImage:image]; [imageView setAutoresizingMask:NSViewMinYMargin | NSViewMaxYMargin]; @@ -162,7 +162,7 @@ const CGFloat kGestureCompleteProgress = 0.3; NSView* overlay = self.view; - scoped_nsobject<CAAnimation> animation( + base::scoped_nsobject<CAAnimation> animation( [[overlay animationForKey:@"alphaValue"] copy]); [animation setDelegate:self]; [animation setDuration:kFadeOutDurationSeconds]; diff --git a/chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm b/chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm index 491bf24..96ab915 100644 --- a/chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm @@ -28,7 +28,7 @@ class HistoryOverlayControllerTest : public CocoaTest { } private: - scoped_nsobject<NSView> test_view_; + base::scoped_nsobject<NSView> test_view_; }; // Tests that the controller's view gets removed from the hierarchy when the @@ -37,7 +37,7 @@ TEST_F(HistoryOverlayControllerTest, RemovedViewWhenDeallocated) { NSView* content_view = [test_window() contentView]; EXPECT_EQ(1u, [[content_view subviews] count]); - scoped_nsobject<HistoryOverlayController> controller( + base::scoped_nsobject<HistoryOverlayController> controller( [[HistoryOverlayController alloc] initForMode:kHistoryOverlayModeBack]); [controller showPanelForView:test_view()]; EXPECT_EQ(2u, [[content_view subviews] count]); @@ -49,7 +49,7 @@ TEST_F(HistoryOverlayControllerTest, RemovedViewWhenDeallocated) { // Tests that when the controller is |-dismiss|ed, the animation runs and then // is removed when the animation completes. TEST_F(HistoryOverlayControllerTest, DismissClearsAnimations) { - scoped_nsobject<HistoryOverlayController> controller( + base::scoped_nsobject<HistoryOverlayController> controller( [[HistoryOverlayController alloc] initForMode:kHistoryOverlayModeBack]); [controller showPanelForView:test_view()]; diff --git a/chrome/browser/ui/cocoa/hover_close_button.mm b/chrome/browser/ui/cocoa/hover_close_button.mm index 793f345..a49a0f4 100644 --- a/chrome/browser/ui/cocoa/hover_close_button.mm +++ b/chrome/browser/ui/cocoa/hover_close_button.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/hover_close_button.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/cocoa/hover_close_button_unittest.mm b/chrome/browser/ui/cocoa/hover_close_button_unittest.mm index c978499..5d19c30 100644 --- a/chrome/browser/ui/cocoa/hover_close_button_unittest.mm +++ b/chrome/browser/ui/cocoa/hover_close_button_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/hover_close_button.h" #include "testing/gtest/include/gtest/gtest.h" @@ -18,7 +18,7 @@ class HoverCloseButtonTest : public CocoaTest { } protected: - scoped_nsobject<HoverCloseButton> button_; + base::scoped_nsobject<HoverCloseButton> button_; }; class WebUIHoverCloseButtonTest : public CocoaTest { @@ -30,7 +30,7 @@ class WebUIHoverCloseButtonTest : public CocoaTest { } protected: - scoped_nsobject<WebUIHoverCloseButton> button_; + base::scoped_nsobject<WebUIHoverCloseButton> button_; }; TEST_VIEW(HoverCloseButtonTest, button_) diff --git a/chrome/browser/ui/cocoa/hung_renderer_controller.h b/chrome/browser/ui/cocoa/hung_renderer_controller.h index 1d55c8d..1725726 100644 --- a/chrome/browser/ui/cocoa/hung_renderer_controller.h +++ b/chrome/browser/ui/cocoa/hung_renderer_controller.h @@ -19,7 +19,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "base/memory/scoped_ptr.h" @class MultiKeyEquivalentButton; @@ -46,11 +46,11 @@ class WebContents; // Backing data for |tableView_|. Titles of each WebContents that // shares a renderer process with |hungContents_|. - scoped_nsobject<NSArray> hungTitles_; + base::scoped_nsobject<NSArray> hungTitles_; // Favicons of each WebContents that shares a renderer process with // |hungContents_|. - scoped_nsobject<NSArray> hungFavicons_; + base::scoped_nsobject<NSArray> hungFavicons_; } // Kills the hung renderers. diff --git a/chrome/browser/ui/cocoa/hung_renderer_controller.mm b/chrome/browser/ui/cocoa/hung_renderer_controller.mm index 0837b8b..b75da41 100644 --- a/chrome/browser/ui/cocoa/hung_renderer_controller.mm +++ b/chrome/browser/ui/cocoa/hung_renderer_controller.mm @@ -176,8 +176,8 @@ class WebContentsObserverBridge : public content::WebContentsObserver { DCHECK(contents); hungContents_ = contents; hungContentsObserver_.reset(new WebContentsObserverBridge(contents, self)); - scoped_nsobject<NSMutableArray> titles([[NSMutableArray alloc] init]); - scoped_nsobject<NSMutableArray> favicons([[NSMutableArray alloc] init]); + base::scoped_nsobject<NSMutableArray> titles([[NSMutableArray alloc] init]); + base::scoped_nsobject<NSMutableArray> favicons([[NSMutableArray alloc] init]); for (TabContentsIterator it; !it.done(); it.Next()) { if (it->GetRenderProcessHost() == hungContents_->GetRenderProcessHost()) { string16 title = it->GetTitle(); diff --git a/chrome/browser/ui/cocoa/hung_renderer_controller_unittest.mm b/chrome/browser/ui/cocoa/hung_renderer_controller_unittest.mm index 4e71bd4..87bfdc4 100644 --- a/chrome/browser/ui/cocoa/hung_renderer_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/hung_renderer_controller_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/hung_renderer_controller.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/ui/cocoa/hyperlink_button_cell.h b/chrome/browser/ui/cocoa/hyperlink_button_cell.h index 2857275..1cdc263 100644 --- a/chrome/browser/ui/cocoa/hyperlink_button_cell.h +++ b/chrome/browser/ui/cocoa/hyperlink_button_cell.h @@ -3,7 +3,7 @@ // found in the LICENSE file. #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" // A HyperlinkButtonCell is used to create an NSButton that looks and acts // like a hyperlink. The default styling is to look like blue, underlined text @@ -16,7 +16,7 @@ // 4. In the Attributes panel, change the Bezel to Square. // 5. In the Size panel, set the Height to 16. @interface HyperlinkButtonCell : NSButtonCell { - scoped_nsobject<NSColor> textColor_; + base::scoped_nsobject<NSColor> textColor_; BOOL shouldUnderline_; BOOL underlineOnHover_; BOOL mouseIsInside_; diff --git a/chrome/browser/ui/cocoa/hyperlink_button_cell.mm b/chrome/browser/ui/cocoa/hyperlink_button_cell.mm index 4047101..49f316c 100644 --- a/chrome/browser/ui/cocoa/hyperlink_button_cell.mm +++ b/chrome/browser/ui/cocoa/hyperlink_button_cell.mm @@ -20,7 +20,7 @@ + (NSButton*)buttonWithString:(NSString*)string { NSButton* button = [[[NSButton alloc] initWithFrame:NSZeroRect] autorelease]; - scoped_nsobject<HyperlinkButtonCell> cell( + base::scoped_nsobject<HyperlinkButtonCell> cell( [[HyperlinkButtonCell alloc] initTextCell:string]); [cell setAlignment:NSLeftTextAlignment]; [button setCell:cell.get()]; @@ -83,8 +83,8 @@ (!underlineOnHover_ || (mouseIsInside_ && [self isEnabled]))) underlineMask = NSUnderlinePatternSolid | NSUnderlineStyleSingle; - scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( - [[NSParagraphStyle defaultParagraphStyle] mutableCopy]); + base::scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( + [[NSParagraphStyle defaultParagraphStyle] mutableCopy]); [paragraphStyle setAlignment:[self alignment]]; [paragraphStyle setLineBreakMode:[self lineBreakMode]]; diff --git a/chrome/browser/ui/cocoa/hyperlink_button_cell_unittest.mm b/chrome/browser/ui/cocoa/hyperlink_button_cell_unittest.mm index fb59046..18abc03 100644 --- a/chrome/browser/ui/cocoa/hyperlink_button_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/hyperlink_button_cell_unittest.mm @@ -5,9 +5,9 @@ #import <Cocoa/Cocoa.h> #include "base/mac/foundation_util.h" -#include "base/memory/scoped_nsobject.h" -#import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" +#import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -15,9 +15,10 @@ class HyperlinkButtonCellTest : public CocoaTest { public: HyperlinkButtonCellTest() { NSRect frame = NSMakeRect(0, 0, 50, 30); - scoped_nsobject<NSButton> view([[NSButton alloc] initWithFrame:frame]); + base::scoped_nsobject<NSButton> view( + [[NSButton alloc] initWithFrame:frame]); view_ = view.get(); - scoped_nsobject<HyperlinkButtonCell> cell( + base::scoped_nsobject<HyperlinkButtonCell> cell( [[HyperlinkButtonCell alloc] initTextCell:@"Testing"]); cell_ = cell.get(); [view_ setCell:cell_]; @@ -47,7 +48,8 @@ TEST_VIEW(HyperlinkButtonCellTest, view_) // Tests the three designated intializers. TEST_F(HyperlinkButtonCellTest, Initializers) { TestCellCustomization(cell_); // |-initTextFrame:| - scoped_nsobject<HyperlinkButtonCell> cell([[HyperlinkButtonCell alloc] init]); + base::scoped_nsobject<HyperlinkButtonCell> cell( + [[HyperlinkButtonCell alloc] init]); TestCellCustomization(cell.get()); // Need to create a dummy archiver to test |-initWithCoder:|. diff --git a/chrome/browser/ui/cocoa/hyperlink_text_view.mm b/chrome/browser/ui/cocoa/hyperlink_text_view.mm index ea92f4c..8b05732 100644 --- a/chrome/browser/ui/cocoa/hyperlink_text_view.mm +++ b/chrome/browser/ui/cocoa/hyperlink_text_view.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" // The baseline shift for text in the NSTextView. const float kTextBaselineShift = -1.0; @@ -96,7 +96,7 @@ const float kTextBaselineShift = -1.0; forKey:NSBaselineOffsetAttributeName]; // Create the attributed string for the message. - scoped_nsobject<NSMutableAttributedString> attributedMessage( + base::scoped_nsobject<NSMutableAttributedString> attributedMessage( [[NSMutableAttributedString alloc] initWithString:message attributes:attributes]); @@ -115,9 +115,8 @@ const float kTextBaselineShift = -1.0; forKey:NSLinkAttributeName]; // Insert the link into the message at the appropriate offset. - scoped_nsobject<NSAttributedString> attributedLink( - [[NSAttributedString alloc] initWithString:link - attributes:attributes]); + base::scoped_nsobject<NSAttributedString> attributedLink( + [[NSAttributedString alloc] initWithString:link attributes:attributes]); [attributedMessage.get() insertAttributedString:attributedLink.get() atIndex:linkOffset]; // Ensure the TextView doesn't override the link style. diff --git a/chrome/browser/ui/cocoa/hyperlink_text_view_unittest.mm b/chrome/browser/ui/cocoa/hyperlink_text_view_unittest.mm index b5903b2..2faf956 100644 --- a/chrome/browser/ui/cocoa/hyperlink_text_view_unittest.mm +++ b/chrome/browser/ui/cocoa/hyperlink_text_view_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" @@ -12,7 +12,7 @@ class HyperlinkTextViewTest : public CocoaTest { public: HyperlinkTextViewTest() { NSRect frame = NSMakeRect(0, 0, 50, 50); - scoped_nsobject<HyperlinkTextView> view( + base::scoped_nsobject<HyperlinkTextView> view( [[HyperlinkTextView alloc] initWithFrame:frame]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; diff --git a/chrome/browser/ui/cocoa/image_button_cell.h b/chrome/browser/ui/cocoa/image_button_cell.h index 7f90195..4f4dc60 100644 --- a/chrome/browser/ui/cocoa/image_button_cell.h +++ b/chrome/browser/ui/cocoa/image_button_cell.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" namespace image_button_cell { @@ -39,7 +39,7 @@ enum ButtonState { struct { // At most one of these two fields will be non-null. int imageId; - scoped_nsobject<NSImage> image; + base::scoped_nsobject<NSImage> image; } image_[image_button_cell::kButtonStateCount]; BOOL isMouseInside_; } diff --git a/chrome/browser/ui/cocoa/image_button_cell_unittest.mm b/chrome/browser/ui/cocoa/image_button_cell_unittest.mm index bbe2921..84d1191 100644 --- a/chrome/browser/ui/cocoa/image_button_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/image_button_cell_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/image_button_cell.h" #include "grit/theme_resources.h" @@ -13,9 +13,10 @@ class ImageButtonCellTest : public CocoaTest { public: ImageButtonCellTest() { NSRect frame = NSMakeRect(0, 0, 50, 30); - scoped_nsobject<NSButton>view([[NSButton alloc] initWithFrame:frame]); + base::scoped_nsobject<NSButton> view( + [[NSButton alloc] initWithFrame:frame]); view_ = view.get(); - scoped_nsobject<ImageButtonCell> cell( + base::scoped_nsobject<ImageButtonCell> cell( [[ImageButtonCell alloc] initTextCell:@""]); [view_ setCell:cell.get()]; [[test_window() contentView] addSubview:view_]; diff --git a/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm b/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm index c3db086..e884072 100644 --- a/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm +++ b/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm @@ -6,7 +6,7 @@ #include "base/bind.h" #include "base/callback.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/message_loop.h" #include "chrome/browser/importer/importer_lock_dialog.h" #include "content/public/browser/user_metrics.h" @@ -20,7 +20,7 @@ namespace importer { void ShowImportLockDialog(gfx::NativeWindow parent, const base::Callback<void(bool)>& callback) { - scoped_nsobject<NSAlert> lock_alert([[NSAlert alloc] init]); + base::scoped_nsobject<NSAlert> lock_alert([[NSAlert alloc] init]); [lock_alert addButtonWithTitle:l10n_util::GetNSStringWithFixup( IDS_IMPORTER_LOCK_OK)]; [lock_alert addButtonWithTitle:l10n_util::GetNSStringWithFixup( diff --git a/chrome/browser/ui/cocoa/info_bubble_view.h b/chrome/browser/ui/cocoa/info_bubble_view.h index b7c9a76..6987eb7 100644 --- a/chrome/browser/ui/cocoa/info_bubble_view.h +++ b/chrome/browser/ui/cocoa/info_bubble_view.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" namespace info_bubble { @@ -50,7 +50,7 @@ enum BubbleAlignment { info_bubble::BubbleArrowLocation arrowLocation_; info_bubble::BubbleAlignment alignment_; info_bubble::CornerFlags cornerFlags_; - scoped_nsobject<NSColor> backgroundColor_; + base::scoped_nsobject<NSColor> backgroundColor_; } @property(assign, nonatomic) info_bubble::BubbleArrowLocation arrowLocation; diff --git a/chrome/browser/ui/cocoa/info_bubble_view.mm b/chrome/browser/ui/cocoa/info_bubble_view.mm index e5be040..33a749e 100644 --- a/chrome/browser/ui/cocoa/info_bubble_view.mm +++ b/chrome/browser/ui/cocoa/info_bubble_view.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/info_bubble_view.h" #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" @implementation InfoBubbleView diff --git a/chrome/browser/ui/cocoa/info_bubble_view_unittest.mm b/chrome/browser/ui/cocoa/info_bubble_view_unittest.mm index ff60da5..82b135a 100644 --- a/chrome/browser/ui/cocoa/info_bubble_view_unittest.mm +++ b/chrome/browser/ui/cocoa/info_bubble_view_unittest.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. -#include "base/memory/scoped_nsobject.h" -#import "chrome/browser/ui/cocoa/info_bubble_view.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" +#import "chrome/browser/ui/cocoa/info_bubble_view.h" namespace { @@ -12,7 +12,7 @@ class InfoBubbleViewTest : public CocoaTest { public: InfoBubbleViewTest() { NSRect frame = NSMakeRect(0, 0, 100, 30); - scoped_nsobject<InfoBubbleView> view( + base::scoped_nsobject<InfoBubbleView> view( [[InfoBubbleView alloc] initWithFrame:frame]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; diff --git a/chrome/browser/ui/cocoa/info_bubble_window.mm b/chrome/browser/ui/cocoa/info_bubble_window.mm index 4da277a..1cc17b8 100644 --- a/chrome/browser/ui/cocoa/info_bubble_window.mm +++ b/chrome/browser/ui/cocoa/info_bubble_window.mm @@ -6,7 +6,7 @@ #include "base/basictypes.h" #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/common/chrome_notification_types.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" @@ -123,7 +123,7 @@ class AppNotificationBridge : public content::NotificationObserver { // Notice that only the alphaValue Animation is replaced in case // superclasses set up animations. CAAnimation* alphaAnimation = [CABasicAnimation animation]; - scoped_nsobject<InfoBubbleWindowCloser> delegate( + base::scoped_nsobject<InfoBubbleWindowCloser> delegate( [[InfoBubbleWindowCloser alloc] initWithWindow:self]); [alphaAnimation setDelegate:delegate]; NSMutableDictionary* animations = diff --git a/chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.h b/chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.h index b2e10a0..df751e2 100644 --- a/chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.h +++ b/chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.h @@ -5,8 +5,8 @@ #import "chrome/browser/ui/cocoa/infobars/translate_infobar_base.h" @interface BeforeTranslateInfobarController : TranslateInfoBarControllerBase { - scoped_nsobject<NSButton> alwaysTranslateButton_; - scoped_nsobject<NSButton> neverTranslateButton_; + base::scoped_nsobject<NSButton> alwaysTranslateButton_; + base::scoped_nsobject<NSButton> neverTranslateButton_; } // Creates and initializes the alwaysTranslate and neverTranslate buttons. diff --git a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm index af29dee..2ef1404 100644 --- a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" #include "chrome/browser/infobars/confirm_infobar_delegate.h" @@ -110,8 +110,8 @@ class ConfirmInfoBarControllerTest : public CocoaProfileTest, bool delegate_closed() const { return delegate_ == NULL; } MockConfirmInfoBarDelegate* delegate_; // Owns itself. - scoped_nsobject<id> container_; - scoped_nsobject<ConfirmInfoBarController> controller_; + base::scoped_nsobject<id> container_; + base::scoped_nsobject<ConfirmInfoBarController> controller_; bool closed_delegate_ok_clicked_; bool closed_delegate_cancel_clicked_; bool closed_delegate_link_clicked_; diff --git a/chrome/browser/ui/cocoa/infobars/extension_infobar_controller.h b/chrome/browser/ui/cocoa/infobars/extension_infobar_controller.h index b028658..809aa31e 100644 --- a/chrome/browser/ui/cocoa/infobars/extension_infobar_controller.h +++ b/chrome/browser/ui/cocoa/infobars/extension_infobar_controller.h @@ -9,7 +9,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" @class ExtensionActionContextMenu; @@ -25,10 +25,10 @@ class InfobarBridge; // The InfoBar's button with the Extension's icon that launches the context // menu. - scoped_nsobject<MenuButton> dropdownButton_; + base::scoped_nsobject<MenuButton> dropdownButton_; // The context menu that pops up when the left button is clicked. - scoped_nsobject<ExtensionActionContextMenu> contextMenu_; + base::scoped_nsobject<ExtensionActionContextMenu> contextMenu_; // Helper class to bridge C++ and ObjC functionality together for the infobar. scoped_ptr<InfobarBridge> bridge_; diff --git a/chrome/browser/ui/cocoa/infobars/infobar_container_controller.h b/chrome/browser/ui/cocoa/infobars/infobar_container_controller.h index c08ea19..f645b79 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_container_controller.h +++ b/chrome/browser/ui/cocoa/infobars/infobar_container_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/view_resizer.h" #include "content/public/browser/notification_registrar.h" @@ -58,10 +58,10 @@ const CGFloat kTipHeight = 12.0; content::WebContents* currentWebContents_; // weak // Holds the InfoBarControllers currently owned by this container. - scoped_nsobject<NSMutableArray> infobarControllers_; + base::scoped_nsobject<NSMutableArray> infobarControllers_; // Holds InfoBarControllers when they are in the process of animating out. - scoped_nsobject<NSMutableSet> closingInfoBars_; + base::scoped_nsobject<NSMutableSet> closingInfoBars_; // Lets us registers for INFOBAR_ADDED/INFOBAR_REMOVED // notifications. The actual notifications are sent to the diff --git a/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm b/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm index 5251de5..88d3152 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" #include "chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h" @@ -32,7 +32,7 @@ class InfoBarContainerControllerTest : public CocoaTest { } public: - scoped_nsobject<ViewResizerPong> resizeDelegate_; + base::scoped_nsobject<ViewResizerPong> resizeDelegate_; InfoBarContainerController* controller_; }; diff --git a/chrome/browser/ui/cocoa/infobars/infobar_controller.h b/chrome/browser/ui/cocoa/infobars/infobar_controller.h index 2f8f26b..f96e7b1 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_controller.h +++ b/chrome/browser/ui/cocoa/infobars/infobar_controller.h @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" @class AnimatableView; @protocol InfoBarContainer; @@ -39,7 +39,7 @@ class InfoBarService; // text views cannot conveniently be created in IB. The xib file contains // a text field |labelPlaceholder_| that's replaced by this text view |label_| // in -awakeFromNib. - scoped_nsobject<NSTextView> label_; + base::scoped_nsobject<NSTextView> label_; }; // Initializes a new InfoBarController. diff --git a/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm b/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm index 352d7ce..51fdb17 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm @@ -4,7 +4,7 @@ #include "chrome/browser/ui/cocoa/infobars/infobar_gradient_view.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/infobars/infobar.h" #import "chrome/browser/themes/theme_properties.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h" @@ -42,7 +42,7 @@ const CGFloat kTipWidth = 23; - (void)setInfobarType:(InfoBarDelegate::Type)infobarType { SkColor topColor = GetInfoBarTopColor(infobarType); SkColor bottomColor = GetInfoBarBottomColor(infobarType); - scoped_nsobject<NSGradient> gradient([[NSGradient alloc] + base::scoped_nsobject<NSGradient> gradient([[NSGradient alloc] initWithStartingColor:gfx::SkColorToCalibratedNSColor(topColor) endingColor:gfx::SkColorToCalibratedNSColor(bottomColor)]); [self setGradient:gradient]; @@ -84,7 +84,7 @@ const CGFloat kTipWidth = 23; [infoBarPath lineToPoint:NSMakePoint(NSMaxX(bounds), NSMaxY(bounds))]; // Save off the top path of the infobar. - scoped_nsobject<NSBezierPath> topPath([infoBarPath copy]); + base::scoped_nsobject<NSBezierPath> topPath([infoBarPath copy]); [infoBarPath lineToPoint:NSMakePoint(NSMaxX(bounds), NSMinY(bounds))]; [infoBarPath lineToPoint:NSMakePoint(NSMinX(bounds), NSMinY(bounds))]; diff --git a/chrome/browser/ui/cocoa/infobars/infobar_gradient_view_unittest.mm b/chrome/browser/ui/cocoa/infobars/infobar_gradient_view_unittest.mm index da5b02b..5ef8e83 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_gradient_view_unittest.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_gradient_view_unittest.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. -#include "base/memory/scoped_nsobject.h" -#import "chrome/browser/ui/cocoa/infobars/infobar_gradient_view.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" +#import "chrome/browser/ui/cocoa/infobars/infobar_gradient_view.h" namespace { @@ -12,7 +12,7 @@ class InfoBarGradientViewTest : public CocoaTest { public: InfoBarGradientViewTest() { NSRect frame = NSMakeRect(0, 0, 100, 30); - scoped_nsobject<InfoBarGradientView> view( + base::scoped_nsobject<InfoBarGradientView> view( [[InfoBarGradientView alloc] initWithFrame:frame]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; diff --git a/chrome/browser/ui/cocoa/infobars/infobar_utilities.mm b/chrome/browser/ui/cocoa/infobars/infobar_utilities.mm index 13a09ff..c5e5e63 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_utilities.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_utilities.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/infobars/infobar_utilities.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" #import "chrome/browser/ui/cocoa/infobars/infobar_gradient_view.h" @@ -69,10 +69,10 @@ void AddMenuItem(NSMenu *menu, id target, SEL selector, NSString* title, if (tag == -1) { [menu addItem:[NSMenuItem separatorItem]]; } else { - scoped_nsobject<NSMenuItem> item([[NSMenuItem alloc] - initWithTitle:title - action:selector - keyEquivalent:@""]); + base::scoped_nsobject<NSMenuItem> item( + [[NSMenuItem alloc] initWithTitle:title + action:selector + keyEquivalent:@""]); [item setTag:tag]; [menu addItem:item]; [item setTarget:target]; diff --git a/chrome/browser/ui/cocoa/infobars/translate_infobar_base.h b/chrome/browser/ui/cocoa/infobars/translate_infobar_base.h index 31df784..d1d96ae6 100644 --- a/chrome/browser/ui/cocoa/infobars/translate_infobar_base.h +++ b/chrome/browser/ui/cocoa/infobars/translate_infobar_base.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/translate/options_menu_model.h" #include "chrome/browser/translate/translate_infobar_delegate.h" @@ -23,17 +23,17 @@ // - (bool)verifyLayout; // For testing. @interface TranslateInfoBarControllerBase : InfoBarController<NSMenuDelegate> { @protected - scoped_nsobject<NSTextField> label1_; - scoped_nsobject<NSTextField> label2_; - scoped_nsobject<NSTextField> label3_; - scoped_nsobject<NSPopUpButton> fromLanguagePopUp_; - scoped_nsobject<NSPopUpButton> toLanguagePopUp_; - scoped_nsobject<NSPopUpButton> optionsPopUp_; - scoped_nsobject<NSButton> showOriginalButton_; + base::scoped_nsobject<NSTextField> label1_; + base::scoped_nsobject<NSTextField> label2_; + base::scoped_nsobject<NSTextField> label3_; + base::scoped_nsobject<NSPopUpButton> fromLanguagePopUp_; + base::scoped_nsobject<NSPopUpButton> toLanguagePopUp_; + base::scoped_nsobject<NSPopUpButton> optionsPopUp_; + base::scoped_nsobject<NSButton> showOriginalButton_; // This is the button used in the translate message infobar. It can either be // a "Try Again" button, or a "Show Original" button in the case that the // page was translated from an unknown language. - scoped_nsobject<NSButton> translateMessageButton_; + base::scoped_nsobject<NSButton> translateMessageButton_; // In the current locale, are the "from" and "to" language popup menu // flipped from what they'd appear in English. diff --git a/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm b/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm index 70daca6..e5ae2a0 100644 --- a/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm +++ b/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #import "chrome/app/chrome_command_ids.h" // For translate menu command ids. @@ -107,7 +107,7 @@ class TranslationInfoBarTest : public CocoaProfileTest { scoped_ptr<WebContents> web_contents_; scoped_ptr<MockTranslateInfoBarDelegate> infobar_delegate_; - scoped_nsobject<TranslateInfoBarControllerBase> infobar_controller_; + base::scoped_nsobject<TranslateInfoBarControllerBase> infobar_controller_; }; // Check that we can instantiate a Translate Infobar correctly. diff --git a/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.h b/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.h index 7aa97ff..aa7153c 100644 --- a/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.h +++ b/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.h @@ -8,7 +8,7 @@ #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #if __OBJC__ @@ -37,7 +37,7 @@ class JavaScriptAppModalDialogCocoa : public NativeAppModalDialog { private: scoped_ptr<JavaScriptAppModalDialog> dialog_; - scoped_nsobject<JavaScriptAppModalDialogHelper> helper_; + base::scoped_nsobject<JavaScriptAppModalDialogHelper> helper_; NSAlert* alert_; // weak, owned by |helper_|. DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialogCocoa); diff --git a/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm b/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm index 5e8b6e3..a903723 100644 --- a/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm +++ b/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm @@ -21,7 +21,7 @@ // going away. Is responsible for cleaning itself up. @interface JavaScriptAppModalDialogHelper : NSObject<NSAlertDelegate> { @private - scoped_nsobject<NSAlert> alert_; + base::scoped_nsobject<NSAlert> alert_; NSTextField* textField_; // WEAK; owned by alert_ } @@ -208,13 +208,13 @@ JavaScriptAppModalDialogCocoa::JavaScriptAppModalDialogCocoa( } if (message_has_rtl && message_text_field) { - scoped_nsobject<NSMutableParagraphStyle> alignment( + base::scoped_nsobject<NSMutableParagraphStyle> alignment( [[NSParagraphStyle defaultParagraphStyle] mutableCopy]); [alignment setAlignment:NSRightTextAlignment]; NSDictionary* alignment_attributes = @{ NSParagraphStyleAttributeName : alignment }; - scoped_nsobject<NSAttributedString> attr_string( + base::scoped_nsobject<NSAttributedString> attr_string( [[NSAttributedString alloc] initWithString:message_text attributes:alignment_attributes]); @@ -225,7 +225,7 @@ JavaScriptAppModalDialogCocoa::JavaScriptAppModalDialogCocoa( if (informative_has_rtl && informative_text_field) { base::i18n::TextDirection direction = base::i18n::GetFirstStrongCharacterDirection(dialog_->message_text()); - scoped_nsobject<NSMutableParagraphStyle> alignment( + base::scoped_nsobject<NSMutableParagraphStyle> alignment( [[NSParagraphStyle defaultParagraphStyle] mutableCopy]); [alignment setAlignment: (direction == base::i18n::RIGHT_TO_LEFT) ? NSRightTextAlignment @@ -233,7 +233,7 @@ JavaScriptAppModalDialogCocoa::JavaScriptAppModalDialogCocoa( NSDictionary* alignment_attributes = @{ NSParagraphStyleAttributeName : alignment }; - scoped_nsobject<NSAttributedString> attr_string( + base::scoped_nsobject<NSAttributedString> attr_string( [[NSAttributedString alloc] initWithString:informative_text attributes:alignment_attributes]); diff --git a/chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.h b/chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.h index c24c8de..f0a38ac 100644 --- a/chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.h +++ b/chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/base_bubble_controller.h" #import "ui/base/cocoa/tracking_area.h" @@ -25,7 +25,7 @@ class Profile; scoped_ptr<ActionBoxMenuModel> model_; // Array of the below view controllers. - scoped_nsobject<NSMutableArray> items_; + base::scoped_nsobject<NSMutableArray> items_; } // Designated initializer. |point| must be in screen coordinates. diff --git a/chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.mm b/chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.mm index 5c0862e..d65dc50 100644 --- a/chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.mm @@ -100,7 +100,7 @@ class ExtensionIconLoaderBridge : public extensions::IconImage::Observer { // Use an arbitrary height because it will reflect the size of the content. NSRect contentRect = NSMakeRect(0, 0, kBubbleMinWidth, 150); // Create an empty window into which content is placed. - scoped_nsobject<InfoBubbleWindow> window( + base::scoped_nsobject<InfoBubbleWindow> window( [[InfoBubbleWindow alloc] initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered @@ -160,7 +160,7 @@ class ExtensionIconLoaderBridge : public extensions::IconImage::Observer { CGFloat yOffset = kVerticalPadding; // Keep track of a potential separator to resize it when we know the width. - scoped_nsobject<NSBox> separatorView; + base::scoped_nsobject<NSBox> separatorView; // Loop over the items in reverse, constructing the menu items. CGFloat width = kBubbleMinWidth; @@ -183,11 +183,10 @@ class ExtensionIconLoaderBridge : public extensions::IconImage::Observer { } else { // Create the item controller. Autorelease it because it will be owned // by the |items_| array. - scoped_nsobject<ActionBoxMenuItemController> itemController( - [[ActionBoxMenuItemController alloc] - initWithModelIndex:i - menuController:self - profile:profile_]); + base::scoped_nsobject<ActionBoxMenuItemController> itemController( + [[ActionBoxMenuItemController alloc] initWithModelIndex:i + menuController:self + profile:profile_]); // Adjust the name field to fit the string. [GTMUILocalizerAndLayoutTweaker sizeToFitView:[itemController nameField]]; diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h index a54e788..eadb217 100644 --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/styled_text_field.h" #import "chrome/browser/ui/cocoa/url_drop_target.h" @@ -113,18 +113,18 @@ class AutocompleteTextFieldObserver { @private // Undo manager for this text field. We use a specific instance rather than // the standard undo manager in order to let us clear the undo stack at will. - scoped_nsobject<NSUndoManager> undoManager_; + base::scoped_nsobject<NSUndoManager> undoManager_; AutocompleteTextFieldObserver* observer_; // weak, owned by location bar. // Handles being a drag-and-drop target. - scoped_nsobject<URLDropTargetHandler> dropHandler_; + base::scoped_nsobject<URLDropTargetHandler> dropHandler_; // Holds current tooltip strings, to keep them from being dealloced. - scoped_nsobject<NSMutableArray> currentToolTips_; + base::scoped_nsobject<NSMutableArray> currentToolTips_; - scoped_nsobject<NSString> suggestText_; - scoped_nsobject<NSColor> suggestColor_; + base::scoped_nsobject<NSString> suggestText_; + base::scoped_nsobject<NSColor> suggestColor_; } @property(nonatomic) AutocompleteTextFieldObserver* observer; diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm index fcdd149..addda9c 100644 --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm @@ -449,13 +449,13 @@ void DrawInstantSuggestion(NSAttributedString* mainText, if (![suggestText length]) return; - scoped_nsobject<NSTextFieldCell> cell( + base::scoped_nsobject<NSTextFieldCell> cell( [[NSTextFieldCell alloc] initTextCell:@""]); [cell setBordered:NO]; [cell setDrawsBackground:NO]; [cell setEditable:NO]; - scoped_nsobject<NSMutableAttributedString> combinedText( + base::scoped_nsobject<NSMutableAttributedString> combinedText( [[NSMutableAttributedString alloc] initWithAttributedString:mainText]); NSRange range = NSMakeRange([combinedText length], 0); [combinedText replaceCharactersInRange:range withString:suggestText]; diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm index 32d9cdb..d91b249 100644 --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm @@ -547,7 +547,7 @@ size_t CalculatePositionsInFrame( } NSDictionary* info = [self getDictionaryForButtonDecoration:button]; - scoped_nsobject<CrTrackingArea> area( + base::scoped_nsobject<CrTrackingArea> area( [[CrTrackingArea alloc] initWithRect:decorationFrames[i] options:NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm index 3af9e75..def7ede 100644 --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/utf_string_conversions.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h" @@ -19,8 +19,8 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" -#include "third_party/ocmock/gtest_support.h" #import "third_party/ocmock/OCMock/OCMock.h" +#include "third_party/ocmock/gtest_support.h" #include "ui/base/resource/resource_bundle.h" using ::testing::Return; @@ -51,11 +51,11 @@ class AutocompleteTextFieldCellTest : public CocoaTest { // decorations. const NSRect frame = NSMakeRect(0, 0, kWidth, 30); - scoped_nsobject<NSTextField> view( + base::scoped_nsobject<NSTextField> view( [[NSTextField alloc] initWithFrame:frame]); view_ = view.get(); - scoped_nsobject<AutocompleteTextFieldCell> cell( + base::scoped_nsobject<AutocompleteTextFieldCell> cell( [[AutocompleteTextFieldCell alloc] initTextCell:@"Testing"]); [cell setEditable:YES]; [cell setBordered:YES]; diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h index 1943ae8..cf2c5b3 100644 --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/url_drop_target.h" @class AutocompleteTextField; @@ -23,9 +23,9 @@ class AutocompleteTextFieldObserver; // allowing the |AutocompletTextField| to handle it (by making an empty // |-updateDragTypeRegistration|), since the latter results in a weird // start-up time regression. - scoped_nsobject<URLDropTargetHandler> dropHandler_; + base::scoped_nsobject<URLDropTargetHandler> dropHandler_; - scoped_nsobject<NSCharacterSet> forbiddenCharacters_; + base::scoped_nsobject<NSCharacterSet> forbiddenCharacters_; // Indicates if the field editor's interpretKeyEvents: method is being called. // If it's YES, then we should postpone the call to the observer's diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm index 548f6e2..dac079a 100644 --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string_util.h" #include "chrome/app/chrome_command_ids.h" // IDC_* @@ -15,8 +15,8 @@ #include "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #include "testing/platform_test.h" -#include "third_party/ocmock/gtest_support.h" #import "third_party/ocmock/OCMock/OCMock.h" +#include "third_party/ocmock/gtest_support.h" #import "third_party/ocmock/ocmock_extensions.h" #import "ui/base/test/cocoa_test_event_utils.h" @@ -35,7 +35,7 @@ class AutocompleteTextFieldEditorTest : public CocoaTest { virtual void SetUp() { CocoaTest::SetUp(); NSRect frame = NSMakeRect(0, 0, 50, 30); - scoped_nsobject<AutocompleteTextField> field( + base::scoped_nsobject<AutocompleteTextField> field( [[AutocompleteTextField alloc] initWithFrame:frame]); field_ = field.get(); [field_ setStringValue:@"Testing"]; @@ -56,7 +56,8 @@ class AutocompleteTextFieldEditorTest : public CocoaTest { AutocompleteTextFieldEditor* editor_; AutocompleteTextField* field_; - scoped_nsobject<AutocompleteTextFieldWindowTestDelegate> window_delegate_; + base::scoped_nsobject<AutocompleteTextFieldWindowTestDelegate> + window_delegate_; }; // Disabled because it crashes sometimes. http://crbug.com/49522 @@ -107,7 +108,7 @@ TEST_F(AutocompleteTextFieldEditorTest, PageActionMenus) { // Trivial menu which we can recognize and which doesn't look like // the default editor context menu. - scoped_nsobject<id> menu([[NSMenu alloc] initWithTitle:@"Menu"]); + base::scoped_nsobject<id> menu([[NSMenu alloc] initWithTitle:@"Menu"]); [menu addItemWithTitle:@"Go Fish" action:@selector(goFish:) keyEquivalent:@""]; diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest.mm index 63a4d85..72ffc7a 100644 --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest.mm +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest.mm @@ -5,13 +5,13 @@ #import <Cocoa/Cocoa.h> #include "base/mac/foundation_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" +#import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h" #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h" #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h" #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest_helper.h" #import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h" -#import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "grit/theme_resources.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -75,7 +75,7 @@ class AutocompleteTextFieldTest : public CocoaTest { // Make sure this is wide enough to play games with the cell // decorations. NSRect frame = NSMakeRect(0, 0, kWidth, 30); - scoped_nsobject<AutocompleteTextField> field( + base::scoped_nsobject<AutocompleteTextField> field( [[AutocompleteTextField alloc] initWithFrame:frame]); field_ = field.get(); [field_ setStringValue:@"Test test"]; @@ -129,7 +129,8 @@ class AutocompleteTextFieldTest : public CocoaTest { AutocompleteTextField* field_; MockDecoration mock_left_decoration_; MockDecoration mock_right_decoration_; - scoped_nsobject<AutocompleteTextFieldWindowTestDelegate> window_delegate_; + base::scoped_nsobject<AutocompleteTextFieldWindowTestDelegate> + window_delegate_; }; TEST_VIEW(AutocompleteTextFieldTest, field_); @@ -622,9 +623,9 @@ TEST_F(AutocompleteTextFieldTest, DecorationMenu) { const CGFloat edge = NSHeight(bounds) - 4.0; const NSSize size = NSMakeSize(edge, edge); - scoped_nsobject<NSImage> image([[NSImage alloc] initWithSize:size]); + base::scoped_nsobject<NSImage> image([[NSImage alloc] initWithSize:size]); - scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@"Menu"]); + base::scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@"Menu"]); mock_left_decoration_.SetVisible(true); mock_right_decoration_.SetVisible(true); @@ -674,7 +675,7 @@ TEST_F(AutocompleteTextFieldTest, SetAttributedStringBaseline) { [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName]; NSString* const kString = @"This is a test"; - scoped_nsobject<NSAttributedString> attributedString( + base::scoped_nsobject<NSAttributedString> attributedString( [[NSAttributedString alloc] initWithString:kString attributes:attributes]); @@ -707,7 +708,7 @@ TEST_F(AutocompleteTextFieldTest, SetAttributedStringUndo) { [NSDictionary dictionaryWithObject:redColor forKey:NSForegroundColorAttributeName]; NSString* const kString = @"This is a test"; - scoped_nsobject<NSAttributedString> attributedString( + base::scoped_nsobject<NSAttributedString> attributedString( [[NSAttributedString alloc] initWithString:kString attributes:attributes]); [test_window() makePretendKeyWindowAndSetFirstResponder:field_]; @@ -816,7 +817,7 @@ TEST_F(AutocompleteTextFieldObserverTest, ClosePopupOnResignKey) { EXPECT_CALL(field_observer_, ClosePopup()); [test_window() resignKeyWindow]; - scoped_nsobject<AutocompleteTextField> pin([field_ retain]); + base::scoped_nsobject<AutocompleteTextField> pin([field_ retain]); [field_ removeFromSuperview]; [test_window() resignKeyWindow]; diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest_helper.h b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest_helper.h index cd8116a..3ba6511 100644 --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest_helper.h +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest_helper.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h" #include "testing/gmock/include/gmock/gmock.h" @@ -17,7 +17,7 @@ @interface AutocompleteTextFieldWindowTestDelegate : NSObject<NSWindowDelegate> { - scoped_nsobject<AutocompleteTextFieldEditor> editor_; + base::scoped_nsobject<AutocompleteTextFieldEditor> editor_; } - (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)anObject; @end diff --git a/chrome/browser/ui/cocoa/location_bar/bubble_decoration.h b/chrome/browser/ui/cocoa/location_bar/bubble_decoration.h index a1e55f5..6a1d1cc 100644 --- a/chrome/browser/ui/cocoa/location_bar/bubble_decoration.h +++ b/chrome/browser/ui/cocoa/location_bar/bubble_decoration.h @@ -8,7 +8,7 @@ #import <Cocoa/Cocoa.h> #include "base/gtest_prod_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h" // Draws an outlined rounded rect, with an optional image to the left @@ -46,18 +46,18 @@ class BubbleDecoration : public LocationBarDecoration { UsesPartialKeywordIfNarrow); // Image drawn in the left side of the bubble. - scoped_nsobject<NSImage> image_; + base::scoped_nsobject<NSImage> image_; // Label to draw to right of image. Can be |nil|. - scoped_nsobject<NSString> label_; + base::scoped_nsobject<NSString> label_; // Contains attribute for drawing |label_|. - scoped_nsobject<NSMutableDictionary> attributes_; + base::scoped_nsobject<NSMutableDictionary> attributes_; // Colors used to draw the bubble, should be set by the subclass // constructor. - scoped_nsobject<NSColor> background_color_; - scoped_nsobject<NSColor> border_color_; + base::scoped_nsobject<NSColor> background_color_; + base::scoped_nsobject<NSColor> border_color_; DISALLOW_COPY_AND_ASSIGN(BubbleDecoration); }; diff --git a/chrome/browser/ui/cocoa/location_bar/button_decoration.h b/chrome/browser/ui/cocoa/location_bar/button_decoration.h index 70d4708..fde8f94 100644 --- a/chrome/browser/ui/cocoa/location_bar/button_decoration.h +++ b/chrome/browser/ui/cocoa/location_bar/button_decoration.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUTTON_DECORATION_H_ #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUTTON_DECORATION_H_ -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h" // |LocationBarDecoration| which looks and acts like a button. @@ -42,9 +42,9 @@ class ButtonDecoration : public LocationBarDecoration { void SetPressedImage(NSImage* pressed_image); private: - scoped_nsobject<NSImage> normal_image_; - scoped_nsobject<NSImage> hover_image_; - scoped_nsobject<NSImage> pressed_image_; + base::scoped_nsobject<NSImage> normal_image_; + base::scoped_nsobject<NSImage> hover_image_; + base::scoped_nsobject<NSImage> pressed_image_; ButtonState state_; NSImage* GetImage(); diff --git a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.h b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.h index 219992e..dafcd11 100644 --- a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.h +++ b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.h @@ -52,7 +52,7 @@ class ContentSettingDecoration : public ImageDecoration { void SetToolTip(NSString* tooltip); // Returns an attributed string with the animated text. - scoped_nsobject<NSAttributedString> CreateAnimatedText(); + base::scoped_nsobject<NSAttributedString> CreateAnimatedText(); // Measure the width of the animated text. CGFloat MeasureTextWidth(); @@ -62,13 +62,13 @@ class ContentSettingDecoration : public ImageDecoration { LocationBarViewMac* owner_; // weak Profile* profile_; // weak - scoped_nsobject<NSString> tooltip_; + base::scoped_nsobject<NSString> tooltip_; // Used when the decoration has animated text. - scoped_nsobject<ContentSettingAnimationState> animation_; + base::scoped_nsobject<ContentSettingAnimationState> animation_; CGFloat text_width_; - scoped_nsobject<NSAttributedString> animated_text_; - scoped_nsobject<NSGradient> gradient_; + base::scoped_nsobject<NSAttributedString> animated_text_; + base::scoped_nsobject<NSGradient> gradient_; DISALLOW_COPY_AND_ASSIGN(ContentSettingDecoration); }; diff --git a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm index 79c33f1..174f5bf 100644 --- a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm +++ b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm @@ -228,19 +228,19 @@ CGFloat ContentSettingDecoration::MeasureTextWidth() { return [animated_text_ size].width; } -scoped_nsobject<NSAttributedString> +base::scoped_nsobject<NSAttributedString> ContentSettingDecoration::CreateAnimatedText() { NSString* text = l10n_util::GetNSString( content_setting_image_model_->explanatory_string_id()); - scoped_nsobject<NSMutableParagraphStyle> style( + base::scoped_nsobject<NSMutableParagraphStyle> style( [[NSMutableParagraphStyle alloc] init]); // Set line break mode to clip the text, otherwise drawInRect: won't draw a // word if it doesn't fit in the bounding box. [style setLineBreakMode:NSLineBreakByClipping]; NSDictionary* attributes = @{ NSFontAttributeName : GetFont(), NSParagraphStyleAttributeName : style }; - return scoped_nsobject<NSAttributedString>( + return base::scoped_nsobject<NSAttributedString>( [[NSAttributedString alloc] initWithString:text attributes:attributes]); } diff --git a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.h b/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.h index ee7d99f..b17e7d8 100644 --- a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.h +++ b/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.h @@ -44,7 +44,7 @@ class EVBubbleDecoration : public BubbleDecoration { private: // The real label. BubbleDecoration's label may be elided. - scoped_nsobject<NSString> full_label_; + base::scoped_nsobject<NSString> full_label_; LocationIconDecoration* location_icon_; // weak, owned by location bar. diff --git a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration_unittest.mm b/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration_unittest.mm index f07cfb2..e898e20 100644 --- a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration_unittest.mm +++ b/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration_unittest.mm @@ -28,7 +28,8 @@ TEST_F(EVBubbleDecorationTest, MiddleElide) { const CGFloat kMinimumWidth = 100.0; // Never should get this small. const NSSize kImageSize = NSMakeSize(20.0, 20.0); - scoped_nsobject<NSImage> image([[NSImage alloc] initWithSize:kImageSize]); + base::scoped_nsobject<NSImage> image( + [[NSImage alloc] initWithSize:kImageSize]); decoration_.SetImage(image); decoration_.SetFullLabel(kLongString); diff --git a/chrome/browser/ui/cocoa/location_bar/image_decoration.h b/chrome/browser/ui/cocoa/location_bar/image_decoration.h index 6b105ab..0bb4193 100644 --- a/chrome/browser/ui/cocoa/location_bar/image_decoration.h +++ b/chrome/browser/ui/cocoa/location_bar/image_decoration.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_IMAGE_DECORATION_H_ #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_IMAGE_DECORATION_H_ -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h" // |LocationBarDecoration| which sizes and draws itself according to @@ -27,7 +27,7 @@ class ImageDecoration : public LocationBarDecoration { virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE; private: - scoped_nsobject<NSImage> image_; + base::scoped_nsobject<NSImage> image_; DISALLOW_COPY_AND_ASSIGN(ImageDecoration); }; diff --git a/chrome/browser/ui/cocoa/location_bar/image_decoration_unittest.mm b/chrome/browser/ui/cocoa/location_bar/image_decoration_unittest.mm index db69b0d..2362f79 100644 --- a/chrome/browser/ui/cocoa/location_bar/image_decoration_unittest.mm +++ b/chrome/browser/ui/cocoa/location_bar/image_decoration_unittest.mm @@ -20,7 +20,8 @@ TEST_F(ImageDecorationTest, SetGetImage) { EXPECT_FALSE(decoration_.GetImage()); const NSSize kImageSize = NSMakeSize(20.0, 20.0); - scoped_nsobject<NSImage> image([[NSImage alloc] initWithSize:kImageSize]); + base::scoped_nsobject<NSImage> image( + [[NSImage alloc] initWithSize:kImageSize]); decoration_.SetImage(image); EXPECT_EQ(decoration_.GetImage(), image); @@ -38,7 +39,8 @@ TEST_F(ImageDecorationTest, GetWidthForSpace) { LocationBarDecoration::kOmittedWidth); const NSSize kImageSize = NSMakeSize(20.0, 20.0); - scoped_nsobject<NSImage> image([[NSImage alloc] initWithSize:kImageSize]); + base::scoped_nsobject<NSImage> image( + [[NSImage alloc] initWithSize:kImageSize]); // Decoration takes up the space of the image. decoration_.SetImage(image); diff --git a/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h b/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h index 7a0e57e..cd218e8 100644 --- a/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h +++ b/chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h @@ -9,7 +9,7 @@ #import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" // Draws the keyword hint, "Press [tab] to search <site>". @@ -32,14 +32,14 @@ class KeywordHintDecoration : public LocationBarDecoration { NSImage* GetHintImage(); // Attributes for drawing the hint string, such as font and color. - scoped_nsobject<NSDictionary> attributes_; + base::scoped_nsobject<NSDictionary> attributes_; // Cache for the [tab] image. - scoped_nsobject<NSImage> hint_image_; + base::scoped_nsobject<NSImage> hint_image_; // The text to display to the left and right of the hint image. - scoped_nsobject<NSString> hint_prefix_; - scoped_nsobject<NSString> hint_suffix_; + base::scoped_nsobject<NSString> hint_prefix_; + base::scoped_nsobject<NSString> hint_suffix_; DISALLOW_COPY_AND_ASSIGN(KeywordHintDecoration); }; diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm index 37cbb84..13ff083 100644 --- a/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h" #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" const CGFloat LocationBarDecoration::kOmittedWidth = 0.0; @@ -75,7 +75,7 @@ NSFont* LocationBarDecoration::GetFont() const { void LocationBarDecoration::DrawLabel(NSString* label, NSDictionary* attributes, const NSRect& frame) { - scoped_nsobject<NSAttributedString> str( + base::scoped_nsobject<NSAttributedString> str( [[NSAttributedString alloc] initWithString:label attributes:attributes]); DrawAttributedString(str, frame); } diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h index 7b07555..7bb35d1 100644 --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h @@ -9,7 +9,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" diff --git a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.h b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.h index 99dfba9..74f56cc 100644 --- a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.h +++ b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.h @@ -104,10 +104,10 @@ class PageActionDecoration : public ImageDecoration, GURL current_url_; // The string to show for a tooltip. - scoped_nsobject<NSString> tooltip_; + base::scoped_nsobject<NSString> tooltip_; // The context menu for the Page Action. - scoped_nsobject<ExtensionActionContextMenu> menu_; + base::scoped_nsobject<ExtensionActionContextMenu> menu_; // This is used for post-install visual feedback. The page_action // icon is briefly shown even if it hasn't been enabled by its diff --git a/chrome/browser/ui/cocoa/location_bar/plus_decoration.h b/chrome/browser/ui/cocoa/location_bar/plus_decoration.h index e318c70..64bcf70 100644 --- a/chrome/browser/ui/cocoa/location_bar/plus_decoration.h +++ b/chrome/browser/ui/cocoa/location_bar/plus_decoration.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/cocoa/location_bar/button_decoration.h" #include "chrome/browser/ui/toolbar/action_box_button_controller.h" @@ -54,7 +54,7 @@ class PlusDecoration : public ButtonDecoration, void SetIcons(int normal_id, int hover_id, int pressed_id); - scoped_nsobject<ActionBoxMenuBubbleController> menu_controller_; + base::scoped_nsobject<ActionBoxMenuBubbleController> menu_controller_; DISALLOW_COPY_AND_ASSIGN(PlusDecoration); }; diff --git a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h index bdd9e6f..000245c 100644 --- a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h +++ b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h @@ -33,9 +33,9 @@ class SelectedKeywordDecoration : public BubbleDecoration { FRIEND_TEST_ALL_PREFIXES(SelectedKeywordDecorationTest, UsesPartialKeywordIfNarrow); - scoped_nsobject<NSImage> search_image_; - scoped_nsobject<NSString> full_string_; - scoped_nsobject<NSString> partial_string_; + base::scoped_nsobject<NSImage> search_image_; + base::scoped_nsobject<NSString> full_string_; + base::scoped_nsobject<NSString> partial_string_; DISALLOW_COPY_AND_ASSIGN(SelectedKeywordDecoration); }; diff --git a/chrome/browser/ui/cocoa/location_bar/star_decoration.h b/chrome/browser/ui/cocoa/location_bar/star_decoration.h index 6ec7d0d..691f52e 100644 --- a/chrome/browser/ui/cocoa/location_bar/star_decoration.h +++ b/chrome/browser/ui/cocoa/location_bar/star_decoration.h @@ -38,7 +38,7 @@ class StarDecoration : public ImageDecoration { CommandUpdater* command_updater_; // Weak, owned by Browser. // The string to show for a tooltip. - scoped_nsobject<NSString> tooltip_; + base::scoped_nsobject<NSString> tooltip_; // Whether the star icon is lit. bool starred_; diff --git a/chrome/browser/ui/cocoa/location_bar/zoom_decoration.h b/chrome/browser/ui/cocoa/location_bar/zoom_decoration.h index 7819a18..ffc1994 100644 --- a/chrome/browser/ui/cocoa/location_bar/zoom_decoration.h +++ b/chrome/browser/ui/cocoa/location_bar/zoom_decoration.h @@ -50,7 +50,7 @@ class ZoomDecoration : public ImageDecoration { ZoomBubbleController* bubble_; // The string to show for a tooltip. - scoped_nsobject<NSString> tooltip_; + base::scoped_nsobject<NSString> tooltip_; DISALLOW_COPY_AND_ASSIGN(ZoomDecoration); }; diff --git a/chrome/browser/ui/cocoa/login_prompt_cocoa.mm b/chrome/browser/ui/cocoa/login_prompt_cocoa.mm index fba3c01..dc3b678 100644 --- a/chrome/browser/ui/cocoa/login_prompt_cocoa.mm +++ b/chrome/browser/ui/cocoa/login_prompt_cocoa.mm @@ -6,7 +6,7 @@ #include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" @@ -73,7 +73,7 @@ class LoginHandlerMac : public LoginHandler, WebContents* requesting_contents = GetWebContentsForLogin(); DCHECK(requesting_contents); - scoped_nsobject<CustomConstrainedWindowSheet> sheet( + base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:[sheet_controller_ window]]); constrained_window_.reset(new ConstrainedWindowMac( @@ -121,7 +121,7 @@ class LoginHandlerMac : public LoginHandler, } // The Cocoa controller of the GUI. - scoped_nsobject<LoginHandlerSheet> sheet_controller_; + base::scoped_nsobject<LoginHandlerSheet> sheet_controller_; scoped_ptr<ConstrainedWindowMac> constrained_window_; diff --git a/chrome/browser/ui/cocoa/menu_button.h b/chrome/browser/ui/cocoa/menu_button.h index b2de8de..d0ffb58 100644 --- a/chrome/browser/ui/cocoa/menu_button.h +++ b/chrome/browser/ui/cocoa/menu_button.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/toolbar/toolbar_button.h" // This a button which displays a user-provided menu "attached" below it upon @@ -24,10 +24,10 @@ // value is NO so that custom actions can be hooked up in Interface Builder. @interface MenuButton : ToolbarButton { @private - scoped_nsobject<NSMenu> attachedMenu_; + base::scoped_nsobject<NSMenu> attachedMenu_; BOOL openMenuOnClick_; BOOL openMenuOnRightClick_; - scoped_nsobject<NSPopUpButtonCell> popUpCell_; + base::scoped_nsobject<NSPopUpButtonCell> popUpCell_; } // The menu to display. Note that it should have no (i.e., a blank) title and diff --git a/chrome/browser/ui/cocoa/menu_button.mm b/chrome/browser/ui/cocoa/menu_button.mm index 8cc0812..d063974 100644 --- a/chrome/browser/ui/cocoa/menu_button.mm +++ b/chrome/browser/ui/cocoa/menu_button.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/menu_button.h" #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/clickhold_button_cell.h" #import "chrome/browser/ui/cocoa/nsview_additions.h" diff --git a/chrome/browser/ui/cocoa/menu_button_unittest.mm b/chrome/browser/ui/cocoa/menu_button_unittest.mm index 543208f..95b00dc 100644 --- a/chrome/browser/ui/cocoa/menu_button_unittest.mm +++ b/chrome/browser/ui/cocoa/menu_button_unittest.mm @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/clickhold_button_cell.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/menu_button.h" @interface MenuButtonTestDelegate : NSObject<NSMenuDelegate> { @private - scoped_nsobject<NSMenu> menu_; + base::scoped_nsobject<NSMenu> menu_; BOOL open_; BOOL didOpen_; } @@ -60,10 +60,10 @@ class MenuButtonTest : public CocoaTest { public: MenuButtonTest() { NSRect frame = NSMakeRect(0, 0, 50, 30); - scoped_nsobject<MenuButton> button( + base::scoped_nsobject<MenuButton> button( [[MenuButton alloc] initWithFrame:frame]); button_ = button.get(); - scoped_nsobject<ClickHoldButtonCell> cell( + base::scoped_nsobject<ClickHoldButtonCell> cell( [[ClickHoldButtonCell alloc] initTextCell:@"Testing"]); [button_ setCell:cell.get()]; [[test_window() contentView] addSubview:button_]; @@ -102,7 +102,7 @@ TEST_VIEW(MenuButtonTest, button_); // Test assigning a menu, again mostly to ensure nothing leaks or crashes. TEST_F(MenuButtonTest, MenuAssign) { - scoped_nsobject<NSMenu> menu(CreateMenu()); + base::scoped_nsobject<NSMenu> menu(CreateMenu()); ASSERT_TRUE(menu.get()); [button_ setAttachedMenu:menu]; @@ -110,10 +110,10 @@ TEST_F(MenuButtonTest, MenuAssign) { } TEST_F(MenuButtonTest, OpenOnClick) { - scoped_nsobject<NSMenu> menu(CreateMenu()); + base::scoped_nsobject<NSMenu> menu(CreateMenu()); ASSERT_TRUE(menu.get()); - scoped_nsobject<MenuButtonTestDelegate> delegate( + base::scoped_nsobject<MenuButtonTestDelegate> delegate( [[MenuButtonTestDelegate alloc] initWithMenu:menu.get()]); ASSERT_TRUE(delegate.get()); @@ -132,10 +132,10 @@ TEST_F(MenuButtonTest, OpenOnClick) { } TEST_F(MenuButtonTest, OpenOnRightClick) { - scoped_nsobject<NSMenu> menu(CreateMenu()); + base::scoped_nsobject<NSMenu> menu(CreateMenu()); ASSERT_TRUE(menu.get()); - scoped_nsobject<MenuButtonTestDelegate> delegate( + base::scoped_nsobject<MenuButtonTestDelegate> delegate( [[MenuButtonTestDelegate alloc] initWithMenu:menu.get()]); ASSERT_TRUE(delegate.get()); @@ -157,10 +157,10 @@ TEST_F(MenuButtonTest, OpenOnRightClick) { } TEST_F(MenuButtonTest, DontOpenOnRightClickWithoutSetRightClick) { - scoped_nsobject<NSMenu> menu(CreateMenu()); + base::scoped_nsobject<NSMenu> menu(CreateMenu()); ASSERT_TRUE(menu.get()); - scoped_nsobject<MenuButtonTestDelegate> delegate( + base::scoped_nsobject<MenuButtonTestDelegate> delegate( [[MenuButtonTestDelegate alloc] initWithMenu:menu.get()]); ASSERT_TRUE(delegate.get()); diff --git a/chrome/browser/ui/cocoa/notifications/balloon_controller.h b/chrome/browser/ui/cocoa/notifications/balloon_controller.h index c63caed..7c9c00a 100644 --- a/chrome/browser/ui/cocoa/notifications/balloon_controller.h +++ b/chrome/browser/ui/cocoa/notifications/balloon_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" class Balloon; @@ -46,7 +46,7 @@ class NotificationOptionsMenuModel; // The options menu that appears when "options" is pressed. IBOutlet HoverImageButton* optionsButton_; scoped_ptr<NotificationOptionsMenuModel> menuModel_; - scoped_nsobject<MenuController> menuController_; + base::scoped_nsobject<MenuController> menuController_; // The host for the renderer of the HTML contents. scoped_ptr<BalloonViewHost> htmlContents_; diff --git a/chrome/browser/ui/cocoa/notifications/balloon_controller.mm b/chrome/browser/ui/cocoa/notifications/balloon_controller.mm index 4ee0669..528d2f4 100644 --- a/chrome/browser/ui/cocoa/notifications/balloon_controller.mm +++ b/chrome/browser/ui/cocoa/notifications/balloon_controller.mm @@ -6,7 +6,7 @@ #include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/notifications/balloon.h" #include "chrome/browser/notifications/desktop_notification_service.h" diff --git a/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm b/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm index 854e39a..10902b5 100644 --- a/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/notifications/balloon_controller_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/notifications/balloon.h" #include "chrome/browser/notifications/balloon_collection.h" diff --git a/chrome/browser/ui/cocoa/notifications/balloon_view.mm b/chrome/browser/ui/cocoa/notifications/balloon_view.mm index eeac6fa..cb7911e 100644 --- a/chrome/browser/ui/cocoa/notifications/balloon_view.mm +++ b/chrome/browser/ui/cocoa/notifications/balloon_view.mm @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> #include "base/basictypes.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/notifications/balloon_controller.h" #import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" diff --git a/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.h b/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.h index f8ca7b3..d78a910 100644 --- a/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.h +++ b/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.h @@ -8,7 +8,7 @@ #import <AppKit/AppKit.h> #include "base/basictypes.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "ui/message_center/message_center_tray_delegate.h" @@ -59,13 +59,13 @@ class MessageCenterTrayBridge : scoped_ptr<message_center::MessageCenterTray> tray_; // Obj-C window controller for the notification tray. - scoped_nsobject<MCTrayController> tray_controller_; + base::scoped_nsobject<MCTrayController> tray_controller_; // View that is displayed on the system menu bar item. - scoped_nsobject<MCStatusItemView> status_item_view_; + base::scoped_nsobject<MCStatusItemView> status_item_view_; // Obj-C controller for the on-screen popup notifications. - scoped_nsobject<MCPopupCollection> popup_collection_; + base::scoped_nsobject<MCPopupCollection> popup_collection_; // Weak pointer factory to posts tasks to self. base::WeakPtrFactory<MessageCenterTrayBridge> weak_ptr_factory_; diff --git a/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge_unittest.mm b/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge_unittest.mm index 2203913..c4c3dff 100644 --- a/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge_unittest.mm +++ b/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge_unittest.mm @@ -4,14 +4,14 @@ #import "chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/message_loop.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" +#import "ui/base/test/ui_cocoa_test_helper.h" #import "ui/message_center/cocoa/status_item_view.h" #include "ui/message_center/message_center.h" #include "ui/message_center/notification.h" -#import "ui/base/test/ui_cocoa_test_helper.h" class MessageCenterTrayBridgeTest : public ui::CocoaTest { public: diff --git a/chrome/browser/ui/cocoa/nsmenuitem_additions_unittest.mm b/chrome/browser/ui/cocoa/nsmenuitem_additions_unittest.mm index 90185bb..33ed98c 100644 --- a/chrome/browser/ui/cocoa/nsmenuitem_additions_unittest.mm +++ b/chrome/browser/ui/cocoa/nsmenuitem_additions_unittest.mm @@ -8,7 +8,7 @@ #include <ostream> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" @@ -56,7 +56,7 @@ void ExpectKeyFiresItemEq(bool result, NSEvent* key, NSMenuItem* item, // key equivalent, even though the original event would) and isn't a good // oracle function. if (compareCocoa) { - scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@"Menu!"]); + base::scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@"Menu!"]); [menu setAutoenablesItems:NO]; EXPECT_FALSE([menu performKeyEquivalent:key]); [menu addItem:item]; diff --git a/chrome/browser/ui/cocoa/nsview_additions_unittest.mm b/chrome/browser/ui/cocoa/nsview_additions_unittest.mm index ffb7e0f..a9b7468 100644 --- a/chrome/browser/ui/cocoa/nsview_additions_unittest.mm +++ b/chrome/browser/ui/cocoa/nsview_additions_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/nsview_additions.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" @@ -38,9 +38,12 @@ typedef CocoaTest NSViewChromeAdditionsTest; @end TEST_F(NSViewChromeAdditionsTest, BelowAboveView) { - scoped_nsobject<NSView> parent([[NSView alloc] initWithFrame:NSZeroRect]); - scoped_nsobject<NSView> child1([[NSView alloc] initWithFrame:NSZeroRect]); - scoped_nsobject<NSView> child2([[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> parent( + [[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> child1( + [[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> child2( + [[NSView alloc] initWithFrame:NSZeroRect]); [parent addSubview:child1]; [parent addSubview:child2]; @@ -60,9 +63,12 @@ TEST_F(NSViewChromeAdditionsTest, BelowAboveView) { } TEST_F(NSViewChromeAdditionsTest, EnsurePosition) { - scoped_nsobject<NSView> parent([[NSView alloc] initWithFrame:NSZeroRect]); - scoped_nsobject<NSView> child1([[NSView alloc] initWithFrame:NSZeroRect]); - scoped_nsobject<NSView> child2([[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> parent( + [[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> child1( + [[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> child2( + [[NSView alloc] initWithFrame:NSZeroRect]); [parent addSubview:child1]; [parent cr_ensureSubview:child2 @@ -81,10 +87,12 @@ TEST_F(NSViewChromeAdditionsTest, EnsurePosition) { // Verify that no view is removed or added when no change is needed. TEST_F(NSViewChromeAdditionsTest, EnsurePositionNoChange) { - scoped_nsobject<ParentView> parent( + base::scoped_nsobject<ParentView> parent( [[ParentView alloc] initWithFrame:NSZeroRect]); - scoped_nsobject<NSView> child1([[NSView alloc] initWithFrame:NSZeroRect]); - scoped_nsobject<NSView> child2([[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> child1( + [[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> child2( + [[NSView alloc] initWithFrame:NSZeroRect]); [parent addSubview:child1]; [parent addSubview:child2]; diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h index 629d572..7271416 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h @@ -8,7 +8,7 @@ #import <Cocoa/Cocoa.h> #include "base/basictypes.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/autocomplete/autocomplete_match.h" #include "chrome/browser/ui/omnibox/omnibox_popup_view.h" @@ -126,10 +126,10 @@ class OmniboxPopupViewMac : public OmniboxPopupView { NSTextField* field_; // owned by tab controller // Child window containing a matrix which implements the popup. - scoped_nsobject<NSWindow> popup_; + base::scoped_nsobject<NSWindow> popup_; NSRect targetPopupFrame_; - scoped_nsobject<AutocompleteMatrix> autocomplete_matrix_; + base::scoped_nsobject<AutocompleteMatrix> autocomplete_matrix_; DISALLOW_COPY_AND_ASSIGN(OmniboxPopupViewMac); }; diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm index 9ba9aad..e396c36 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm @@ -317,7 +317,7 @@ void OmniboxPopupViewMac::CreatePopupIfNeeded() { [popup_ setLevel:NSNormalWindowLevel]; // Use a flipped view to pin the matrix top the top left. This is needed // for animated resize. - scoped_nsobject<FlippedView> contentView( + base::scoped_nsobject<FlippedView> contentView( [[FlippedView alloc] initWithFrame:NSZeroRect]); [popup_ setContentView:contentView]; @@ -366,7 +366,7 @@ void OmniboxPopupViewMac::PositionPopup(const CGFloat matrixHeight) { bool animate = (NSHeight(popupFrame) < NSHeight(currentPopupFrame) && NSWidth(popupFrame) == NSWidth(currentPopupFrame)); - scoped_nsobject<NSDictionary> savedAnimations; + base::scoped_nsobject<NSDictionary> savedAnimations; if (!animate) { // In an ideal world, running a zero-length animation would cancel any // running animations and set the new frame value immediately. In practice, @@ -583,7 +583,7 @@ void OmniboxPopupViewMac::OpenURLForRow(int row, bool force_background) { options |= NSTrackingActiveInActiveApp; options |= NSTrackingInVisibleRect; - scoped_nsobject<NSTrackingArea> trackingArea( + base::scoped_nsobject<NSTrackingArea> trackingArea( [[NSTrackingArea alloc] initWithRect:[self frame] options:options owner:self diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm index de68daf..fd14f3c 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm @@ -449,7 +449,7 @@ TEST_F(OmniboxPopupViewMacTest, ElideString) { NSDictionary* attributes = [NSDictionary dictionaryWithObject:font_.GetNativeFont() forKey:NSFontAttributeName]; - scoped_nsobject<NSMutableAttributedString> as( + base::scoped_nsobject<NSMutableAttributedString> as( [[NSMutableAttributedString alloc] initWithString:contents attributes:attributes]); diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm index 68ba860..27711fd 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm @@ -149,8 +149,8 @@ OmniboxViewMac::OmniboxViewMac(OmniboxEditController* controller, [field_ setAllowsEditingTextAttributes:YES]; // Get the appropriate line height for the font that we use. - scoped_nsobject<NSLayoutManager> - layoutManager([[NSLayoutManager alloc] init]); + base::scoped_nsobject<NSLayoutManager> layoutManager( + [[NSLayoutManager alloc] init]); [layoutManager setUsesScreenFonts:YES]; } @@ -435,8 +435,8 @@ void OmniboxViewMac::ApplyTextAttributes(const string16& display_text, // Make a paragraph style locking in the standard line height as the maximum, // otherwise the baseline may shift "downwards". - scoped_nsobject<NSMutableParagraphStyle> - paragraph_style([[NSMutableParagraphStyle alloc] init]); + base::scoped_nsobject<NSMutableParagraphStyle> paragraph_style( + [[NSMutableParagraphStyle alloc] init]); CGFloat line_height = [[field_ cell] lineHeight]; [paragraph_style setMaximumLineHeight:line_height]; [paragraph_style setMinimumLineHeight:line_height]; diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_unittest.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_unittest.mm index 308d065..e9d77a3 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_unittest.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_unittest.mm @@ -146,7 +146,7 @@ TEST_F(OmniboxViewMacTest, TabToAutocomplete) { TEST_F(OmniboxViewMacTest, SetInstantSuggestion) { const NSRect frame = NSMakeRect(0, 0, 50, 30); - scoped_nsobject<AutocompleteTextField> field( + base::scoped_nsobject<AutocompleteTextField> field( [[AutocompleteTextField alloc] initWithFrame:frame]); TestingToolbarModelDelegate delegate; diff --git a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h index 4676267..5298ef0 100644 --- a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h +++ b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h @@ -8,7 +8,7 @@ #import <Cocoa/Cocoa.h> #include "base/callback.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/browser_window.h" #import "chrome/browser/ui/cocoa/base_bubble_controller.h" @@ -17,7 +17,7 @@ // Displays the one-click signin confirmation bubble @interface OneClickSigninBubbleController : BaseBubbleController { - scoped_nsobject<OneClickSigninViewController> viewController_; + base::scoped_nsobject<OneClickSigninViewController> viewController_; @private IBOutlet NSTextField* messageTextField_; } diff --git a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller.mm b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller.mm index 6126103..a3d97fa 100644 --- a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller.mm @@ -44,7 +44,7 @@ void PerformClose(OneClickSigninBubbleController* controller) { // Create an empty window into which content is placed. NSRect viewBounds = [[viewController_ view] bounds]; - scoped_nsobject<InfoBubbleWindow> window( + base::scoped_nsobject<InfoBubbleWindow> window( [[InfoBubbleWindow alloc] initWithContentRect:viewBounds styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered diff --git a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_browsertest.mm b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_browsertest.mm index 1d4db26..0387770 100644 --- a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_browsertest.mm +++ b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_browsertest.mm @@ -39,7 +39,7 @@ class OneClickSigninBubbleControllerTest : public InProcessBrowserTest { [[controller_ viewController] nibName]); } - scoped_nsobject<OneClickSigninBubbleController> controller_; + base::scoped_nsobject<OneClickSigninBubbleController> controller_; int callback_count_; private: diff --git a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_unittest.mm index 86ac826..a60e3a2 100644 --- a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_unittest.mm @@ -8,12 +8,12 @@ #include "base/bind.h" #include "base/compiler_specific.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/weak_ptr.h" #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" -#include "chrome/browser/ui/sync/one_click_signin_sync_starter.h" #import "chrome/browser/ui/cocoa/one_click_signin_view_controller.h" +#include "chrome/browser/ui/sync/one_click_signin_sync_starter.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" @@ -54,7 +54,7 @@ class OneClickSigninBubbleControllerTest : public CocoaProfileTest { protected: base::WeakPtrFactory<OneClickSigninBubbleControllerTest> weak_ptr_factory_; BrowserWindow::StartSyncCallback start_sync_callback_; - scoped_nsobject<OneClickSigninBubbleController> controller_; + base::scoped_nsobject<OneClickSigninBubbleController> controller_; private: DISALLOW_COPY_AND_ASSIGN(OneClickSigninBubbleControllerTest); diff --git a/chrome/browser/ui/cocoa/one_click_signin_dialog_controller.h b/chrome/browser/ui/cocoa/one_click_signin_dialog_controller.h index 2cfa36b..4a7f082 100644 --- a/chrome/browser/ui/cocoa/one_click_signin_dialog_controller.h +++ b/chrome/browser/ui/cocoa/one_click_signin_dialog_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" @@ -40,7 +40,7 @@ class OneClickSigninDialogController : public ConstrainedWindowMacDelegate { void PerformClose(); scoped_ptr<ConstrainedWindowMac> constrained_window_; - scoped_nsobject<OneClickSigninViewController> view_controller_; + base::scoped_nsobject<OneClickSigninViewController> view_controller_; }; #endif // CHROME_BROWSER_UI_COCOA_ONE_CLICK_SIGNIN_DIALOG_CONTROLLER_H_ diff --git a/chrome/browser/ui/cocoa/one_click_signin_dialog_controller.mm b/chrome/browser/ui/cocoa/one_click_signin_dialog_controller.mm index 00b5a08..6078a50 100644 --- a/chrome/browser/ui/cocoa/one_click_signin_dialog_controller.mm +++ b/chrome/browser/ui/cocoa/one_click_signin_dialog_controller.mm @@ -22,13 +22,12 @@ OneClickSigninDialogController::OneClickSigninDialogController( closeCallback:close_callback isSyncDialog:YES errorMessage:nil]); - scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc] + base::scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc] initWithContentRect:[[view_controller_ view] bounds]]); [[window contentView] addSubview:[view_controller_ view]]; - scoped_nsobject<CustomConstrainedWindowSheet> sheet( - [[CustomConstrainedWindowSheet alloc] - initWithCustomWindow:window]); + base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( + [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window]); constrained_window_.reset(new ConstrainedWindowMac( this, web_contents, sheet)); } diff --git a/chrome/browser/ui/cocoa/one_click_signin_view_controller.h b/chrome/browser/ui/cocoa/one_click_signin_view_controller.h index 004ed34..02d71ae 100644 --- a/chrome/browser/ui/cocoa/one_click_signin_view_controller.h +++ b/chrome/browser/ui/cocoa/one_click_signin_view_controller.h @@ -8,7 +8,7 @@ #import <Cocoa/Cocoa.h> #include "base/callback.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/browser_window.h" @class BrowserWindowController; @@ -31,13 +31,13 @@ class WebContents; // This is YES if the user clicked the Learn More link before another action. BOOL clickedLearnMore_; - scoped_nsobject<NSString> errorMessage_; + base::scoped_nsobject<NSString> errorMessage_; // Text fields don't work as well with embedded links as text views, but // text views cannot conveniently be created in IB. The xib file contains // a text field |informativePlaceholderTextField_| that's replaced by this // text view |promo_| in -awakeFromNib. - scoped_nsobject<HyperlinkTextView> informativeTextView_; + base::scoped_nsobject<HyperlinkTextView> informativeTextView_; BrowserWindow::StartSyncCallback startSyncCallback_; base::Closure closeCallback_; content::WebContents* webContents_; diff --git a/chrome/browser/ui/cocoa/panels/panel_cocoa_unittest.mm b/chrome/browser/ui/cocoa/panels/panel_cocoa_unittest.mm index b0eda33..a817812 100644 --- a/chrome/browser/ui/cocoa/panels/panel_cocoa_unittest.mm +++ b/chrome/browser/ui/cocoa/panels/panel_cocoa_unittest.mm @@ -296,7 +296,7 @@ TEST_F(PanelCocoaTest, TitlebarViewClose) { TEST_F(PanelCocoaTest, MenuItems) { Panel* panel = CreateTestPanel("Test Panel"); - scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@""]); + base::scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@""]); NSMenuItem* close_tab_menu_item = CreateMenuItem(menu, IDC_CLOSE_TAB); NSMenuItem* new_tab_menu_item = CreateMenuItem(menu, IDC_NEW_TAB); NSMenuItem* new_tab_window_item = CreateMenuItem(menu, IDC_NEW_WINDOW); diff --git a/chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.h b/chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.h index 35824de..442044c 100644 --- a/chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.h +++ b/chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.h @@ -11,7 +11,7 @@ #include <map> #include "base/basictypes.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/ui/panels/native_panel_stack_window.h" #include "ui/gfx/rect.h" @@ -70,7 +70,7 @@ class PanelStackWindowCocoa : public NativePanelStackWindow { NativePanelStackWindowDelegate* delegate_; // The underlying window. - scoped_nsobject<NSWindow> window_; + base::scoped_nsobject<NSWindow> window_; Panels panels_; @@ -85,7 +85,8 @@ class PanelStackWindowCocoa : public NativePanelStackWindow { // Used to animate the bounds changes at a synchronized pace. // Lifetime controlled manually, needs more than just |release| to terminate. NSViewAnimation* bounds_animation_; - scoped_nsobject<BatchBoundsAnimationDelegate> bounds_animation_delegate_; + base::scoped_nsobject<BatchBoundsAnimationDelegate> + bounds_animation_delegate_; DISALLOW_COPY_AND_ASSIGN(PanelStackWindowCocoa); }; diff --git a/chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.mm b/chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.mm index ee2045d..90ba6e0 100644 --- a/chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.mm +++ b/chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.mm @@ -226,7 +226,7 @@ void PanelStackWindowCocoa::EndBatchUpdatePanelBounds() { int num_of_animations = 1; if (need_to_animate_individual_panels) num_of_animations += bounds_updates_.size(); - scoped_nsobject<NSMutableArray> animations( + base::scoped_nsobject<NSMutableArray> animations( [[NSMutableArray alloc] initWithCapacity:num_of_animations]); // Add the animation for each panel in the update list. diff --git a/chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.h b/chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.h index e353fb4..dc139e5 100644 --- a/chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.h +++ b/chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.h @@ -61,12 +61,12 @@ BOOL isDrawingAttention_; // "Glint" animation is used in "Draw Attention" mode. - scoped_nsobject<RepaintAnimation> glintAnimation_; - scoped_nsobject<NSTimer> glintAnimationTimer_; + base::scoped_nsobject<RepaintAnimation> glintAnimation_; + base::scoped_nsobject<NSTimer> glintAnimationTimer_; int glintCounter_; // Drag support. - scoped_nsobject<MouseDragController> dragController_; + base::scoped_nsobject<MouseDragController> dragController_; } // Callbacks from Close, Minimize, and Restore buttons. diff --git a/chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.mm b/chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.mm index 673e628..65cb230 100644 --- a/chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.mm +++ b/chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.mm @@ -146,7 +146,7 @@ static NSEvent* MakeMouseEvent(NSEventType type, NSRectFillUsingOperation([self bounds], NSCompositeSourceOver); if ([glintAnimation_ isAnimating]) { - scoped_nsobject<NSGradient> glint([NSGradient alloc]); + base::scoped_nsobject<NSGradient> glint([NSGradient alloc]); float currentAlpha = 0.8 * [glintAnimation_ currentValue]; NSColor* startColor = [NSColor colorWithCalibratedWhite:1.0 alpha:currentAlpha]; diff --git a/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.h b/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.h index 3e8bc57..6627170 100644 --- a/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.h +++ b/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.h @@ -11,7 +11,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/chrome_browser_window.h" #include "chrome/browser/ui/panels/panel.h" @@ -29,7 +29,7 @@ class PanelCocoa; @private IBOutlet PanelTitlebarViewCocoa* titlebar_view_; scoped_ptr<PanelCocoa> windowShim_; - scoped_nsobject<NSString> pendingWindowTitle_; + base::scoped_nsobject<NSString> pendingWindowTitle_; NSViewAnimation* boundsAnimation_; // Lifetime controlled manually, needs // more then just |release| to terminate. BOOL animateOnBoundsChange_; @@ -42,7 +42,7 @@ class PanelCocoa; // window over other application windows due to panels having a higher // priority NSWindowLevel, so we distinguish between the two scenarios. BOOL activationRequestedByPanel_; - scoped_nsobject<NSView> overlayView_; + base::scoped_nsobject<NSView> overlayView_; } // Load the window nib and do any Cocoa-specific initialization. diff --git a/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm b/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm index c335faa..fbd7e32 100644 --- a/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm +++ b/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm @@ -112,12 +112,12 @@ const double kWidthOfMouseResizeArea = 4.0; @interface PanelResizeByMouseOverlay : NSView <MouseDragControllerClient> { @private Panel* panel_; - scoped_nsobject<MouseDragController> dragController_; - scoped_nsobject<NSCursor> dragCursor_; - scoped_nsobject<NSCursor> eastWestCursor_; - scoped_nsobject<NSCursor> northSouthCursor_; - scoped_nsobject<NSCursor> northEastSouthWestCursor_; - scoped_nsobject<NSCursor> northWestSouthEastCursor_; + base::scoped_nsobject<MouseDragController> dragController_; + base::scoped_nsobject<NSCursor> dragCursor_; + base::scoped_nsobject<NSCursor> eastWestCursor_; + base::scoped_nsobject<NSCursor> northSouthCursor_; + base::scoped_nsobject<NSCursor> northEastSouthWestCursor_; + base::scoped_nsobject<NSCursor> northWestSouthEastCursor_; NSRect leftCursorRect_; NSRect rightCursorRect_; NSRect topCursorRect_; diff --git a/chrome/browser/ui/cocoa/presentation_mode_controller.h b/chrome/browser/ui/cocoa/presentation_mode_controller.h index 728c2da..8af03b4 100644 --- a/chrome/browser/ui/cocoa/presentation_mode_controller.h +++ b/chrome/browser/ui/cocoa/presentation_mode_controller.h @@ -45,16 +45,16 @@ // hidden, we still need to keep a 1px tall tracking area visible. Attaching // to the content view allows us to do this. |trackingArea_| can be nil if // not in presentation mode or during animations. - scoped_nsobject<NSTrackingArea> trackingArea_; + base::scoped_nsobject<NSTrackingArea> trackingArea_; // Pointer to the currently running animation. Is nil if no animation is // running. - scoped_nsobject<DropdownAnimation> currentAnimation_; + base::scoped_nsobject<DropdownAnimation> currentAnimation_; // Timers for scheduled showing/hiding of the bar (which are always done with // animation). - scoped_nsobject<NSTimer> showTimer_; - scoped_nsobject<NSTimer> hideTimer_; + base::scoped_nsobject<NSTimer> showTimer_; + base::scoped_nsobject<NSTimer> hideTimer_; // Holds the current bounds of |trackingArea_|, even if |trackingArea_| is // currently nil. Used to restore the tracking area when an animation diff --git a/chrome/browser/ui/cocoa/profile_menu_controller.h b/chrome/browser/ui/cocoa/profile_menu_controller.h index 1610fa6..c2b17aa 100644 --- a/chrome/browser/ui/cocoa/profile_menu_controller.h +++ b/chrome/browser/ui/cocoa/profile_menu_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" class AvatarMenuModel; diff --git a/chrome/browser/ui/cocoa/profile_menu_controller.mm b/chrome/browser/ui/cocoa/profile_menu_controller.mm index 4f08ec4..0ef2503 100644 --- a/chrome/browser/ui/cocoa/profile_menu_controller.mm +++ b/chrome/browser/ui/cocoa/profile_menu_controller.mm @@ -66,8 +66,7 @@ class Observer : public chrome::BrowserListObserver, if ((self = [super init])) { mainMenuItem_ = item; - scoped_nsobject<NSMenu> menu( - [[NSMenu alloc] initWithTitle: + base::scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle: l10n_util::GetNSStringWithFixup(IDS_PROFILES_OPTIONS_GROUP_NAME)]); [mainMenuItem_ setSubmenu:menu]; @@ -110,7 +109,7 @@ class Observer : public chrome::BrowserListObserver, if (dock) { NSString* headerName = l10n_util::GetNSStringWithFixup(IDS_PROFILES_OPTIONS_GROUP_NAME); - scoped_nsobject<NSMenuItem> header( + base::scoped_nsobject<NSMenuItem> header( [[NSMenuItem alloc] initWithTitle:headerName action:NULL keyEquivalent:@""]); @@ -213,7 +212,7 @@ class Observer : public chrome::BrowserListObserver, } - (NSMenuItem*)createItemWithTitle:(NSString*)title action:(SEL)sel { - scoped_nsobject<NSMenuItem> item( + base::scoped_nsobject<NSMenuItem> item( [[NSMenuItem alloc] initWithTitle:title action:sel keyEquivalent:@""]); [item setTarget:self]; return [item.release() autorelease]; diff --git a/chrome/browser/ui/cocoa/profile_menu_controller_unittest.mm b/chrome/browser/ui/cocoa/profile_menu_controller_unittest.mm index 06f22b39..60c297c 100644 --- a/chrome/browser/ui/cocoa/profile_menu_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/profile_menu_controller_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/profile_menu_controller.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/threading/thread_restrictions.h" #include "chrome/browser/profiles/avatar_menu_model.h" #include "chrome/browser/profiles/profile_manager.h" @@ -71,8 +71,8 @@ class ProfileMenuControllerTest : public CocoaProfileTest { NSMenuItem* menu_item() { return item_.get(); } private: - scoped_nsobject<NSMenuItem> item_; - scoped_nsobject<ProfileMenuController> controller_; + base::scoped_nsobject<NSMenuItem> item_; + base::scoped_nsobject<ProfileMenuController> controller_; }; TEST_F(ProfileMenuControllerTest, InitializeMenu) { @@ -124,7 +124,7 @@ TEST_F(ProfileMenuControllerTest, RebuildMenu) { } TEST_F(ProfileMenuControllerTest, InsertItems) { - scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle: @""]); + base::scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@""]); ASSERT_EQ(0, [menu numberOfItems]); // With only one profile, insertItems should be a no-op. diff --git a/chrome/browser/ui/cocoa/profile_signin_confirmation_dialog_cocoa.h b/chrome/browser/ui/cocoa/profile_signin_confirmation_dialog_cocoa.h index 561c0d6..227840e 100644 --- a/chrome/browser/ui/cocoa/profile_signin_confirmation_dialog_cocoa.h +++ b/chrome/browser/ui/cocoa/profile_signin_confirmation_dialog_cocoa.h @@ -11,7 +11,7 @@ #include "base/callback.h" #include "base/compiler_specific.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" @@ -49,7 +49,7 @@ class ProfileSigninConfirmationDialogCocoa : ConstrainedWindowMacDelegate { virtual void OnConstrainedWindowClosed(ConstrainedWindowMac* window) OVERRIDE; // Controller for the dialog view. - scoped_nsobject<ProfileSigninConfirmationViewController> controller_; + base::scoped_nsobject<ProfileSigninConfirmationViewController> controller_; // The constrained window that contains the dialog view. scoped_ptr<ConstrainedWindowMac> window_; diff --git a/chrome/browser/ui/cocoa/profile_signin_confirmation_dialog_cocoa.mm b/chrome/browser/ui/cocoa/profile_signin_confirmation_dialog_cocoa.mm index 44fb43f..c1c8a49 100644 --- a/chrome/browser/ui/cocoa/profile_signin_confirmation_dialog_cocoa.mm +++ b/chrome/browser/ui/cocoa/profile_signin_confirmation_dialog_cocoa.mm @@ -72,13 +72,11 @@ ProfileSigninConfirmationDialogCocoa::ProfileSigninConfirmationDialogCocoa( offerProfileCreation:offer_profile_creation]); // Setup the constrained window that will show the view. - scoped_nsobject<NSWindow> window( - [[ConstrainedWindowCustomWindow alloc] - initWithContentRect:[[controller_ view] bounds]]); + base::scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc] + initWithContentRect:[[controller_ view] bounds]]); [[window contentView] addSubview:[controller_ view]]; - scoped_nsobject<CustomConstrainedWindowSheet> sheet( - [[CustomConstrainedWindowSheet alloc] - initWithCustomWindow:window]); + base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( + [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window]); window_.reset(new ConstrainedWindowMac(this, web_contents, sheet)); } diff --git a/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller.h b/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller.h index b1e4df6..ffde5c4 100644 --- a/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller.h +++ b/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller.h @@ -9,7 +9,7 @@ #include <string> #include "base/callback.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" @class HyperlinkTextView; @@ -38,14 +38,14 @@ class ProfileSigninConfirmationDelegate; base::Closure closeDialogCallback_; // UI elements. - scoped_nsobject<NSBox> promptBox_; - scoped_nsobject<NSButton> closeButton_; - scoped_nsobject<NSTextField> titleField_; - scoped_nsobject<NSTextField> promptField_; - scoped_nsobject<NSTextView> explanationField_; - scoped_nsobject<ConstrainedWindowButton> createProfileButton_; - scoped_nsobject<ConstrainedWindowButton> cancelButton_; - scoped_nsobject<ConstrainedWindowButton> okButton_; + base::scoped_nsobject<NSBox> promptBox_; + base::scoped_nsobject<NSButton> closeButton_; + base::scoped_nsobject<NSTextField> titleField_; + base::scoped_nsobject<NSTextField> promptField_; + base::scoped_nsobject<NSTextView> explanationField_; + base::scoped_nsobject<ConstrainedWindowButton> createProfileButton_; + base::scoped_nsobject<ConstrainedWindowButton> cancelButton_; + base::scoped_nsobject<ConstrainedWindowButton> okButton_; } - (id)initWithBrowser:(Browser*)browser diff --git a/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller.mm b/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller.mm index 1aacda3..367556b 100644 --- a/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller.mm +++ b/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller.mm @@ -59,7 +59,7 @@ NSRect ComputeFrame(NSAttributedString* text, CGFloat width, CGFloat height) { // Make the indicated range of characters in a text view bold. void MakeTextBold(NSTextField* textField, int offset, int length) { - scoped_nsobject<NSMutableAttributedString> text( + base::scoped_nsobject<NSMutableAttributedString> text( [[textField attributedStringValue] mutableCopy]); NSFont* currentFont = [text attribute:NSFontAttributeName @@ -96,7 +96,7 @@ NSTextView* AddTextView( const string16& link, int offset, const ui::ResourceBundle::FontStyle& font_style) { - scoped_nsobject<HyperlinkTextView> textView( + base::scoped_nsobject<HyperlinkTextView> textView( [[HyperlinkTextView alloc] initWithFrame:NSZeroRect]); NSFont* font = ui::ResourceBundle::GetSharedInstance().GetFont( font_style).GetNativeFont(); diff --git a/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller_browsertest.mm b/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller_browsertest.mm index d1d38aa..0d5a5c4 100644 --- a/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller_browsertest.mm +++ b/chrome/browser/ui/cocoa/profile_signin_confirmation_view_controller_browsertest.mm @@ -6,7 +6,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/browser.h" @@ -69,10 +69,10 @@ class ProfileSigninConfirmationViewControllerTest void OnClose() { closed_ = true; } // The window containing the dialog. - scoped_nsobject<NSWindow> window_; + base::scoped_nsobject<NSWindow> window_; // Dialog under test. - scoped_nsobject<ProfileSigninConfirmationViewController> controller_; + base::scoped_nsobject<ProfileSigninConfirmationViewController> controller_; // Visible for testing UI interactions. bool continued_; diff --git a/chrome/browser/ui/cocoa/run_loop_testing.mm b/chrome/browser/ui/cocoa/run_loop_testing.mm index b85722a..9918c90 100644 --- a/chrome/browser/ui/cocoa/run_loop_testing.mm +++ b/chrome/browser/ui/cocoa/run_loop_testing.mm @@ -6,7 +6,7 @@ #import <Foundation/Foundation.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/message_loop/message_pump_mac.h" // This class is scheduled with a delayed selector to quit the message pump. @@ -42,7 +42,7 @@ void NSRunLoopRunAllPending() { // Put a delayed selector on the queue. All other pending delayed selectors // will run before this, after which the internal loop can end. - scoped_nsobject<CocoaQuitTask> quit_task( + base::scoped_nsobject<CocoaQuitTask> quit_task( [[CocoaQuitTask alloc] initWithMessagePump:message_pump]); [quit_task performSelector:@selector(doQuit) diff --git a/chrome/browser/ui/cocoa/run_loop_testing_unittest.mm b/chrome/browser/ui/cocoa/run_loop_testing_unittest.mm index d281c46..760f985 100644 --- a/chrome/browser/ui/cocoa/run_loop_testing_unittest.mm +++ b/chrome/browser/ui/cocoa/run_loop_testing_unittest.mm @@ -6,7 +6,7 @@ #import <Foundation/Foundation.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "testing/gtest/include/gtest/gtest.h" @interface TestDelayed : NSObject { @@ -36,7 +36,7 @@ @end TEST(RunLoopTesting, RunAllPending) { - scoped_nsobject<TestDelayed> tester([[TestDelayed alloc] init]); + base::scoped_nsobject<TestDelayed> tester([[TestDelayed alloc] init]); EXPECT_FALSE([tester didWork]); chrome::testing::NSRunLoopRunAllPending(); @@ -45,8 +45,8 @@ TEST(RunLoopTesting, RunAllPending) { } TEST(RunLoopTesting, NestedWork) { - scoped_nsobject<TestDelayed> tester([[TestDelayed alloc] init]); - scoped_nsobject<TestDelayed> nested([[TestDelayed alloc] init]); + base::scoped_nsobject<TestDelayed> tester([[TestDelayed alloc] init]); + base::scoped_nsobject<TestDelayed> nested([[TestDelayed alloc] init]); [tester setNext:nested]; EXPECT_FALSE([tester didWork]); diff --git a/chrome/browser/ui/cocoa/speech_recognition_bubble_cocoa.mm b/chrome/browser/ui/cocoa/speech_recognition_bubble_cocoa.mm index eb48acb..c308f5a 100644 --- a/chrome/browser/ui/cocoa/speech_recognition_bubble_cocoa.mm +++ b/chrome/browser/ui/cocoa/speech_recognition_bubble_cocoa.mm @@ -6,7 +6,7 @@ #include "chrome/browser/speech/speech_recognition_bubble.h" -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" #include "chrome/browser/ui/cocoa/browser_window_controller.h" @@ -35,7 +35,7 @@ class SpeechRecognitionBubbleImpl : public SpeechRecognitionBubbleBase { virtual void UpdateImage() OVERRIDE; private: - scoped_nsobject<SpeechRecognitionWindowController> window_; + base::scoped_nsobject<SpeechRecognitionWindowController> window_; Delegate* delegate_; gfx::Rect element_rect_; }; diff --git a/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.h b/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.h index 49b080c..ce94e3c 100644 --- a/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.h +++ b/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.h @@ -9,8 +9,8 @@ #include <vector> #include "base/mac/scoped_cftyperef.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/ssl/ssl_client_certificate_selector.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h" @@ -29,9 +29,9 @@ class SSLClientAuthObserverCocoaBridge; std::vector<scoped_refptr<net::X509Certificate> > certificates_; // A C++ object to bridge SSLClientAuthObserver notifications to us. scoped_ptr<SSLClientAuthObserverCocoaBridge> observer_; - scoped_nsobject<SFChooseIdentityPanel> panel_; + base::scoped_nsobject<SFChooseIdentityPanel> panel_; scoped_ptr<ConstrainedWindowMac> constrainedWindow_; - scoped_nsobject<NSWindow> overlayWindow_; + base::scoped_nsobject<NSWindow> overlayWindow_; BOOL closePending_; // A copy of the sheet's frame used to restore on show. NSRect oldSheetFrame_; diff --git a/chrome/browser/ui/cocoa/status_bubble_mac.mm b/chrome/browser/ui/cocoa/status_bubble_mac.mm index 99f8d98..e5e46e0a 100644 --- a/chrome/browser/ui/cocoa/status_bubble_mac.mm +++ b/chrome/browser/ui/cocoa/status_bubble_mac.mm @@ -374,7 +374,7 @@ void StatusBubbleMac::Create() { // teardown sequence in BWC guarantees that |parent_| outlives the status // bubble and that the StatusBubble is torn down completely prior to the // window going away. - scoped_nsobject<BubbleView> view( + base::scoped_nsobject<BubbleView> view( [[BubbleView alloc] initWithFrame:NSZeroRect themeProvider:parent_]); [window_ setContentView:view]; diff --git a/chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm b/chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm index b25225f..ffd903b 100644 --- a/chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm +++ b/chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm @@ -4,7 +4,7 @@ #include <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "base/strings/utf_string_conversions.h" @@ -175,7 +175,7 @@ class StatusBubbleMacTest : public CocoaTest { } base::MessageLoop message_loop_; - scoped_nsobject<StatusBubbleMacTestDelegate> delegate_; + base::scoped_nsobject<StatusBubbleMacTestDelegate> delegate_; StatusBubbleMac* bubble_; // Strong. }; diff --git a/chrome/browser/ui/cocoa/status_icons/status_icon_mac.h b/chrome/browser/ui/cocoa/status_icons/status_icon_mac.h index 51fa138..8b380c4 100644 --- a/chrome/browser/ui/cocoa/status_icons/status_icon_mac.h +++ b/chrome/browser/ui/cocoa/status_icons/status_icon_mac.h @@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" #include "chrome/browser/status_icons/desktop_notification_balloon.h" #include "chrome/browser/status_icons/status_icon.h" @@ -46,18 +46,18 @@ class StatusIconMac : public StatusIcon { // Getter for item_ that allows lazy initialization. NSStatusItem* item(); - scoped_nsobject<NSStatusItem> item_; + base::scoped_nsobject<NSStatusItem> item_; - scoped_nsobject<StatusItemController> controller_; + base::scoped_nsobject<StatusItemController> controller_; // Notification balloon. DesktopNotificationBalloon notification_; - scoped_nsobject<NSString> toolTip_; + base::scoped_nsobject<NSString> toolTip_; // Status menu shown when right-clicking the system icon, if it has been // created by |UpdatePlatformContextMenu|. - scoped_nsobject<MenuController> menu_; + base::scoped_nsobject<MenuController> menu_; DISALLOW_COPY_AND_ASSIGN(StatusIconMac); }; diff --git a/chrome/browser/ui/cocoa/styled_text_field_cell_unittest.mm b/chrome/browser/ui/cocoa/styled_text_field_cell_unittest.mm index 076583f..a01c2c4 100644 --- a/chrome/browser/ui/cocoa/styled_text_field_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/styled_text_field_cell_unittest.mm @@ -4,10 +4,10 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" +#import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/styled_text_field_cell.h" #import "chrome/browser/ui/cocoa/styled_text_field_test_helper.h" -#import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -24,13 +24,13 @@ class StyledTextFieldCellTest : public CocoaTest { // decorations. const NSRect frame = NSMakeRect(0, 0, kWidth, 30); - scoped_nsobject<StyledTextFieldTestCell> cell( + base::scoped_nsobject<StyledTextFieldTestCell> cell( [[StyledTextFieldTestCell alloc] initTextCell:@"Testing"]); cell_ = cell.get(); [cell_ setEditable:YES]; [cell_ setBordered:YES]; - scoped_nsobject<NSTextField> view( + base::scoped_nsobject<NSTextField> view( [[NSTextField alloc] initWithFrame:frame]); view_ = view.get(); [view_ setCell:cell_]; diff --git a/chrome/browser/ui/cocoa/styled_text_field_unittest.mm b/chrome/browser/ui/cocoa/styled_text_field_unittest.mm index c4f066c..0a8ebe9 100644 --- a/chrome/browser/ui/cocoa/styled_text_field_unittest.mm +++ b/chrome/browser/ui/cocoa/styled_text_field_unittest.mm @@ -4,11 +4,11 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" +#import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/styled_text_field.h" #import "chrome/browser/ui/cocoa/styled_text_field_cell.h" #import "chrome/browser/ui/cocoa/styled_text_field_test_helper.h" -#import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" namespace { @@ -24,13 +24,13 @@ class StyledTextFieldTest : public CocoaTest { // decorations. NSRect frame = NSMakeRect(0, 0, kWidth, 30); - scoped_nsobject<StyledTextFieldTestCell> cell( + base::scoped_nsobject<StyledTextFieldTestCell> cell( [[StyledTextFieldTestCell alloc] initTextCell:@"Testing"]); cell_ = cell.get(); [cell_ setEditable:YES]; [cell_ setBordered:YES]; - scoped_nsobject<StyledTextField> field( + base::scoped_nsobject<StyledTextField> field( [[StyledTextField alloc] initWithFrame:frame]); field_ = field.get(); [field_ setCell:cell_]; diff --git a/chrome/browser/ui/cocoa/tab_contents/overlay_separator_view_unittest.mm b/chrome/browser/ui/cocoa/tab_contents/overlay_separator_view_unittest.mm index 7254a31..f09da20 100644 --- a/chrome/browser/ui/cocoa/tab_contents/overlay_separator_view_unittest.mm +++ b/chrome/browser/ui/cocoa/tab_contents/overlay_separator_view_unittest.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/tab_contents/overlay_separator_view.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" class OverlayBottomSeparatorViewTest : public CocoaTest { @@ -17,7 +17,7 @@ class OverlayBottomSeparatorViewTest : public CocoaTest { } protected: - scoped_nsobject<OverlayBottomSeparatorView> bottom_view_; + base::scoped_nsobject<OverlayBottomSeparatorView> bottom_view_; private: DISALLOW_COPY_AND_ASSIGN(OverlayBottomSeparatorViewTest); @@ -39,7 +39,7 @@ class OverlayTopSeparatorViewTest : public CocoaTest { } protected: - scoped_nsobject<OverlayTopSeparatorView> top_view_; + base::scoped_nsobject<OverlayTopSeparatorView> top_view_; private: DISALLOW_COPY_AND_ASSIGN(OverlayTopSeparatorViewTest); diff --git a/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h b/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h index 15ef7a6..9504653 100644 --- a/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h +++ b/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/common/instant_types.h" @@ -33,7 +33,7 @@ class WebContents; @interface OverlayableContentsController : NSViewController { @private // Container view for the "active" contents. - scoped_nsobject<NSView> activeContainer_; + base::scoped_nsobject<NSView> activeContainer_; // The overlay WebContents. Will be NULL if no overlay is currently showing. content::WebContents* overlayContents_; // weak @@ -50,11 +50,11 @@ class WebContents; BOOL drawDropShadow_; // View responsible for drawing a drop shadow. - scoped_nsobject<NSView> dropShadowView_; + base::scoped_nsobject<NSView> dropShadowView_; // View responsible for drawing a separator at the top. The separator is // only visible when the overlay is positioned right next to the omnibox. - scoped_nsobject<NSView> topSeparatorView_; + base::scoped_nsobject<NSView> topSeparatorView_; BrowserWindowController* windowController_; diff --git a/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.mm b/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.mm index a7ec256..83bb984 100644 --- a/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.mm +++ b/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.mm @@ -28,7 +28,8 @@ windowController:(BrowserWindowController*)windowController { if ((self = [super init])) { windowController_ = windowController; - scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> view( + [[NSView alloc] initWithFrame:NSZeroRect]); [view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable]; [view setAutoresizesSubviews:NO]; [[NSNotificationCenter defaultCenter] diff --git a/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller_browsertest.mm b/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller_browsertest.mm index d2e115d..d096f9e 100644 --- a/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller_browsertest.mm +++ b/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller_browsertest.mm @@ -78,7 +78,7 @@ class OverlayableContentsControllerTest : public InProcessBrowserTest, protected: InstantOverlayModel instant_overlay_model_; scoped_ptr<content::WebContents> web_contents_; - scoped_nsobject<OverlayableContentsController> controller_; + base::scoped_nsobject<OverlayableContentsController> controller_; content::NotificationRegistrar registrar_; int visibility_changed_count_; }; diff --git a/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.h b/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.h index 35f8177..c43503a 100644 --- a/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.h +++ b/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/tab_contents/render_view_context_menu.h" @class MenuController; @@ -59,7 +59,7 @@ class RenderViewContextMenuMac : public RenderViewContextMenu { void StopSpeaking(); // The Cocoa menu controller for this menu. - scoped_nsobject<MenuController> menu_controller_; + base::scoped_nsobject<MenuController> menu_controller_; // Model for the "Speech" submenu. ui::SimpleMenuModel speech_submenu_model_; diff --git a/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.mm b/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.mm index 1581632..42d2197 100644 --- a/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.mm +++ b/chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.mm @@ -5,8 +5,8 @@ #include "chrome/browser/ui/cocoa/tab_contents/render_view_context_menu_mac.h" #include "base/compiler_specific.h" +#include "base/mac/scoped_nsobject.h" #import "base/mac/scoped_sending_event.h" -#include "base/memory/scoped_nsobject.h" #include "base/message_loop.h" #include "base/strings/sys_string_conversions.h" #include "chrome/app/chrome_command_ids.h" diff --git a/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h b/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h index 439e539..91fc745 100644 --- a/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h +++ b/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/sad_tab.h" #import <Cocoa/Cocoa.h> @@ -27,7 +27,7 @@ class SadTabCocoa : public SadTab { virtual void Show() OVERRIDE; virtual void Close() OVERRIDE; - scoped_nsobject<SadTabController> sad_tab_controller_; + base::scoped_nsobject<SadTabController> sad_tab_controller_; content::WebContents* web_contents_; diff --git a/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller_unittest.mm b/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller_unittest.mm index 5c2e9254..0067968 100644 --- a/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller_unittest.mm @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "base/debug/debugger.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" #import "chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h" @@ -75,7 +75,7 @@ class SadTabControllerTest : public ChromeRenderViewHostTestHarness { bool SadTabControllerTest::link_clicked_; TEST_F(SadTabControllerTest, WithTabContents) { - scoped_nsobject<SadTabController> controller(CreateController()); + base::scoped_nsobject<SadTabController> controller(CreateController()); EXPECT_TRUE(controller); HyperlinkTextView* help = GetHelpTextView(controller); EXPECT_TRUE(help); @@ -83,14 +83,14 @@ TEST_F(SadTabControllerTest, WithTabContents) { TEST_F(SadTabControllerTest, WithoutTabContents) { DeleteContents(); - scoped_nsobject<SadTabController> controller(CreateController()); + base::scoped_nsobject<SadTabController> controller(CreateController()); EXPECT_TRUE(controller); HyperlinkTextView* help = GetHelpTextView(controller); EXPECT_FALSE(help); } TEST_F(SadTabControllerTest, ClickOnLink) { - scoped_nsobject<SadTabController> controller(CreateController()); + base::scoped_nsobject<SadTabController> controller(CreateController()); HyperlinkTextView* help = GetHelpTextView(controller); EXPECT_TRUE(help); EXPECT_FALSE(link_clicked_); diff --git a/chrome/browser/ui/cocoa/tab_contents/sad_tab_view.h b/chrome/browser/ui/cocoa/tab_contents/sad_tab_view.h index b203cb2..45fdf7e 100644 --- a/chrome/browser/ui/cocoa/tab_contents/sad_tab_view.h +++ b/chrome/browser/ui/cocoa/tab_contents/sad_tab_view.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_SAD_TAB_VIEW_H_ #define CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_SAD_TAB_VIEW_H_ -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "ui/base/cocoa/base_view.h" #import <Cocoa/Cocoa.h> @@ -21,14 +21,14 @@ IBOutlet NSTextField* message_; IBOutlet NSTextField* helpPlaceholder_; - scoped_nsobject<NSColor> backgroundColor_; + base::scoped_nsobject<NSColor> backgroundColor_; NSSize messageSize_; // Text fields don't work as well with embedded links as text views, but // text views cannot conveniently be created in IB. The xib file contains // a text field |helpPlaceholder_| that's replaced by this text view |help_| // in -awakeFromNib. - scoped_nsobject<HyperlinkTextView> help_; + base::scoped_nsobject<HyperlinkTextView> help_; // A weak reference to the parent controller. IBOutlet SadTabController* controller_; diff --git a/chrome/browser/ui/cocoa/tab_contents/sad_tab_view_unittest.mm b/chrome/browser/ui/cocoa/tab_contents/sad_tab_view_unittest.mm index 76808cf..82bf73a 100644 --- a/chrome/browser/ui/cocoa/tab_contents/sad_tab_view_unittest.mm +++ b/chrome/browser/ui/cocoa/tab_contents/sad_tab_view_unittest.mm @@ -11,8 +11,8 @@ class SadTabViewTest : public CocoaTest { public: SadTabViewTest() { NSRect content_frame = [[test_window() contentView] frame]; - scoped_nsobject<SadTabView> view([[SadTabView alloc] - initWithFrame:content_frame]); + base::scoped_nsobject<SadTabView> view( + [[SadTabView alloc] initWithFrame:content_frame]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; } diff --git a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm index 51d4c5b..5d54f76 100644 --- a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm +++ b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm @@ -6,7 +6,7 @@ #include <utility> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/devtools/devtools_window.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host_view.h" @@ -32,7 +32,7 @@ using content::WebContents; } - (void)loadView { - scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:NSZeroRect]); + base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:NSZeroRect]); [view setAutoresizingMask:NSViewHeightSizable|NSViewWidthSizable]; [self setView:view]; } diff --git a/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h b/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h index 6a88203..0ead38a 100644 --- a/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h +++ b/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h @@ -47,8 +47,8 @@ class TabModalConfirmDialogMac : public TabModalConfirmDialog, scoped_ptr<ConstrainedWindowMac> window_; scoped_ptr<TabModalConfirmDialogDelegate> delegate_; - scoped_nsobject<ConstrainedWindowAlert> alert_; - scoped_nsobject<TabModalConfirmDialogMacBridge> bridge_; + base::scoped_nsobject<ConstrainedWindowAlert> alert_; + base::scoped_nsobject<TabModalConfirmDialogMacBridge> bridge_; DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogMac); }; diff --git a/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.mm b/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.mm index ffc806f..e9b938e 100644 --- a/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.mm +++ b/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.mm @@ -4,7 +4,7 @@ #include "chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/browser_dialogs.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h" @@ -73,7 +73,7 @@ TabModalConfirmDialogMac::TabModalConfirmDialogMac( [[alert_ closeButton] setAction:@selector(onCancelButton:)]; [alert_ layout]; - scoped_nsobject<CustomConstrainedWindowSheet> sheet( + base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:[alert_ window]]); window_.reset(new ConstrainedWindowMac(this, web_contents, sheet)); diff --git a/chrome/browser/ui/cocoa/table_row_nsimage_cache.h b/chrome/browser/ui/cocoa/table_row_nsimage_cache.h index d0829fe..4932aa2 100644 --- a/chrome/browser/ui/cocoa/table_row_nsimage_cache.h +++ b/chrome/browser/ui/cocoa/table_row_nsimage_cache.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" namespace gfx { class ImageSkia; @@ -50,7 +50,7 @@ class TableRowNSImageCache { // Stores strong NSImage refs for icons. If an entry is NULL, it will be // created in GetImageForRow(). - scoped_nsobject<NSPointerArray> icon_images_; + base::scoped_nsobject<NSPointerArray> icon_images_; }; #endif // CHROME_BROWSER_UI_COCOA_TABLE_ROW_NSIMAGE_CACHE_H_ diff --git a/chrome/browser/ui/cocoa/tabpose_window.h b/chrome/browser/ui/cocoa/tabpose_window.h index 0e5a007..7651812 100644 --- a/chrome/browser/ui/cocoa/tabpose_window.h +++ b/chrome/browser/ui/cocoa/tabpose_window.h @@ -9,7 +9,7 @@ #include "base/mac/scoped_cftyperef.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" @@ -61,10 +61,10 @@ class TabStripModelObserverBridge; // Stores all preview layers. The order in here matches the order in // the tabstrip model. - scoped_nsobject<NSMutableArray> allThumbnailLayers_; + base::scoped_nsobject<NSMutableArray> allThumbnailLayers_; - scoped_nsobject<NSMutableArray> allFaviconLayers_; - scoped_nsobject<NSMutableArray> allTitleLayers_; + base::scoped_nsobject<NSMutableArray> allFaviconLayers_; + base::scoped_nsobject<NSMutableArray> allTitleLayers_; // Manages the state of all layers. scoped_ptr<tabpose::TileSet> tileSet_; diff --git a/chrome/browser/ui/cocoa/tabpose_window.mm b/chrome/browser/ui/cocoa/tabpose_window.mm index 3eb6cf2..1921489 100644 --- a/chrome/browser/ui/cocoa/tabpose_window.mm +++ b/chrome/browser/ui/cocoa/tabpose_window.mm @@ -976,10 +976,10 @@ void AnimateCALayerOpacityFromTo( showZoom:(BOOL)showZoom slomo:(BOOL)slomo animationDelegate:(id)animationDelegate { - scoped_nsobject<CALayer> layer([[ThumbnailLayer alloc] - initWithWebContents:tile.web_contents() - fullSize:tile.GetStartRectRelativeTo( - tileSet_->selected_tile()).size]); + base::scoped_nsobject<CALayer> layer( + [[ThumbnailLayer alloc] initWithWebContents:tile.web_contents() + fullSize:tile.GetStartRectRelativeTo( + tileSet_->selected_tile()).size]); [layer setNeedsDisplay]; NSTimeInterval interval = @@ -1611,15 +1611,15 @@ void AnimateCALayerOpacityFromTo( tileSet_->MoveTileFromTo(from, to); // Move corresponding layers from |from| to |to|. - scoped_nsobject<CALayer> thumbLayer( + base::scoped_nsobject<CALayer> thumbLayer( [[allThumbnailLayers_ objectAtIndex:from] retain]); [allThumbnailLayers_ removeObjectAtIndex:from]; [allThumbnailLayers_ insertObject:thumbLayer.get() atIndex:to]; - scoped_nsobject<CALayer> faviconLayer( + base::scoped_nsobject<CALayer> faviconLayer( [[allFaviconLayers_ objectAtIndex:from] retain]); [allFaviconLayers_ removeObjectAtIndex:from]; [allFaviconLayers_ insertObject:faviconLayer.get() atIndex:to]; - scoped_nsobject<CALayer> titleLayer( + base::scoped_nsobject<CALayer> titleLayer( [[allTitleLayers_ objectAtIndex:from] retain]); [allTitleLayers_ removeObjectAtIndex:from]; [allTitleLayers_ insertObject:titleLayer.get() atIndex:to]; diff --git a/chrome/browser/ui/cocoa/tabs/tab_audio_indicator_view_mac.h b/chrome/browser/ui/cocoa/tabs/tab_audio_indicator_view_mac.h index 4150bef..ca8a0d7 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_audio_indicator_view_mac.h +++ b/chrome/browser/ui/cocoa/tabs/tab_audio_indicator_view_mac.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" namespace content { diff --git a/chrome/browser/ui/cocoa/tabs/tab_audio_indicator_view_mac_unittest.mm b/chrome/browser/ui/cocoa/tabs/tab_audio_indicator_view_mac_unittest.mm index 478df04..a149d2a 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_audio_indicator_view_mac_unittest.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_audio_indicator_view_mac_unittest.mm @@ -10,13 +10,13 @@ class TabAudioIndicatorViewMacTest : public CocoaTest { protected: TabAudioIndicatorViewMacTest() { - scoped_nsobject<TabAudioIndicatorViewMac> view( + base::scoped_nsobject<TabAudioIndicatorViewMac> view( [[TabAudioIndicatorViewMac alloc] initWithFrame:NSMakeRect(0, 0, 16, 16)]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; - scoped_nsobject<NSImage> image( + base::scoped_nsobject<NSImage> image( [[NSImage alloc] initWithSize:NSMakeSize(16, 16)]); [image lockFocus]; NSRectFill(NSMakeRect(0, 0, 16, 16)); diff --git a/chrome/browser/ui/cocoa/tabs/tab_controller.h b/chrome/browser/ui/cocoa/tabs/tab_controller.h index d75d8d6..93cdbe4 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_controller.h +++ b/chrome/browser/ui/cocoa/tabs/tab_controller.h @@ -40,9 +40,9 @@ class MenuDelegate; @interface TabController : NSViewController<TabDraggingEventTarget> { @private - scoped_nsobject<NSView> iconView_; - scoped_nsobject<NSTextField> titleView_; - scoped_nsobject<HoverCloseButton> closeButton_; + base::scoped_nsobject<NSView> iconView_; + base::scoped_nsobject<NSTextField> titleView_; + base::scoped_nsobject<HoverCloseButton> closeButton_; NSRect originalIconFrame_; // frame of iconView_ as loaded from nib BOOL isIconShowing_; // last state of iconView_ in updateVisibility @@ -60,7 +60,7 @@ class MenuDelegate; SEL action_; // selector sent when tab is selected by clicking scoped_ptr<ui::SimpleMenuModel> contextMenuModel_; scoped_ptr<TabControllerInternal::MenuDelegate> contextMenuDelegate_; - scoped_nsobject<MenuController> contextMenuController_; + base::scoped_nsobject<MenuController> contextMenuController_; } @property(assign, nonatomic) TabLoadingState loadingState; diff --git a/chrome/browser/ui/cocoa/tabs/tab_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_controller.mm index 3e7924c..1006ef0 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_controller.mm @@ -102,7 +102,7 @@ class MenuDelegate : public ui::SimpleMenuModel::Delegate { // Label. titleView_.reset([[NSTextField alloc] initWithFrame:titleFrame]); [titleView_ setAutoresizingMask:NSViewWidthSizable]; - scoped_nsobject<GTMFadeTruncatingTextFieldCell> labelCell( + base::scoped_nsobject<GTMFadeTruncatingTextFieldCell> labelCell( [[GTMFadeTruncatingTextFieldCell alloc] initTextCell:@"Label"]); [labelCell setControlSize:NSSmallControlSize]; CGFloat fontSize = [NSFont systemFontSizeForControlSize:NSSmallControlSize]; @@ -118,8 +118,10 @@ class MenuDelegate : public ui::SimpleMenuModel::Delegate { [closeButton_ setTarget:self]; [closeButton_ setAction:@selector(closeTab:)]; - scoped_nsobject<TabView> view([[TabView alloc] initWithFrame: - NSMakeRect(0, 0, 160, 25) controller:self closeButton:closeButton_]); + base::scoped_nsobject<TabView> view( + [[TabView alloc] initWithFrame:NSMakeRect(0, 0, 160, 25) + controller:self + closeButton:closeButton_]); [view setAutoresizingMask:NSViewMaxXMargin | NSViewMinYMargin]; [view addSubview:iconView_]; [view addSubview:titleView_]; diff --git a/chrome/browser/ui/cocoa/tabs/tab_controller_unittest.mm b/chrome/browser/ui/cocoa/tabs/tab_controller_unittest.mm index f039c3b..ad24ca7 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_controller_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" @@ -20,7 +20,7 @@ @private bool selected_; bool closed_; - scoped_nsobject<TabStripDragController> dragController_; + base::scoped_nsobject<TabStripDragController> dragController_; } - (bool)selected; - (bool)closed; @@ -101,7 +101,7 @@ class TabControllerTest : public CocoaTest { // Tests creating the controller, sticking it in a window, and removing it. TEST_F(TabControllerTest, Creation) { NSWindow* window = test_window(); - scoped_nsobject<TabController> controller([[TabController alloc] init]); + base::scoped_nsobject<TabController> controller([[TabController alloc] init]); [[window contentView] addSubview:[controller view]]; EXPECT_TRUE([controller tabView]); EXPECT_EQ([[controller view] window], window); @@ -113,10 +113,10 @@ TEST_F(TabControllerTest, Creation) { // called. Mimics the user clicking on the close button in the tab. TEST_F(TabControllerTest, Close) { NSWindow* window = test_window(); - scoped_nsobject<TabController> controller([[TabController alloc] init]); + base::scoped_nsobject<TabController> controller([[TabController alloc] init]); [[window contentView] addSubview:[controller view]]; - scoped_nsobject<TabControllerTestTarget> target( + base::scoped_nsobject<TabControllerTestTarget> target( [[TabControllerTestTarget alloc] init]); EXPECT_FALSE([target closed]); [controller setTarget:target]; @@ -131,7 +131,7 @@ TEST_F(TabControllerTest, Close) { // Tests setting the |selected| property via code. TEST_F(TabControllerTest, APISelection) { NSWindow* window = test_window(); - scoped_nsobject<TabController> controller([[TabController alloc] init]); + base::scoped_nsobject<TabController> controller([[TabController alloc] init]); [[window contentView] addSubview:[controller view]]; EXPECT_FALSE([controller selected]); @@ -145,7 +145,7 @@ TEST_F(TabControllerTest, APISelection) { TEST_F(TabControllerTest, ToolTip) { NSWindow* window = test_window(); - scoped_nsobject<TabController> controller([[TabController alloc] init]); + base::scoped_nsobject<TabController> controller([[TabController alloc] init]); [[window contentView] addSubview:[controller view]]; EXPECT_TRUE([[controller toolTip] length] == 0); @@ -157,7 +157,7 @@ TEST_F(TabControllerTest, ToolTip) { // Tests setting the |loading| property via code. TEST_F(TabControllerTest, Loading) { NSWindow* window = test_window(); - scoped_nsobject<TabController> controller([[TabController alloc] init]); + base::scoped_nsobject<TabController> controller([[TabController alloc] init]); [[window contentView] addSubview:[controller view]]; EXPECT_EQ(kTabDone, [controller loadingState]); @@ -178,7 +178,7 @@ TEST_F(TabControllerTest, UserSelection) { // Create a tab at a known location in the window that we can click on // to activate selection. - scoped_nsobject<TabController> controller([[TabController alloc] init]); + base::scoped_nsobject<TabController> controller([[TabController alloc] init]); [[window contentView] addSubview:[controller view]]; NSRect frame = [[controller view] frame]; frame.size.width = [TabController minTabWidth]; @@ -186,7 +186,7 @@ TEST_F(TabControllerTest, UserSelection) { [[controller view] setFrame:frame]; // Set the target and action. - scoped_nsobject<TabControllerTestTarget> target( + base::scoped_nsobject<TabControllerTestTarget> target( [[TabControllerTestTarget alloc] init]); EXPECT_FALSE([target selected]); [controller setTarget:target]; @@ -224,7 +224,7 @@ TEST_F(TabControllerTest, UserSelection) { TEST_F(TabControllerTest, IconCapacity) { NSWindow* window = test_window(); - scoped_nsobject<TabController> controller([[TabController alloc] init]); + base::scoped_nsobject<TabController> controller([[TabController alloc] init]); [[window contentView] addSubview:[controller view]]; int cap = [controller iconCapacity]; EXPECT_GE(cap, 1); @@ -238,7 +238,7 @@ TEST_F(TabControllerTest, IconCapacity) { TEST_F(TabControllerTest, ShouldShowIcon) { NSWindow* window = test_window(); - scoped_nsobject<TabController> controller([[TabController alloc] init]); + base::scoped_nsobject<TabController> controller([[TabController alloc] init]); [[window contentView] addSubview:[controller view]]; int cap = [controller iconCapacity]; EXPECT_GT(cap, 0); @@ -251,7 +251,7 @@ TEST_F(TabControllerTest, ShouldShowIcon) { EXPECT_FALSE([controller shouldShowCloseButton]); // Setting the icon when tab is at min width should not show icon (bug 18359). - scoped_nsobject<NSView> newIcon( + base::scoped_nsobject<NSView> newIcon( [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 16, 16)]); [controller setIconView:newIcon.get()]; EXPECT_TRUE([newIcon isHidden]); @@ -283,8 +283,8 @@ TEST_F(TabControllerTest, ShouldShowIcon) { TEST_F(TabControllerTest, Menu) { NSWindow* window = test_window(); - scoped_nsobject<TabController> controller([[TabController alloc] init]); - scoped_nsobject<TabControllerTestTarget> target( + base::scoped_nsobject<TabController> controller([[TabController alloc] init]); + base::scoped_nsobject<TabControllerTestTarget> target( [[TabControllerTestTarget alloc] init]); [controller setTarget:target]; @@ -303,7 +303,7 @@ TEST_F(TabControllerTest, Menu) { TEST_F(TabControllerTest, TitleViewLayout) { NSWindow* window = test_window(); - scoped_nsobject<TabController> controller([[TabController alloc] init]); + base::scoped_nsobject<TabController> controller([[TabController alloc] init]); [[window contentView] addSubview:[controller view]]; NSRect tabFrame = [[controller view] frame]; tabFrame.size.width = [TabController maxTabWidth]; diff --git a/chrome/browser/ui/cocoa/tabs/tab_projecting_image_view.h b/chrome/browser/ui/cocoa/tabs/tab_projecting_image_view.h index 9b07b5b..7f74b16 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_projecting_image_view.h +++ b/chrome/browser/ui/cocoa/tabs/tab_projecting_image_view.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/ui/cocoa/tabs/throbbing_image_view.h" @@ -16,7 +16,7 @@ // animated glow. This view paints outside the favicon bounds due to the glow. @interface TabProjectingImageView : ThrobbingImageView { @private - scoped_nsobject<NSImage> projectorImage_; + base::scoped_nsobject<NSImage> projectorImage_; } - (id)initWithFrame:(NSRect)rect diff --git a/chrome/browser/ui/cocoa/tabs/tab_projecting_image_view_unittest.mm b/chrome/browser/ui/cocoa/tabs/tab_projecting_image_view_unittest.mm index 25bc7dd..ab10080 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_projecting_image_view_unittest.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_projecting_image_view_unittest.mm @@ -14,31 +14,31 @@ namespace { class TabProjectingImageViewTest : public CocoaTest { public: TabProjectingImageViewTest() { - scoped_nsobject<NSImage> backgroundImage( + base::scoped_nsobject<NSImage> backgroundImage( [[NSImage alloc] initWithSize:NSMakeSize(16, 16)]); [backgroundImage lockFocus]; NSRectFill(NSMakeRect(0, 0, 16, 16)); [backgroundImage unlockFocus]; - scoped_nsobject<NSImage> projectorImage( + base::scoped_nsobject<NSImage> projectorImage( [[NSImage alloc] initWithSize:NSMakeSize(16, 16)]); [projectorImage lockFocus]; NSRectFill(NSMakeRect(0, 0, 16, 16)); [projectorImage unlockFocus]; - scoped_nsobject<NSImage> throbImage( + base::scoped_nsobject<NSImage> throbImage( [[NSImage alloc] initWithSize:NSMakeSize(32, 32)]); [throbImage lockFocus]; NSRectFill(NSMakeRect(0, 0, 32, 32)); [throbImage unlockFocus]; - scoped_nsobject<TabProjectingImageView> view([[TabProjectingImageView alloc] - initWithFrame:NSMakeRect(0, 0, 32, 32) - backgroundImage:backgroundImage - projectorImage:projectorImage - throbImage:throbImage - durationMS:20 - animationContainer:NULL]); + base::scoped_nsobject<TabProjectingImageView> view( + [[TabProjectingImageView alloc] initWithFrame:NSMakeRect(0, 0, 32, 32) + backgroundImage:backgroundImage + projectorImage:projectorImage + throbImage:throbImage + durationMS:20 + animationContainer:NULL]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; } diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.h b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.h index dc5e357..216ff3b 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.h +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/tabs/tab_controller_target.h" #import "chrome/browser/ui/cocoa/url_drop_target.h" @@ -61,16 +61,17 @@ class AnimationContainer; NSObject<TabControllerTarget, URLDropTargetController> { @private - scoped_nsobject<TabStripView> tabStripView_; + base::scoped_nsobject<TabStripView> tabStripView_; NSView* switchView_; // weak - scoped_nsobject<NSView> dragBlockingView_; // avoid bad window server drags + base::scoped_nsobject<NSView> dragBlockingView_; // avoid bad window server + // drags NewTabButton* newTabButton_; // weak, obtained from the nib. // The controller that manages all the interactions of dragging tabs. - scoped_nsobject<TabStripDragController> dragController_; + base::scoped_nsobject<TabStripDragController> dragController_; // Tracks the newTabButton_ for rollovers. - scoped_nsobject<CrTrackingArea> newTabTrackingArea_; + base::scoped_nsobject<CrTrackingArea> newTabTrackingArea_; scoped_ptr<TabStripModelObserverBridge> bridge_; Browser* browser_; // weak TabStripModel* tabStripModel_; // weak @@ -89,14 +90,14 @@ class AnimationContainer; // tabs are animating closed (closed tabs are removed from |tabStripModel_| // immediately, but from |tabContentsArray_| only after their close animation // has completed). - scoped_nsobject<NSMutableArray> tabContentsArray_; + base::scoped_nsobject<NSMutableArray> tabContentsArray_; // An array of TabControllers which manage the actual tab views. See note // above |tabContentsArray_|. |tabContentsArray_| and |tabArray_| always // contain objects belonging to the same tabs at the same indices. - scoped_nsobject<NSMutableArray> tabArray_; + base::scoped_nsobject<NSMutableArray> tabArray_; // Set of TabControllers that are currently animating closed. - scoped_nsobject<NSMutableSet> closingControllers_; + base::scoped_nsobject<NSMutableSet> closingControllers_; // These values are only used during a drag, and override tab positioning. TabView* placeholderTab_; // weak. Tab being dragged @@ -105,7 +106,7 @@ class AnimationContainer; // Frame targets for all the current views. // target frames are used because repeated requests to [NSView animator]. // aren't coalesced, so we store frames to avoid redundant calls. - scoped_nsobject<NSMutableDictionary> targetFrames_; + base::scoped_nsobject<NSMutableDictionary> targetFrames_; NSRect newTabTargetFrame_; // If YES, do not show the new tab button during layout. BOOL forceNewTabButtonHidden_; @@ -121,15 +122,15 @@ class AnimationContainer; float availableResizeWidth_; // A tracking area that's the size of the tab strip used to be notified // when the mouse moves in the tab strip - scoped_nsobject<CrTrackingArea> trackingArea_; + base::scoped_nsobject<CrTrackingArea> trackingArea_; TabView* hoveredTab_; // weak. Tab that the mouse is hovering over // Array of subviews which are permanent (and which should never be removed), // such as the new-tab button, but *not* the tabs themselves. - scoped_nsobject<NSMutableArray> permanentSubviews_; + base::scoped_nsobject<NSMutableArray> permanentSubviews_; // The default favicon, so we can use one copy for all buttons. - scoped_nsobject<NSImage> defaultFavicon_; + base::scoped_nsobject<NSImage> defaultFavicon_; // The amount by which to indent the tabs on the sides (to make room for the // red/yellow/green and incognito/fullscreen buttons). diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm index de91256..cdd9b2a 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm @@ -162,7 +162,7 @@ private: // 10.6 and 10.7. NSImage* CreateImageWithSize(NSSize size, void (^drawingHandler)(NSSize)) { - scoped_nsobject<NSImage> result([[NSImage alloc] initWithSize:size]); + base::scoped_nsobject<NSImage> result([[NSImage alloc] initWithSize:size]); [NSGraphicsContext saveGraphicsState]; for (ui::ScaleFactor scale_factor : ui::GetSupportedScaleFactors()) { float scale = GetScaleFactorScale(scale_factor); @@ -1296,7 +1296,7 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) { // Make a new tab. Load the contents of this tab from the nib and associate // the new controller with |contents| so it can be looked up later. - scoped_nsobject<TabContentsController> contentsController( + base::scoped_nsobject<TabContentsController> contentsController( [[TabContentsController alloc] initWithContents:contents]); [tabContentsArray_ insertObject:contentsController atIndex:index]; @@ -1410,7 +1410,7 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) { // Simply create a new TabContentsController for |newContents| and place it // into the array, replacing |oldContents|. An ActiveTabChanged notification // will follow, at which point we will install the new view. - scoped_nsobject<TabContentsController> newController( + base::scoped_nsobject<TabContentsController> newController( [[TabContentsController alloc] initWithContents:newContents]); // Bye bye, |oldController|. @@ -1491,9 +1491,9 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) { NSView* tabView = [closingTab view]; CAAnimation* animation = [[tabView animationForKey:@"frameOrigin"] copy]; [animation autorelease]; - scoped_nsobject<TabCloseAnimationDelegate> delegate( - [[TabCloseAnimationDelegate alloc] initWithTabStrip:self - tabController:closingTab]); + base::scoped_nsobject<TabCloseAnimationDelegate> delegate( + [[TabCloseAnimationDelegate alloc] initWithTabStrip:self + tabController:closingTab]); [animation setDelegate:delegate.get()]; // Retains delegate. NSMutableDictionary* animationDictionary = [NSMutableDictionary dictionaryWithDictionary:[tabView animations]]; @@ -1746,12 +1746,12 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) { // Cancel any pending tab transition. hoverTabSelector_->CancelTabTransition(); - scoped_nsobject<TabContentsController> movedTabContentsController( + base::scoped_nsobject<TabContentsController> movedTabContentsController( [[tabContentsArray_ objectAtIndex:from] retain]); [tabContentsArray_ removeObjectAtIndex:from]; [tabContentsArray_ insertObject:movedTabContentsController.get() atIndex:to]; - scoped_nsobject<TabController> movedTabController( + base::scoped_nsobject<TabController> movedTabController( [[tabArray_ objectAtIndex:from] retain]); DCHECK([movedTabController isKindOfClass:[TabController class]]); [tabArray_ removeObjectAtIndex:from]; diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller_unittest.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller_unittest.mm index 025caae..cf230d1 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller_unittest.mm @@ -93,7 +93,7 @@ class TabStripControllerTest : public CocoaProfileTest { // Create the "switch view" (view that gets changed out when a tab // switches). NSRect switch_frame = NSMakeRect(0, 0, content_frame.size.width, 500); - scoped_nsobject<NSView> switch_view( + base::scoped_nsobject<NSView> switch_view( [[NSView alloc] initWithFrame:switch_frame]); [parent addSubview:switch_view.get()]; @@ -105,7 +105,7 @@ class TabStripControllerTest : public CocoaProfileTest { [[TabStripView alloc] initWithFrame:strip_frame]); [parent addSubview:tab_strip_.get()]; NSRect button_frame = NSMakeRect(0, 0, 15, 15); - scoped_nsobject<NewTabButton> new_tab_button( + base::scoped_nsobject<NewTabButton> new_tab_button( [[NewTabButton alloc] initWithFrame:button_frame]); [tab_strip_ addSubview:new_tab_button.get()]; [tab_strip_ setNewTabButton:new_tab_button.get()]; @@ -152,9 +152,9 @@ class TabStripControllerTest : public CocoaProfileTest { scoped_ptr<TestTabStripModelDelegate> delegate_; TabStripModel* model_; - scoped_nsobject<TestTabStripControllerDelegate> controller_delegate_; - scoped_nsobject<TabStripController> controller_; - scoped_nsobject<TabStripView> tab_strip_; + base::scoped_nsobject<TestTabStripControllerDelegate> controller_delegate_; + base::scoped_nsobject<TabStripController> controller_; + base::scoped_nsobject<TabStripView> tab_strip_; }; // Test adding and removing tabs and making sure that views get added to @@ -240,10 +240,9 @@ TEST_F(TabStripControllerTest, TabCloseDuringDrag) { // Schedule a task to close all the tabs and stop the drag, before the call to // -maybeStartDrag:forTab:, which starts a nested event loop. This task will // run in that nested event loop, which shouldn't crash. - scoped_nsobject<TestClosureRunner> runner( - [[TestClosureRunner alloc] initWithClosure: - base::Bind(&TabStripControllerTest::CloseTabsAndEndDrag, - base::Unretained(this))]); + base::scoped_nsobject<TestClosureRunner> runner([[TestClosureRunner alloc] + initWithClosure:base::Bind(&TabStripControllerTest::CloseTabsAndEndDrag, + base::Unretained(this))]); [runner scheduleDelayedRun]; NSEvent* event = diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm index 2a338bb..e24351a 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm @@ -108,8 +108,8 @@ const NSTimeInterval kTearDuration = 0.333; // When spinning the event loop, a tab can get detached, which could lead to // our own destruction. Keep ourselves around while spinning the loop as well // as the tab controller being dragged. - scoped_nsobject<TabStripDragController> keepAlive([self retain]); - scoped_nsobject<TabController> keepAliveTab([tab retain]); + base::scoped_nsobject<TabStripDragController> keepAlive([self retain]); + base::scoped_nsobject<TabController> keepAliveTab([tab retain]); // Because we move views between windows, we need to handle the event loop // ourselves. Ideally we should use the standard event loop. diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_view.h b/chrome/browser/ui/cocoa/tabs/tab_strip_view.h index 1cb4ba2..d2c1c36 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_view.h +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_view.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/url_drop_target.h" @class NewTabButton; @@ -23,9 +23,9 @@ NSTimeInterval lastMouseUp_; // Handles being a drag-and-drop target. - scoped_nsobject<URLDropTargetHandler> dropHandler_; + base::scoped_nsobject<URLDropTargetHandler> dropHandler_; - scoped_nsobject<NewTabButton> newTabButton_; + base::scoped_nsobject<NewTabButton> newTabButton_; // Whether the drop-indicator arrow is shown, and if it is, the coordinate of // its tip. diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_view_unittest.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_view_unittest.mm index d7961aa..ed816bf 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_view_unittest.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_view_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" #include "testing/gtest/include/gtest/gtest.h" @@ -16,7 +16,7 @@ class TabStripViewTest : public CocoaTest { public: TabStripViewTest() { NSRect frame = NSMakeRect(0, 0, 100, 30); - scoped_nsobject<TabStripView> view( + base::scoped_nsobject<TabStripView> view( [[TabStripView alloc] initWithFrame:frame]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; diff --git a/chrome/browser/ui/cocoa/tabs/tab_view.h b/chrome/browser/ui/cocoa/tabs/tab_view.h index 69d68d9..f5c3177 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_view.h +++ b/chrome/browser/ui/cocoa/tabs/tab_view.h @@ -5,11 +5,11 @@ #ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_VIEW_H_ #define CHROME_BROWSER_UI_COCOA_TABS_TAB_VIEW_H_ -#import <Cocoa/Cocoa.h> #include <ApplicationServices/ApplicationServices.h> +#import <Cocoa/Cocoa.h> #include "base/mac/scoped_cftyperef.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/hover_close_button.h" namespace tabs { @@ -70,7 +70,7 @@ const CGFloat kImageNoFocusAlpha = 0.65; NSCellStateValue state_; // The tool tip text for this tab view. - scoped_nsobject<NSString> toolTipText_; + base::scoped_nsobject<NSString> toolTipText_; // A one-element mask image cache. This cache makes drawing roughly 16% // faster. diff --git a/chrome/browser/ui/cocoa/tabs/tab_view.mm b/chrome/browser/ui/cocoa/tabs/tab_view.mm index 443f86b..cda5b8e 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_view.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_view.mm @@ -211,7 +211,7 @@ const CGFloat kRapidCloseDist = 2.5; // strip and then deallocated. This will also result in *us* being // deallocated. Both these are bad, so we prevent this by retaining the // controller. - scoped_nsobject<TabController> controller([controller_ retain]); + base::scoped_nsobject<TabController> controller([controller_ retain]); // Try to initiate a drag. This will spin a custom event loop and may // dispatch other mouse events. @@ -379,7 +379,7 @@ const CGFloat kRapidCloseDist = 2.5; // Draw a mouse hover gradient for the default themes. if (!selected && hoverAlpha > 0) { if (themeProvider && !hasCustomTheme) { - scoped_nsobject<NSGradient> glow([NSGradient alloc]); + base::scoped_nsobject<NSGradient> glow([NSGradient alloc]); [glow initWithStartingColor:[NSColor colorWithCalibratedWhite:1.0 alpha:1.0 * hoverAlpha] endingColor:[NSColor colorWithCalibratedWhite:1.0 diff --git a/chrome/browser/ui/cocoa/tabs/tab_view_unittest.mm b/chrome/browser/ui/cocoa/tabs/tab_view_unittest.mm index e5f6c12..ccc1216 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_view_unittest.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_view_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/tabs/tab_view.h" #include "testing/gtest/include/gtest/gtest.h" @@ -19,7 +19,7 @@ class TabViewTest : public CocoaTest { public: TabViewTest() { NSRect frame = NSMakeRect(0, 0, kTabWidth, kTabHeight); - scoped_nsobject<TabView> view([[TabView alloc] initWithFrame:frame]); + base::scoped_nsobject<TabView> view([[TabView alloc] initWithFrame:frame]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; } diff --git a/chrome/browser/ui/cocoa/tabs/tab_window_controller.h b/chrome/browser/ui/cocoa/tabs/tab_window_controller.h index 4242c2d..70693ff 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_window_controller.h +++ b/chrome/browser/ui/cocoa/tabs/tab_window_controller.h @@ -14,7 +14,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" @class FastResizeView; @class FocusTracker; @@ -23,8 +23,8 @@ @interface TabWindowController : NSWindowController<NSWindowDelegate> { @private - scoped_nsobject<FastResizeView> tabContentArea_; - scoped_nsobject<TabStripView> tabStripView_; + base::scoped_nsobject<FastResizeView> tabContentArea_; + base::scoped_nsobject<TabStripView> tabStripView_; // The child window used during dragging to achieve the opacity tricks. NSWindow* overlayWindow_; @@ -33,7 +33,7 @@ // of the drag) to the |overlayWindow_|. NSView* originalContentView_; // weak - scoped_nsobject<FocusTracker> focusBeforeOverlay_; + base::scoped_nsobject<FocusTracker> focusBeforeOverlay_; BOOL closeDeferred_; // If YES, call performClose: in removeOverlay:. } @property(readonly, nonatomic) TabStripView* tabStripView; diff --git a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm index fa7a5e7..e49c875 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm @@ -45,7 +45,7 @@ - (id)initTabWindowControllerWithTabStrip:(BOOL)hasTabStrip { NSRect contentRect = NSMakeRect(60, 229, 750, 600); - scoped_nsobject<FramedBrowserWindow> window( + base::scoped_nsobject<FramedBrowserWindow> window( [[FramedBrowserWindow alloc] initWithContentRect:contentRect hasTabStrip:hasTabStrip]); [window setReleasedWhenClosed:YES]; diff --git a/chrome/browser/ui/cocoa/tabs/throbber_view.h b/chrome/browser/ui/cocoa/tabs/throbber_view.h index 6e90ec0..4e124f9 100644 --- a/chrome/browser/ui/cocoa/tabs/throbber_view.h +++ b/chrome/browser/ui/cocoa/tabs/throbber_view.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" @protocol ThrobberDataDelegate; diff --git a/chrome/browser/ui/cocoa/tabs/throbber_view.mm b/chrome/browser/ui/cocoa/tabs/throbber_view.mm index 29cc6df..6abc29a 100644 --- a/chrome/browser/ui/cocoa/tabs/throbber_view.mm +++ b/chrome/browser/ui/cocoa/tabs/throbber_view.mm @@ -29,7 +29,7 @@ static const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows @interface ThrobberFilmstripDelegate : NSObject <ThrobberDataDelegate> { - scoped_nsobject<NSImage> image_; + base::scoped_nsobject<NSImage> image_; unsigned int numFrames_; // Number of frames in this animation. unsigned int animationFrame_; // Current frame of the animation, // [0..numFrames_) @@ -83,8 +83,8 @@ static const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows @interface ThrobberToastDelegate : NSObject <ThrobberDataDelegate> { - scoped_nsobject<NSImage> image1_; - scoped_nsobject<NSImage> image2_; + base::scoped_nsobject<NSImage> image1_; + base::scoped_nsobject<NSImage> image2_; NSSize image1Size_; NSSize image2Size_; int animationFrame_; // Current frame of the animation, diff --git a/chrome/browser/ui/cocoa/tabs/throbber_view_unittest.mm b/chrome/browser/ui/cocoa/tabs/throbber_view_unittest.mm index de7f295..22e72cc 100644 --- a/chrome/browser/ui/cocoa/tabs/throbber_view_unittest.mm +++ b/chrome/browser/ui/cocoa/tabs/throbber_view_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/tabs/throbber_view.h" #include "grit/ui_resources.h" diff --git a/chrome/browser/ui/cocoa/tabs/throbbing_image_view.h b/chrome/browser/ui/cocoa/tabs/throbbing_image_view.h index 1cd8d60..4cf9486 100644 --- a/chrome/browser/ui/cocoa/tabs/throbbing_image_view.h +++ b/chrome/browser/ui/cocoa/tabs/throbbing_image_view.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "ui/base/animation/throb_animation.h" @@ -23,8 +23,8 @@ enum ThrobPosition { @interface ThrobbingImageView : NSView { @protected - scoped_nsobject<NSImage> backgroundImage_; - scoped_nsobject<NSImage> throbImage_; + base::scoped_nsobject<NSImage> backgroundImage_; + base::scoped_nsobject<NSImage> throbImage_; scoped_ptr<ui::ThrobAnimation> throbAnimation_; @private diff --git a/chrome/browser/ui/cocoa/tabs/throbbing_image_view_unittest.mm b/chrome/browser/ui/cocoa/tabs/throbbing_image_view_unittest.mm index 33f7f41..703d97b 100644 --- a/chrome/browser/ui/cocoa/tabs/throbbing_image_view_unittest.mm +++ b/chrome/browser/ui/cocoa/tabs/throbbing_image_view_unittest.mm @@ -14,19 +14,19 @@ namespace { class ThrobbingImageViewTest : public CocoaTest { public: ThrobbingImageViewTest() { - scoped_nsobject<NSImage> image( + base::scoped_nsobject<NSImage> image( [[NSImage alloc] initWithSize:NSMakeSize(16, 16)]); [image lockFocus]; NSRectFill(NSMakeRect(0, 0, 16, 16)); [image unlockFocus]; - scoped_nsobject<ThrobbingImageView> view([[ThrobbingImageView alloc] - initWithFrame:NSMakeRect(0, 0, 16, 16) - backgroundImage:image - throbImage:image - durationMS:20 - throbPosition:kThrobPositionOverlay - animationContainer:NULL]); + base::scoped_nsobject<ThrobbingImageView> view( + [[ThrobbingImageView alloc] initWithFrame:NSMakeRect(0, 0, 16, 16) + backgroundImage:image + throbImage:image + durationMS:20 + throbPosition:kThrobPositionOverlay + animationContainer:NULL]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; } diff --git a/chrome/browser/ui/cocoa/task_manager_mac.h b/chrome/browser/ui/cocoa/task_manager_mac.h index 6e804b9..093f9f4 100644 --- a/chrome/browser/ui/cocoa/task_manager_mac.h +++ b/chrome/browser/ui/cocoa/task_manager_mac.h @@ -8,7 +8,7 @@ #import <Cocoa/Cocoa.h> #include <vector> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/task_manager/task_manager.h" #include "chrome/browser/ui/cocoa/table_row_nsimage_cache.h" @@ -31,7 +31,7 @@ class ImageSkia; TaskManager* taskManager_; // weak TaskManagerModel* model_; // weak - scoped_nsobject<WindowSizeAutosaver> size_saver_; + base::scoped_nsobject<WindowSizeAutosaver> size_saver_; // These contain a permutation of [0..|model_->ResourceCount() - 1|]. Used to // implement sorting. @@ -39,7 +39,7 @@ class ImageSkia; std::vector<int> modelToViewMap_; // Descriptor of the current sort column. - scoped_nsobject<NSSortDescriptor> currentSortDescriptor_; + base::scoped_nsobject<NSSortDescriptor> currentSortDescriptor_; } // Creates and shows the task manager's window. diff --git a/chrome/browser/ui/cocoa/task_manager_mac.mm b/chrome/browser/ui/cocoa/task_manager_mac.mm index 62fe460..a75e706 100644 --- a/chrome/browser/ui/cocoa/task_manager_mac.mm +++ b/chrome/browser/ui/cocoa/task_manager_mac.mm @@ -216,7 +216,7 @@ class SortHelper { // Adds a column which has the given string id as title. |isVisible| specifies // if the column is initially visible. - (NSTableColumn*)addColumnWithId:(int)columnId visible:(BOOL)isVisible { - scoped_nsobject<NSTableColumn> column([[NSTableColumn alloc] + base::scoped_nsobject<NSTableColumn> column([[NSTableColumn alloc] initWithIdentifier:[NSString stringWithFormat:@"%d", columnId]]); NSTextAlignment textAlignment = @@ -238,9 +238,10 @@ class SortHelper { // The page column should by default be sorted ascending. BOOL ascending = columnId == IDS_TASK_MANAGER_TASK_COLUMN; - scoped_nsobject<NSSortDescriptor> sortDescriptor([[NSSortDescriptor alloc] - initWithKey:[NSString stringWithFormat:@"%d", columnId] - ascending:ascending]); + base::scoped_nsobject<NSSortDescriptor> sortDescriptor( + [[NSSortDescriptor alloc] + initWithKey:[NSString stringWithFormat:@"%d", columnId] + ascending:ascending]); [column.get() setSortDescriptorPrototype:sortDescriptor.get()]; // Default values, only used in release builds if nobody notices the DCHECK @@ -275,7 +276,7 @@ class SortHelper { visible:YES]; // |nameColumn| displays an icon for every row -- this is done by an // NSButtonCell. - scoped_nsobject<NSButtonCell> nameCell( + base::scoped_nsobject<NSButtonCell> nameCell( [[NSButtonCell alloc] initTextCell:@""]); [nameCell.get() setImagePosition:NSImageLeft]; [nameCell.get() setButtonType:NSSwitchButton]; @@ -310,7 +311,7 @@ class SortHelper { // which columns should be shown and which should be hidden (like e.g. // Task Manager.app's table header context menu). - (void)setUpTableHeaderContextMenu { - scoped_nsobject<NSMenu> contextMenu( + base::scoped_nsobject<NSMenu> contextMenu( [[NSMenu alloc] initWithTitle:@"Task Manager context menu"]); for (NSTableColumn* column in [tableView_ tableColumns]) { NSMenuItem* item = [contextMenu.get() diff --git a/chrome/browser/ui/cocoa/task_manager_mac_unittest.mm b/chrome/browser/ui/cocoa/task_manager_mac_unittest.mm index b849012..bda53cc 100644 --- a/chrome/browser/ui/cocoa/task_manager_mac_unittest.mm +++ b/chrome/browser/ui/cocoa/task_manager_mac_unittest.mm @@ -5,7 +5,7 @@ #import <Cocoa/Cocoa.h> #include "base/compiler_specific.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/task_manager/resource_provider.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" diff --git a/chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.h b/chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.h index 282ff77..e186341 100644 --- a/chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.h +++ b/chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" @@ -27,7 +27,7 @@ const BackForwardMenuType BACK_FORWARD_MENU_TYPE_FORWARD = BackForwardMenuType type_; MenuButton* button_; // Weak; comes from nib. scoped_ptr<BackForwardMenuModel> model_; - scoped_nsobject<NSMenu> backForwardMenu_; + base::scoped_nsobject<NSMenu> backForwardMenu_; } // Type (back or forwards); can only be set on initialization. diff --git a/chrome/browser/ui/cocoa/toolbar/reload_button_unittest.mm b/chrome/browser/ui/cocoa/toolbar/reload_button_unittest.mm index c7eccd9..b8079c9 100644 --- a/chrome/browser/ui/cocoa/toolbar/reload_button_unittest.mm +++ b/chrome/browser/ui/cocoa/toolbar/reload_button_unittest.mm @@ -6,7 +6,7 @@ #import "chrome/browser/ui/cocoa/toolbar/reload_button.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/app/chrome_command_ids.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/image_button_cell.h" @@ -29,7 +29,7 @@ class ReloadButtonTest : public CocoaTest { public: ReloadButtonTest() { NSRect frame = NSMakeRect(0, 0, 20, 20); - scoped_nsobject<ReloadButton> button( + base::scoped_nsobject<ReloadButton> button( [[ReloadButton alloc] initWithFrame:frame]); button_ = button.get(); diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_button_unittest.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_button_unittest.mm index 3ebbefc..48a7dd3 100644 --- a/chrome/browser/ui/cocoa/toolbar/toolbar_button_unittest.mm +++ b/chrome/browser/ui/cocoa/toolbar/toolbar_button_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "chrome/app/chrome_command_ids.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/toolbar/toolbar_button.h" @@ -54,7 +54,7 @@ class ToolbarButtonTest : public CocoaTest { public: ToolbarButtonTest() { NSRect frame = NSMakeRect(0, 0, 20, 20); - scoped_nsobject<TestableToolbarButton> button( + base::scoped_nsobject<TestableToolbarButton> button( [[TestableToolbarButton alloc] initWithFrame:frame]); button_ = button.get(); diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.h b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.h index 6fdbd58..07a0bf5 100644 --- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.h +++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/prefs/pref_member.h" #import "chrome/browser/ui/cocoa/command_observer_bridge.h" @@ -64,14 +64,15 @@ class NotificationBridge; Browser* browser_; // weak, one per window scoped_ptr<CommandObserverBridge> commandObserver_; scoped_ptr<LocationBarViewMac> locationBarView_; - scoped_nsobject<AutocompleteTextFieldEditor> autocompleteTextFieldEditor_; + base::scoped_nsobject<AutocompleteTextFieldEditor> + autocompleteTextFieldEditor_; id<ViewResizer> resizeDelegate_; // weak - scoped_nsobject<BackForwardMenuController> backMenuController_; - scoped_nsobject<BackForwardMenuController> forwardMenuController_; - scoped_nsobject<BrowserActionsController> browserActionsController_; + base::scoped_nsobject<BackForwardMenuController> backMenuController_; + base::scoped_nsobject<BackForwardMenuController> forwardMenuController_; + base::scoped_nsobject<BrowserActionsController> browserActionsController_; // Lazily-instantiated menu controller. - scoped_nsobject<WrenchMenuController> wrenchMenuController_; + base::scoped_nsobject<WrenchMenuController> wrenchMenuController_; // Used for monitoring the optional toolbar button prefs. scoped_ptr<ToolbarControllerInternal::NotificationBridge> notificationBridge_; @@ -82,7 +83,7 @@ class NotificationBridge; // We have an extra retain in the locationBar_. // See comments in awakeFromNib for more info. - scoped_nsobject<AutocompleteTextField> locationBarRetainer_; + base::scoped_nsobject<AutocompleteTextField> locationBarRetainer_; // Tracking area for mouse enter/exit/moved in the toolbar. ui::ScopedCrTrackingArea trackingArea_; diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller_unittest.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_controller_unittest.mm index 7491229..8fb005e 100644 --- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#import "base/memory/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/prefs/pref_service.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/command_updater.h" @@ -89,8 +89,8 @@ class ToolbarControllerTest : public CocoaProfileTest { [[views objectAtIndex:kHomeIndex] isEnabled] ? true : false); } - scoped_nsobject<ViewResizerPong> resizeDelegate_; - scoped_nsobject<ToolbarController> bar_; + base::scoped_nsobject<ViewResizerPong> resizeDelegate_; + base::scoped_nsobject<ToolbarController> bar_; }; TEST_VIEW(ToolbarControllerTest, [bar_ view]) @@ -215,8 +215,8 @@ TEST_F(ToolbarControllerTest, BookmarkBubblePoint) { } TEST_F(ToolbarControllerTest, HoverButtonForEvent) { - scoped_nsobject<HitView> view([[HitView alloc] - initWithFrame:NSMakeRect(0,0,100,100)]); + base::scoped_nsobject<HitView> view( + [[HitView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]); [bar_ setView:view]; NSEvent* event = [NSEvent mouseEventWithType:NSMouseMoved location:NSMakePoint(10,10) @@ -233,12 +233,13 @@ TEST_F(ToolbarControllerTest, HoverButtonForEvent) { EXPECT_FALSE([bar_ hoverButtonForEvent:event]); // Not yet... - scoped_nsobject<NSButton> button([[NSButton alloc] init]); + base::scoped_nsobject<NSButton> button([[NSButton alloc] init]); [view setHitTestReturn:button]; EXPECT_FALSE([bar_ hoverButtonForEvent:event]); // Now! - scoped_nsobject<GradientButtonCell> cell([[GradientButtonCell alloc] init]); + base::scoped_nsobject<GradientButtonCell> cell( + [[GradientButtonCell alloc] init]); [button setCell:cell.get()]; EXPECT_TRUE([bar_ hoverButtonForEvent:nil]); } diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_view_unittest.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_view_unittest.mm index f6bb035..4bdeb56 100644 --- a/chrome/browser/ui/cocoa/toolbar/toolbar_view_unittest.mm +++ b/chrome/browser/ui/cocoa/toolbar/toolbar_view_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/toolbar/toolbar_view.h" #include "testing/gtest/include/gtest/gtest.h" @@ -16,7 +16,7 @@ class ToolbarViewTest : public CocoaTest { // This class only needs to do one thing: prevent mouse down events from moving // the parent window around. TEST_F(ToolbarViewTest, CanDragWindow) { - scoped_nsobject<ToolbarView> view([[ToolbarView alloc] init]); + base::scoped_nsobject<ToolbarView> view([[ToolbarView alloc] init]); EXPECT_FALSE([view mouseDownCanMoveWindow]); } diff --git a/chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell_unittest.mm b/chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell_unittest.mm index 79ee865..416a500 100644 --- a/chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell_unittest.mm @@ -21,14 +21,14 @@ class WrenchToolbarButtonCellTest : public CocoaTest { protected: WrenchToolbarButtonCellTest() { - scoped_nsobject<NSButton> button([[TestWrenchToolbarButton alloc] + base::scoped_nsobject<NSButton> button([[TestWrenchToolbarButton alloc] initWithFrame:NSMakeRect(0, 0, 29, 29)]); button_ = button; [[test_window() contentView] addSubview:button_]; } NSButton* button_; - scoped_nsobject<WrenchToolbarButtonCell> cell_; + base::scoped_nsobject<WrenchToolbarButtonCell> cell_; base::MessageLoopForUI message_loop_; // Needed for ui::Animation. private: diff --git a/chrome/browser/ui/cocoa/validation_message_bubble_cocoa.mm b/chrome/browser/ui/cocoa/validation_message_bubble_cocoa.mm index 54cffda..362fd18 100644 --- a/chrome/browser/ui/cocoa/validation_message_bubble_cocoa.mm +++ b/chrome/browser/ui/cocoa/validation_message_bubble_cocoa.mm @@ -32,12 +32,12 @@ anchoredAt:(NSPoint)anchorPoint mainText:(const string16&)mainText subText:(const string16&)subText { - scoped_nsobject<InfoBubbleWindow> window([[InfoBubbleWindow alloc] - initWithContentRect: - NSMakeRect(0, 0, kWindowInitialWidth, kWindowInitialHeight) - styleMask:NSBorderlessWindowMask - backing:NSBackingStoreBuffered - defer:NO]); + base::scoped_nsobject<InfoBubbleWindow> window( + [[InfoBubbleWindow alloc] initWithContentRect: + NSMakeRect(0, 0, kWindowInitialWidth, kWindowInitialHeight) + styleMask:NSBorderlessWindowMask + backing:NSBackingStoreBuffered + defer:NO]); if ((self = [super initWithWindow:window.get() parentWindow:parentWindow anchoredAt:anchorPoint])) { @@ -66,7 +66,7 @@ anchoredAt:(NSPoint)anchorPoint NSImage* image = ResourceBundle::GetSharedInstance() .GetNativeImageNamed(IDR_INPUT_ALERT).ToNSImage(); - scoped_nsobject<NSImageView> imageView([[NSImageView alloc] + base::scoped_nsobject<NSImageView> imageView([[NSImageView alloc] initWithFrame:NSMakeRect(0, 0, image.size.width, image.size.height)]); [imageView setImageFrameStyle:NSImageFrameNone]; [imageView setImage:image]; @@ -75,7 +75,7 @@ anchoredAt:(NSPoint)anchorPoint const CGFloat textX = NSWidth([imageView frame]) + kIconTextMargin; NSRect textFrame = NSMakeRect(textX, 0, NSWidth(contentFrame) - textX, 0); - scoped_nsobject<NSTextField> text( + base::scoped_nsobject<NSTextField> text( [[NSTextField alloc] initWithFrame:textFrame]); [text setStringValue:base::SysUTF16ToNSString(mainText)]; [text setFont:[NSFont systemFontOfSize:[NSFont systemFontSize]]]; @@ -104,7 +104,7 @@ anchoredAt:(NSPoint)anchorPoint NSRect subTextFrame = NSMakeRect( textX, NSMaxY(textFrame) + kTextVerticalMargin, NSWidth(textFrame), 0); - scoped_nsobject<NSTextField> text2( + base::scoped_nsobject<NSTextField> text2( [[NSTextField alloc] initWithFrame:subTextFrame]); [text2 setStringValue:base::SysUTF16ToNSString(subText)]; [text2 setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; @@ -174,7 +174,7 @@ class ValidationMessageBubbleCocoa : public chrome::ValidationMessageBubble { } private: - scoped_nsobject<ValidationMessageBubbleController> controller_; + base::scoped_nsobject<ValidationMessageBubbleController> controller_; }; } diff --git a/chrome/browser/ui/cocoa/validation_message_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/validation_message_bubble_controller_unittest.mm index 207188b..594d379 100644 --- a/chrome/browser/ui/cocoa/validation_message_bubble_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/validation_message_bubble_controller_unittest.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/utf_string_conversions.h" #import "chrome/browser/ui/cocoa/validation_message_bubble_controller.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/ui/cocoa/vertical_gradient_view.h b/chrome/browser/ui/cocoa/vertical_gradient_view.h index b42928d..c12301761 100644 --- a/chrome/browser/ui/cocoa/vertical_gradient_view.h +++ b/chrome/browser/ui/cocoa/vertical_gradient_view.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_UI_COCOA_VERTICAL_GRADIENT_VIEW_H_ #define CHROME_BROWSER_UI_COCOA_VERTICAL_GRADIENT_VIEW_H_ -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import <Cocoa/Cocoa.h> @@ -17,9 +17,9 @@ @interface VerticalGradientView : NSView { @private // The gradient to draw. - scoped_nsobject<NSGradient> gradient_; + base::scoped_nsobject<NSGradient> gradient_; // Color for bottom stroke. - scoped_nsobject<NSColor> strokeColor_; + base::scoped_nsobject<NSColor> strokeColor_; } // Gets and sets the gradient to paint as background. diff --git a/chrome/browser/ui/cocoa/vertical_gradient_view_unittest.mm b/chrome/browser/ui/cocoa/vertical_gradient_view_unittest.mm index ac046b0..fa550b3 100644 --- a/chrome/browser/ui/cocoa/vertical_gradient_view_unittest.mm +++ b/chrome/browser/ui/cocoa/vertical_gradient_view_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/vertical_gradient_view.h" @@ -12,7 +12,7 @@ class VerticalGradientViewTest : public CocoaTest { public: VerticalGradientViewTest() { NSRect frame = NSMakeRect(0, 0, 50, 27); - scoped_nsobject<VerticalGradientView> view( + base::scoped_nsobject<VerticalGradientView> view( [[VerticalGradientView alloc] initWithFrame:frame]); view_ = view.get(); [[test_window() contentView] addSubview:view_]; diff --git a/chrome/browser/ui/cocoa/web_dialog_window_controller.mm b/chrome/browser/ui/cocoa/web_dialog_window_controller.mm index 9797deb..4460de9 100644 --- a/chrome/browser/ui/cocoa/web_dialog_window_controller.mm +++ b/chrome/browser/ui/cocoa/web_dialog_window_controller.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/web_dialog_window_controller.h" #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #import "chrome/browser/ui/browser_dialogs.h" #import "chrome/browser/ui/cocoa/browser_command_executor.h" @@ -317,12 +317,12 @@ void WebDialogWindowDelegateBridge::HandleKeyboardEvent( NSRect dialogRect = NSMakeRect(0, 0, dialogSize.width(), dialogSize.height()); NSUInteger style = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask; - scoped_nsobject<ChromeEventProcessingWindow> window( + base::scoped_nsobject<ChromeEventProcessingWindow> window( [[ChromeEventProcessingWindow alloc] - initWithContentRect:dialogRect - styleMask:style - backing:NSBackingStoreBuffered - defer:YES]); + initWithContentRect:dialogRect + styleMask:style + backing:NSBackingStoreBuffered + defer:YES]); if (!window.get()) { return nil; } diff --git a/chrome/browser/ui/cocoa/website_settings_bubble_controller.h b/chrome/browser/ui/cocoa/website_settings_bubble_controller.h index 060496d..5f671e7 100644 --- a/chrome/browser/ui/cocoa/website_settings_bubble_controller.h +++ b/chrome/browser/ui/cocoa/website_settings_bubble_controller.h @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/base_bubble_controller.h" #include "chrome/browser/ui/website_settings/website_settings_ui.h" @@ -21,9 +21,9 @@ class WebContents; @private content::WebContents* webContents_; - scoped_nsobject<NSView> contentView_; - scoped_nsobject<NSSegmentedControl> segmentedControl_; - scoped_nsobject<NSTabView> tabView_; + base::scoped_nsobject<NSView> contentView_; + base::scoped_nsobject<NSSegmentedControl> segmentedControl_; + base::scoped_nsobject<NSTabView> tabView_; // Displays the web site identity. NSTextField* identityField_; diff --git a/chrome/browser/ui/cocoa/website_settings_bubble_controller.mm b/chrome/browser/ui/cocoa/website_settings_bubble_controller.mm index 74e602c..b66584f 100644 --- a/chrome/browser/ui/cocoa/website_settings_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/website_settings_bubble_controller.mm @@ -120,13 +120,13 @@ NSColor* IdentityVerifiedTextColor() { @interface WebsiteSettingsTabSegmentedCell : NSSegmentedCell { @private - scoped_nsobject<NSImage> tabstripCenterImage_; - scoped_nsobject<NSImage> tabstripLeftImage_; - scoped_nsobject<NSImage> tabstripRightImage_; + base::scoped_nsobject<NSImage> tabstripCenterImage_; + base::scoped_nsobject<NSImage> tabstripLeftImage_; + base::scoped_nsobject<NSImage> tabstripRightImage_; - scoped_nsobject<NSImage> tabCenterImage_; - scoped_nsobject<NSImage> tabLeftImage_; - scoped_nsobject<NSImage> tabRightImage_; + base::scoped_nsobject<NSImage> tabCenterImage_; + base::scoped_nsobject<NSImage> tabLeftImage_; + base::scoped_nsobject<NSImage> tabRightImage_; // Key track of the index of segment which has keyboard focus. This is not // the same as the currently selected segment. @@ -303,7 +303,7 @@ NSColor* IdentityVerifiedTextColor() { // Use an arbitrary height; it will be changed in performLayout. NSRect contentRect = NSMakeRect(0, 0, [self defaultWindowWidth], 1); // Create an empty window into which content is placed. - scoped_nsobject<InfoBubbleWindow> window( + base::scoped_nsobject<InfoBubbleWindow> window( [[InfoBubbleWindow alloc] initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered @@ -403,7 +403,7 @@ NSColor* IdentityVerifiedTextColor() { // Create the tab view and its two tabs. - scoped_nsobject<WebsiteSettingsTabSegmentedCell> cell( + base::scoped_nsobject<WebsiteSettingsTabSegmentedCell> cell( [[WebsiteSettingsTabSegmentedCell alloc] init]); CGFloat tabstripHeight = [cell cellSize].height; NSRect tabstripFrame = NSMakeRect( @@ -470,11 +470,11 @@ NSColor* IdentityVerifiedTextColor() { // Create the contents of the Permissions tab and add it to the given tab view. // Returns a weak reference to the tab view item's view. - (NSView*)addPermissionsTabToTabView:(NSTabView*)tabView { - scoped_nsobject<NSTabViewItem> item([[NSTabViewItem alloc] init]); + base::scoped_nsobject<NSTabViewItem> item([[NSTabViewItem alloc] init]); [tabView_ insertTabViewItem:item.get() atIndex:WebsiteSettingsUI::TAB_ID_PERMISSIONS]; - scoped_nsobject<NSView> contentView([[FlippedView alloc] - initWithFrame:[tabView_ contentRect]]); + base::scoped_nsobject<NSView> contentView( + [[FlippedView alloc] initWithFrame:[tabView_ contentRect]]); [contentView setAutoresizingMask:NSViewWidthSizable]; [item setView:contentView.get()]; @@ -531,9 +531,9 @@ NSColor* IdentityVerifiedTextColor() { // Create the contents of the Connection tab and add it to the given tab view. // Returns a weak reference to the tab view item's view. - (NSView*)addConnectionTabToTabView:(NSTabView*)tabView { - scoped_nsobject<NSTabViewItem> item([[NSTabViewItem alloc] init]); - scoped_nsobject<NSView> contentView([[FlippedView alloc] - initWithFrame:[tabView_ contentRect]]); + base::scoped_nsobject<NSTabViewItem> item([[NSTabViewItem alloc] init]); + base::scoped_nsobject<NSView> contentView( + [[FlippedView alloc] initWithFrame:[tabView_ contentRect]]); [contentView setAutoresizingMask:NSViewWidthSizable]; // Place all the text and images at the same position. The positions will be @@ -782,8 +782,8 @@ NSColor* IdentityVerifiedTextColor() { // The height is arbitrary as it will be adjusted later. CGFloat width = NSWidth([view frame]) - point.x - kFramePadding; NSRect frame = NSMakeRect(point.x, point.y, width, 100); - scoped_nsobject<NSTextField> textField( - [[NSTextField alloc] initWithFrame:frame]); + base::scoped_nsobject<NSTextField> textField( + [[NSTextField alloc] initWithFrame:frame]); [self configureTextFieldAsLabel:textField.get()]; [textField setStringValue:base::SysUTF16ToNSString(text)]; NSFont* font = bold ? [NSFont boldSystemFontOfSize:fontSize] @@ -801,7 +801,7 @@ NSColor* IdentityVerifiedTextColor() { toView:(NSView*)view atPoint:(NSPoint)point { NSRect frame = NSMakeRect(point.x, point.y, size.width, size.height); - scoped_nsobject<NSImageView> imageView( + base::scoped_nsobject<NSImageView> imageView( [[NSImageView alloc] initWithFrame:frame]); [imageView setImageFrameStyle:NSImageFrameNone]; [view addSubview:imageView.get()]; @@ -824,8 +824,9 @@ NSColor* IdentityVerifiedTextColor() { - (NSButton*)addLinkButtonWithText:(NSString*)text toView:(NSView*)view { // Frame size is arbitrary; it will be adjusted by the layout tweaker. NSRect frame = NSMakeRect(kFramePadding, 0, 100, 10); - scoped_nsobject<NSButton> button([[NSButton alloc] initWithFrame:frame]); - scoped_nsobject<HyperlinkButtonCell> cell( + base::scoped_nsobject<NSButton> button( + [[NSButton alloc] initWithFrame:frame]); + base::scoped_nsobject<HyperlinkButtonCell> cell( [[HyperlinkButtonCell alloc] initTextCell:text]); [cell setControlSize:NSSmallControlSize]; [button setCell:cell.get()]; @@ -860,7 +861,7 @@ NSColor* IdentityVerifiedTextColor() { atPoint:(NSPoint)point { // Use an arbitrary width and height; it will be sized to fit. NSRect frame = NSMakeRect(point.x, point.y, 1, 1); - scoped_nsobject<NSPopUpButton> button( + base::scoped_nsobject<NSPopUpButton> button( [[NSPopUpButton alloc] initWithFrame:frame pullsDown:NO]); [button setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; [button setBordered:NO]; @@ -896,7 +897,7 @@ NSColor* IdentityVerifiedTextColor() { [button selectItemWithTag:permissionInfo.setting]; // Set the button title. - scoped_nsobject<NSMenuItem> titleItem([[NSMenuItem alloc] init]); + base::scoped_nsobject<NSMenuItem> titleItem([[NSMenuItem alloc] init]); string16 buttonTitle = WebsiteSettingsUI::PermissionActionToUIString( permissionInfo.setting, permissionInfo.default_setting, diff --git a/chrome/browser/ui/cocoa/window_size_autosaver.h b/chrome/browser/ui/cocoa/window_size_autosaver.h index 8d136e3..e167125 100644 --- a/chrome/browser/ui/cocoa/window_size_autosaver.h +++ b/chrome/browser/ui/cocoa/window_size_autosaver.h @@ -10,7 +10,8 @@ class PrefService; // WindowSizeAutosaver is a helper class that makes it easy to let windows // autoremember their position or position and size in a PrefService object. -// To use this, add a |scoped_nsobject<WindowSizeAutosaver>| to your window +// To use this, add a |base::scoped_nsobject<WindowSizeAutosaver>| to your +// window // controller and initialize it in the window controller's init method, passing // a window and an autosave name. The autosaver will register for "window moved" // and "window resized" notifications and write the current window state to the diff --git a/chrome/browser/ui/cocoa/window_size_autosaver_unittest.mm b/chrome/browser/ui/cocoa/window_size_autosaver_unittest.mm index 93e28f9..b8d553c 100644 --- a/chrome/browser/ui/cocoa/window_size_autosaver_unittest.mm +++ b/chrome/browser/ui/cocoa/window_size_autosaver_unittest.mm @@ -6,7 +6,7 @@ #import "chrome/browser/ui/cocoa/window_size_autosaver.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/prefs/pref_service.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" @@ -69,10 +69,10 @@ TEST_F(WindowSizeAutosaverTest, RestoresAndSavesPos) { { NSRect frame = [window_ frame]; // Empty state, shouldn't restore: - scoped_nsobject<WindowSizeAutosaver> sizeSaver([[WindowSizeAutosaver alloc] - initWithWindow:window_ - prefService:pref - path:path_]); + base::scoped_nsobject<WindowSizeAutosaver> sizeSaver( + [[WindowSizeAutosaver alloc] initWithWindow:window_ + prefService:pref + path:path_]); EXPECT_EQ(NSMinX(frame), NSMinX([window_ frame])); EXPECT_EQ(NSMinY(frame), NSMinY([window_ frame])); EXPECT_EQ(NSWidth(frame), NSWidth([window_ frame])); @@ -87,10 +87,10 @@ TEST_F(WindowSizeAutosaverTest, RestoresAndSavesPos) { { // Should restore last stored position, but not size. - scoped_nsobject<WindowSizeAutosaver> sizeSaver([[WindowSizeAutosaver alloc] - initWithWindow:window_ - prefService:pref - path:path_]); + base::scoped_nsobject<WindowSizeAutosaver> sizeSaver( + [[WindowSizeAutosaver alloc] initWithWindow:window_ + prefService:pref + path:path_]); EXPECT_EQ(300, NSMinX([window_ frame])); EXPECT_EQ(310, NSMinY([window_ frame])); EXPECT_EQ(160, NSWidth([window_ frame])); @@ -128,10 +128,10 @@ TEST_F(WindowSizeAutosaverTest, RestoresAndSavesRect) { { NSRect frame = [window_ frame]; // Empty state, shouldn't restore: - scoped_nsobject<WindowSizeAutosaver> sizeSaver([[WindowSizeAutosaver alloc] - initWithWindow:window_ - prefService:pref - path:path_]); + base::scoped_nsobject<WindowSizeAutosaver> sizeSaver( + [[WindowSizeAutosaver alloc] initWithWindow:window_ + prefService:pref + path:path_]); EXPECT_EQ(NSMinX(frame), NSMinX([window_ frame])); EXPECT_EQ(NSMinY(frame), NSMinY([window_ frame])); EXPECT_EQ(NSWidth(frame), NSWidth([window_ frame])); @@ -146,10 +146,10 @@ TEST_F(WindowSizeAutosaverTest, RestoresAndSavesRect) { { // Should restore last stored size - scoped_nsobject<WindowSizeAutosaver> sizeSaver([[WindowSizeAutosaver alloc] - initWithWindow:window_ - prefService:pref - path:path_]); + base::scoped_nsobject<WindowSizeAutosaver> sizeSaver( + [[WindowSizeAutosaver alloc] initWithWindow:window_ + prefService:pref + path:path_]); EXPECT_EQ(300, NSMinX([window_ frame])); EXPECT_EQ(310, NSMinY([window_ frame])); EXPECT_EQ(250, NSWidth([window_ frame])); @@ -187,10 +187,10 @@ TEST_F(WindowSizeAutosaverTest, DoesNotRestoreButClearsEmptyRect) { { // Window rect shouldn't change... NSRect frame = [window_ frame]; - scoped_nsobject<WindowSizeAutosaver> sizeSaver([[WindowSizeAutosaver alloc] - initWithWindow:window_ - prefService:pref - path:path_]); + base::scoped_nsobject<WindowSizeAutosaver> sizeSaver( + [[WindowSizeAutosaver alloc] initWithWindow:window_ + prefService:pref + path:path_]); EXPECT_EQ(NSMinX(frame), NSMinX([window_ frame])); EXPECT_EQ(NSMinY(frame), NSMinY([window_ frame])); EXPECT_EQ(NSWidth(frame), NSWidth([window_ frame])); diff --git a/chrome/browser/ui/cocoa/wrench_menu/menu_tracked_root_view_unittest.mm b/chrome/browser/ui/cocoa/wrench_menu/menu_tracked_root_view_unittest.mm index 76da79c..14266b6 100644 --- a/chrome/browser/ui/cocoa/wrench_menu/menu_tracked_root_view_unittest.mm +++ b/chrome/browser/ui/cocoa/wrench_menu/menu_tracked_root_view_unittest.mm @@ -4,13 +4,13 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/wrench_menu/menu_tracked_root_view.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" -#include "third_party/ocmock/gtest_support.h" #import "third_party/ocmock/OCMock/OCMock.h" +#include "third_party/ocmock/gtest_support.h" class MenuTrackedRootViewTest : public CocoaTest { public: @@ -19,7 +19,7 @@ class MenuTrackedRootViewTest : public CocoaTest { view_.reset([[MenuTrackedRootView alloc] init]); } - scoped_nsobject<MenuTrackedRootView> view_; + base::scoped_nsobject<MenuTrackedRootView> view_; }; TEST_F(MenuTrackedRootViewTest, MouseUp) { diff --git a/chrome/browser/ui/cocoa/wrench_menu/recent_tabs_menu_model_delegate.h b/chrome/browser/ui/cocoa/wrench_menu/recent_tabs_menu_model_delegate.h index b1f2f42..d9cdd60 100644 --- a/chrome/browser/ui/cocoa/wrench_menu/recent_tabs_menu_model_delegate.h +++ b/chrome/browser/ui/cocoa/wrench_menu/recent_tabs_menu_model_delegate.h @@ -7,7 +7,7 @@ #import <Cocoa/Cocoa.h> -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "ui/base/models/menu_model_delegate.h" namespace ui { @@ -26,7 +26,7 @@ class RecentTabsMenuModelDelegate : public ui::MenuModelDelegate { private: ui::MenuModel* model_; // weak - scoped_nsobject<NSMenu> menu_; + base::scoped_nsobject<NSMenu> menu_; DISALLOW_COPY_AND_ASSIGN(RecentTabsMenuModelDelegate); }; diff --git a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_button_cell.mm b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_button_cell.mm index 2e14478..bd334c2 100644 --- a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_button_cell.mm +++ b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_button_cell.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/wrench_menu/wrench_menu_button_cell.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" @implementation WrenchMenuButtonCell @@ -26,7 +26,7 @@ // The default state should be a subtle gray gradient. if (![self isHighlighted]) { NSColor* end = [NSColor colorWithDeviceWhite:0.922 alpha:1.0]; - scoped_nsobject<NSGradient> gradient( + base::scoped_nsobject<NSGradient> gradient( [[NSGradient alloc] initWithStartingColor:[NSColor whiteColor] endingColor:end]); [gradient drawInRect:frame angle:90.0]; diff --git a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_button_cell_unittest.mm b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_button_cell_unittest.mm index 52791e2..2336393 100644 --- a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_button_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_button_cell_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/app/chrome_command_ids.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/wrench_menu/wrench_menu_button_cell.h" @@ -32,7 +32,7 @@ class WrenchMenuButtonCellTest : public CocoaTest { [button_ setButtonType:NSMomentaryPushInButton]; } - scoped_nsobject<NSButton> button_; + base::scoped_nsobject<NSButton> button_; }; TEST_F(WrenchMenuButtonCellTest, Draw) { diff --git a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.h b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.h index fd6a283..fdbc62f 100644 --- a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.h +++ b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.h @@ -46,7 +46,7 @@ class ZoomLevelObserver; // A shim NSViewController that loads the buttons from the NIB because ObjC // doesn't have multiple inheritance as this class is a MenuController. - scoped_nsobject<WrenchMenuButtonViewController> buttonViewController_; + base::scoped_nsobject<WrenchMenuButtonViewController> buttonViewController_; // The browser for which this controller exists. Browser* browser_; // weak diff --git a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm index cfa847e..2e41dd8 100644 --- a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm +++ b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm @@ -122,10 +122,8 @@ class ZoomLevelObserver { // Handle the special-cased menu items. int command_id = model->GetCommandIdAt(index); - scoped_nsobject<NSMenuItem> customItem( - [[NSMenuItem alloc] initWithTitle:@"" - action:nil - keyEquivalent:@""]); + base::scoped_nsobject<NSMenuItem> customItem( + [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]); MenuTrackedRootView* view; switch (command_id) { case IDC_EDIT_MENU: @@ -162,9 +160,9 @@ class ZoomLevelObserver { if (model && model == [self recentTabsMenuModel] && model->GetLabelFontAt([item tag])) { DCHECK([menuItem attributedTitle]); - scoped_nsobject<NSMutableAttributedString> title( - [[NSMutableAttributedString alloc] initWithAttributedString: - [menuItem attributedTitle]]); + base::scoped_nsobject<NSMutableAttributedString> title( + [[NSMutableAttributedString alloc] + initWithAttributedString:[menuItem attributedTitle]]); [title addAttribute:NSForegroundColorAttributeName value:[NSColor blackColor] range:NSMakeRange(0, [title length])]; diff --git a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm index 0d08c3c..d681db0 100644 --- a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_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/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" @@ -62,7 +62,7 @@ class WrenchMenuControllerTest : public CocoaProfileTest { return controller_.get(); } - scoped_nsobject<WrenchMenuController> controller_; + base::scoped_nsobject<WrenchMenuController> controller_; scoped_ptr<MockWrenchMenuModel> fake_model_; }; @@ -73,7 +73,7 @@ TEST_F(WrenchMenuControllerTest, Initialized) { } TEST_F(WrenchMenuControllerTest, DispatchSimple) { - scoped_nsobject<NSButton> button([[NSButton alloc] init]); + base::scoped_nsobject<NSButton> button([[NSButton alloc] init]); [button setTag:IDC_ZOOM_PLUS]; // Set fake model to test dispatching. diff --git a/chrome/browser/ui/tests/ui_gfx_image_unittest.mm b/chrome/browser/ui/tests/ui_gfx_image_unittest.mm index e025ccc..4e45cf2 100644 --- a/chrome/browser/ui/tests/ui_gfx_image_unittest.mm +++ b/chrome/browser/ui/tests/ui_gfx_image_unittest.mm @@ -5,7 +5,7 @@ #import <AppKit/AppKit.h> #import "base/mac/mac_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -45,7 +45,7 @@ TEST_F(UiGfxImageTest, DISABLED_CheckColor) { } TEST_F(UiGfxImageTest, ImageView) { - scoped_nsobject<NSImageView> image_view( + base::scoped_nsobject<NSImageView> image_view( [[NSImageView alloc] initWithFrame:NSMakeRect(10, 10, 25, 25)]); [[test_window() contentView] addSubview:image_view]; [test_window() orderFront:nil]; diff --git a/chrome/browser/ui/webui/help/version_updater_mac.h b/chrome/browser/ui/webui/help/version_updater_mac.h index 2b705d7..f2a82bc 100644 --- a/chrome/browser/ui/webui/help/version_updater_mac.h +++ b/chrome/browser/ui/webui/help/version_updater_mac.h @@ -8,7 +8,7 @@ #import <AppKit/AppKit.h> #include "base/compiler_specific.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/webui/help/version_updater.h" @class KeystoneObserver; @@ -50,7 +50,7 @@ class VersionUpdaterMac : public VersionUpdater { bool show_promote_button_; // The observer that will receive keystone status updates. - scoped_nsobject<KeystoneObserver> keystone_observer_; + base::scoped_nsobject<KeystoneObserver> keystone_observer_; DISALLOW_COPY_AND_ASSIGN(VersionUpdaterMac); }; diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm index 6f72d47..4cf3505 100644 --- a/chrome/browser/web_applications/web_app_mac.mm +++ b/chrome/browser/web_applications/web_app_mac.mm @@ -17,7 +17,7 @@ #include "base/mac/mac_logging.h" #include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" diff --git a/chrome/browser/web_applications/web_app_mac_unittest.mm b/chrome/browser/web_applications/web_app_mac_unittest.mm index 6112245..09bc976 100644 --- a/chrome/browser/web_applications/web_app_mac_unittest.mm +++ b/chrome/browser/web_applications/web_app_mac_unittest.mm @@ -6,13 +6,13 @@ #import <Cocoa/Cocoa.h> -#include <sys/xattr.h> #include <errno.h> +#include <sys/xattr.h> #include "base/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/mac/foundation_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "chrome/common/mac/app_mode_common.h" @@ -242,8 +242,8 @@ TEST(WebAppShortcutCreatorTest, UpdateIcon) { base::FilePath icon_path = dst_path.Append("Contents").Append("Resources").Append("app.icns"); - scoped_nsobject<NSImage> image([[NSImage alloc] initWithContentsOfFile: - base::mac::FilePathToNSString(icon_path)]); + base::scoped_nsobject<NSImage> image([[NSImage alloc] + initWithContentsOfFile:base::mac::FilePathToNSString(icon_path)]); EXPECT_TRUE(image); EXPECT_EQ(product_logo.Width(), [image size].width); EXPECT_EQ(product_logo.Height(), [image size].height); |