mac: Update clients of scoped_nsobject.h.
1.) The header is now in base/mac instead of base/memory 2.) The class is now in namespace base. This CL was created programmatically by running: 1.) git grep -l memory/scoped_nsobject.h | xargs sed -i -e 's/memory\/scoped_nsobject.h/mac\/scoped_nsobject.h/g' for f in $(git diff --name-only origin); do tools/sort-headers.py $f -f; done git commit -a -m headers # manually undo changes to gypi file git cl upload # patch set 1 2.) git grep -l 'scoped_nsobject<' | xargs sed -i -e 's/scoped_nsobject</base::scoped_nsobject</g' # manually undo comment changes in scoped_nsobject.h, tracking_area.h git commit -a -m format git cl upload # patch set 2 # Manually audit all files, file bugs and clean up bad clang-format decisions git cl upload # patch set 3 BUG=251957 TBR=mark@chromium.org Review URL: https://codereview.chromium.org/17593006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208283 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
ash
base
chrome
app
browser
app_controller_mac.happ_controller_mac.mmapp_controller_mac_browsertest.mmapp_controller_mac_unittest.mmchrome_browser_application_mac.hchrome_browser_application_mac.mmchrome_browser_main_mac.mm
download
importer
mac
media_galleries
fileapi
mac
notifications
speech
ssl
storage_monitor
image_capture_device.himage_capture_device_manager.himage_capture_device_manager.mmimage_capture_device_manager_unittest.mm
ui
app_list
cocoa
about_ipc_controller_unittest.mmanimatable_image.hanimatable_view.hanimatable_view_unittest.mm
applescript
bookmark_applescript_utils_unittest.hbookmark_folder_applescript.mmbookmark_folder_applescript_unittest.mmbookmark_item_applescript_unittest.mmbookmark_node_applescript.mmbrowsercrapplication+applescript.mmbrowsercrapplication+applescript_test.mmtab_applescript.mmwindow_applescript.mmwindow_applescript_test.mm
autofill
autofill_account_chooser.hautofill_account_chooser.mmautofill_account_chooser_unittest.mmautofill_details_container.hautofill_details_container.mmautofill_details_container_unittest.mmautofill_dialog_cocoa.hautofill_dialog_cocoa.mmautofill_main_container.hautofill_main_container.mmautofill_main_container_unittest.mmautofill_popup_view_bridge.hautofill_section_container.hautofill_section_container.mmautofill_section_container_unittest.mmautofill_section_view_unittest.mmautofill_sign_in_container_unittest.mmautofill_suggestion_container.hautofill_suggestion_container.mmautofill_suggestion_container_unittest.mmautofill_textfield.hautofill_textfield_unittest.mmdown_arrow_popup_menu_cell_unittest.mmlayout_view_unittest.mmsimple_grid_layout_unittest.mm
background_gradient_view_unittest.mmbase_bubble_controller.mmbase_bubble_controller_unittest.mmbookmarks
bookmark_all_tabs_controller_unittest.mmbookmark_bar_bridge_unittest.mmbookmark_bar_controller.hbookmark_bar_controller.mmbookmark_bar_controller_unittest.mmbookmark_bar_folder_button_cell_unittest.mmbookmark_bar_folder_controller.hbookmark_bar_folder_controller_unittest.mmbookmark_bar_folder_hover_state.hbookmark_bar_folder_hover_state_unittest.mmbookmark_bar_folder_view_unittest.mmbookmark_bar_folder_window.hbookmark_bar_folder_window.mmbookmark_bar_folder_window_unittest.mmbookmark_bar_toolbar_view_unittest.mmbookmark_bar_view_unittest.mmbookmark_bubble_controller_unittest.mmbookmark_button.mmbookmark_button_cell.hbookmark_button_cell.mmbookmark_button_cell_unittest.mmbookmark_button_unittest.mmbookmark_context_menu_cocoa_controller.hbookmark_drag_drop_cocoa.mmbookmark_editor_base_controller.hbookmark_editor_base_controller_unittest.mmbookmark_editor_controller.hbookmark_folder_target_unittest.mmbookmark_menu_bridge.hbookmark_menu_bridge_unittest.mmbookmark_menu_cocoa_controller_unittest.mmbookmark_model_observer_for_cocoa.hbookmark_model_observer_for_cocoa_unittest.mmbookmark_name_folder_controller.hbookmark_name_folder_controller_unittest.mmbookmark_tree_browser_cell_unittest.mm
browser
avatar_button_controller.havatar_button_controller.mmavatar_button_controller_unittest.mmavatar_menu_bubble_controller.havatar_menu_bubble_controller.mmavatar_menu_bubble_controller_unittest.mmedit_search_engine_cocoa_controller_unittest.mmpassword_generation_bubble_controller.mmzoom_bubble_controller.hzoom_bubble_controller.mm
browser_window_cocoa.hbrowser_window_cocoa.mmbrowser_window_cocoa_unittest.mmbrowser_window_controller.hbrowser_window_controller.mmbrowser_window_controller_browsertest.mmbrowser_window_controller_private.mmbrowser_window_controller_unittest.mmbubble_view.hbubble_view.mmbubble_view_unittest.mmcertificate_viewer_mac.hcertificate_viewer_mac.mmchrome_event_processing_window.hchrome_event_processing_window_unittest.mmchrome_to_mobile_bubble_controller.hclickhold_button_cell.hclickhold_button_cell_unittest.mmcolor_chooser_mac.mmcommand_observer_bridge_unittest.mmconfirm_bubble_cocoa.hconfirm_bubble_cocoa.mmconfirm_bubble_controller_unittest.mmconfirm_quit_panel_controller.mmconfirm_quit_panel_controller_unittest.mmconstrained_web_dialog_delegate_mac.mmconstrained_window
constrained_window_alert.hconstrained_window_alert.mmconstrained_window_alert_unittest.mmconstrained_window_animation.hconstrained_window_animation_unittest.mmconstrained_window_button.mmconstrained_window_button_unittest.mmconstrained_window_control_utils.mmconstrained_window_custom_sheet.hconstrained_window_custom_sheet.mmconstrained_window_custom_window.mmconstrained_window_custom_window_unittest.mmconstrained_window_mac.hconstrained_window_mac_browsertest.mmconstrained_window_sheet_controller.hconstrained_window_sheet_controller.mmconstrained_window_sheet_controller_unittest.mmconstrained_window_sheet_info.h
content_settings
collected_cookies_mac.hcollected_cookies_mac.mmcontent_setting_bubble_cocoa.hcontent_setting_bubble_cocoa.mmcontent_setting_bubble_cocoa_unittest.mmcookie_details.hcookie_details_unittest.mmcookie_details_view_controller_unittest.mmcookie_tree_node.hcookie_tree_node.mm
custom_frame_view_unittest.mmdev_tools_controller.hdev_tools_controller.mmdock_icon.mmdownload
background_theme.hdownload_item_button.mmdownload_item_button_unittest.mmdownload_item_cell.hdownload_item_cell.mmdownload_item_cell_unittest.mmdownload_item_mac.hdownload_shelf_controller.hdownload_shelf_controller.mmdownload_shelf_controller_unittest.mmdownload_shelf_mac_unittest.mmdownload_shelf_view.mmdownload_shelf_view_unittest.mm
draggable_button.hdraggable_button.mmdraggable_button_mixin.mmdraggable_button_unittest.mmextensions
browser_action_button.hbrowser_actions_container_view.mmbrowser_actions_container_view_unittest.mmbrowser_actions_controller.hextension_action_context_menu.hextension_action_context_menu_browsertest.mmextension_install_dialog_controller.hextension_install_dialog_controller.mmextension_install_dialog_controller_browsertest.mmextension_install_view_controller.hextension_install_view_controller.mmextension_install_view_controller_unittest.mmextension_installed_bubble_controller.hextension_popup_controller.hextension_popup_controller.mmmedia_galleries_dialog_cocoa.hmedia_galleries_dialog_cocoa.mmmedia_galleries_dialog_cocoa_browsertest.mmnative_app_window_cocoa.hnative_app_window_cocoa.mm
fast_resize_view_unittest.mmfind_bar
find_bar_cocoa_controller.hfind_bar_cocoa_controller_unittest.mmfind_bar_text_field_cell.hfind_bar_text_field_cell.mmfind_bar_text_field_cell_unittest.mmfind_bar_text_field_unittest.mmfind_bar_view_unittest.mm
find_pasteboard_unittest.mmfirst_run_bubble_controller_unittest.mmfirst_run_dialog.mmfloating_bar_backing_view_unittest.mmframed_browser_window.hframed_browser_window_unittest.mmfullscreen_exit_bubble_controller.hfullscreen_exit_bubble_controller_unittest.mmfullscreen_exit_bubble_view.mmfullscreen_window_unittest.mmglobal_error_bubble_controller.mmgradient_button_cell.hgradient_button_cell.mmgradient_button_cell_unittest.mmhistory_menu_bridge.hhistory_menu_bridge.mmhistory_menu_bridge_unittest.mmhistory_menu_cocoa_controller_unittest.mmhistory_overlay_controller.hhistory_overlay_controller.mmhistory_overlay_controller_unittest.mmhover_close_button.mmhover_close_button_unittest.mmhung_renderer_controller.hhung_renderer_controller.mmhung_renderer_controller_unittest.mmhyperlink_button_cell.hhyperlink_button_cell.mmhyperlink_button_cell_unittest.mmhyperlink_text_view.mmhyperlink_text_view_unittest.mmimage_button_cell.himage_button_cell_unittest.mmimporter
info_bubble_view.hinfo_bubble_view.mminfo_bubble_view_unittest.mminfo_bubble_window.mminfobars
before_translate_infobar_controller.hconfirm_infobar_controller_unittest.mmextension_infobar_controller.hinfobar_container_controller.hinfobar_container_controller_unittest.mminfobar_controller.hinfobar_gradient_view.mminfobar_gradient_view_unittest.mminfobar_utilities.mmtranslate_infobar_base.htranslate_infobar_unittest.mm
javascript_app_modal_dialog_cocoa.hjavascript_app_modal_dialog_cocoa.mmlocation_bar
action_box_menu_bubble_controller.haction_box_menu_bubble_controller.mmautocomplete_text_field.hautocomplete_text_field.mmautocomplete_text_field_cell.mmautocomplete_text_field_cell_unittest.mmautocomplete_text_field_editor.hautocomplete_text_field_editor_unittest.mmautocomplete_text_field_unittest.mmautocomplete_text_field_unittest_helper.hbubble_decoration.hbutton_decoration.hcontent_setting_decoration.hcontent_setting_decoration.mmev_bubble_decoration.hev_bubble_decoration_unittest.mmimage_decoration.himage_decoration_unittest.mmkeyword_hint_decoration.hlocation_bar_decoration.mmlocation_bar_view_mac.hpage_action_decoration.hplus_decoration.hselected_keyword_decoration.hstar_decoration.hzoom_decoration.h
login_prompt_cocoa.mmmenu_button.hmenu_button.mmmenu_button_unittest.mmnotifications
balloon_controller.hballoon_controller.mmballoon_controller_unittest.mmballoon_view.mmmessage_center_tray_bridge.hmessage_center_tray_bridge_unittest.mm
nsmenuitem_additions_unittest.mmnsview_additions_unittest.mmomnibox
omnibox_popup_view_mac.homnibox_popup_view_mac.mmomnibox_popup_view_mac_unittest.mmomnibox_view_mac.mmomnibox_view_mac_unittest.mm
one_click_signin_bubble_controller.hone_click_signin_bubble_controller.mmone_click_signin_bubble_controller_browsertest.mmone_click_signin_bubble_controller_unittest.mmone_click_signin_dialog_controller.hone_click_signin_dialog_controller.mmone_click_signin_view_controller.hpanels
panel_cocoa_unittest.mmpanel_stack_window_cocoa.hpanel_stack_window_cocoa.mmpanel_titlebar_view_cocoa.hpanel_titlebar_view_cocoa.mmpanel_window_controller_cocoa.hpanel_window_controller_cocoa.mm
presentation_mode_controller.hprofile_menu_controller.hprofile_menu_controller.mmprofile_menu_controller_unittest.mmprofile_signin_confirmation_dialog_cocoa.hprofile_signin_confirmation_dialog_cocoa.mmprofile_signin_confirmation_view_controller.hprofile_signin_confirmation_view_controller.mmprofile_signin_confirmation_view_controller_browsertest.mmrun_loop_testing.mmrun_loop_testing_unittest.mmspeech_recognition_bubble_cocoa.mmssl_client_certificate_selector_cocoa.hstatus_bubble_mac.mmstatus_bubble_mac_unittest.mmstatus_icons
styled_text_field_cell_unittest.mmstyled_text_field_unittest.mmtab_contents
overlay_separator_view_unittest.mmoverlayable_contents_controller.hoverlayable_contents_controller.mmoverlayable_contents_controller_browsertest.mmrender_view_context_menu_mac.hrender_view_context_menu_mac.mmsad_tab_controller.hsad_tab_controller_unittest.mmsad_tab_view.hsad_tab_view_unittest.mmtab_contents_controller.mm
tab_modal_confirm_dialog_mac.htab_modal_confirm_dialog_mac.mmtable_row_nsimage_cache.htabpose_window.htabpose_window.mmtabs
tab_audio_indicator_view_mac.htab_audio_indicator_view_mac_unittest.mmtab_controller.htab_controller.mmtab_controller_unittest.mmtab_projecting_image_view.htab_projecting_image_view_unittest.mmtab_strip_controller.htab_strip_controller.mmtab_strip_controller_unittest.mmtab_strip_drag_controller.mmtab_strip_view.htab_strip_view_unittest.mmtab_view.htab_view.mmtab_view_unittest.mmtab_window_controller.htab_window_controller.mmthrobber_view.hthrobber_view.mmthrobber_view_unittest.mmthrobbing_image_view.hthrobbing_image_view_unittest.mm
task_manager_mac.htask_manager_mac.mmtask_manager_mac_unittest.mmtoolbar
back_forward_menu_controller.hreload_button_unittest.mmtoolbar_button_unittest.mmtoolbar_controller.htoolbar_controller_unittest.mmtoolbar_view_unittest.mmwrench_toolbar_button_cell_unittest.mm
validation_message_bubble_cocoa.mmvalidation_message_bubble_controller_unittest.mmvertical_gradient_view.hvertical_gradient_view_unittest.mmweb_dialog_window_controller.mmwebsite_settings_bubble_controller.hwebsite_settings_bubble_controller.mmwindow_size_autosaver.hwindow_size_autosaver_unittest.mmwrench_menu
tests
webui
web_applications
common
content
browser
accessibility
gamepad
geolocation
renderer_host
clipboard_message_filter_mac.mmcompositing_iosurface_context_mac.hcompositing_iosurface_context_mac.mmpopup_menu_helper_mac.mmrender_widget_host_view_mac.hrender_widget_host_view_mac.mmrender_widget_host_view_mac_unittest.mmtext_input_client_mac.htext_input_client_mac_unittest.mmtext_input_client_message_filter.mmwebmenurunner_mac.hwebmenurunner_mac.mm
web_contents
common
shell
crypto
net/base
printing
remoting/host
rlz/mac/lib
skia/ext
ui
app_list
cocoa
app_list_view_controller.happ_list_view_controller.mmapp_list_view_controller_unittest.mmapp_list_window_controller.happ_list_window_controller.mmapp_list_window_controller_unittest.mmapps_collection_view_drag_manager.happs_collection_view_drag_manager.mmapps_grid_controller.happs_grid_controller.mmapps_grid_controller_unittest.mmapps_grid_view_item.mmapps_search_box_controller.happs_search_box_controller.mmapps_search_box_controller_unittest.mmapps_search_results_controller.happs_search_results_controller.mmapps_search_results_controller_unittest.mmapps_search_results_model_bridge.hcurrent_user_menu_item_view.mmitem_drag_controller.hitem_drag_controller.mmscroll_view_with_no_scrollbars.mm
aura
base
accelerators
clipboard
cocoa
base_view.hbase_view_unittest.mm
controls
find_pasteboard.hfocus_tracker.hfocus_tracker_unittest.mmfullscreen_window_manager.hfullscreen_window_manager_unittest.mmhover_button.hhover_button.mmhover_image_button.hhover_image_button_unittest.mmmenu_controller.hmenu_controller.mmmenu_controller_unittest.mmnib_loading.mmnsgraphics_context_additions_unittest.mmtracking_area.htracking_area.mmtracking_area_unittest.mmunderlay_opengl_hosting_window.mmresource
test
compositor
gfx
gl
message_center
cocoa
notification_controller.hnotification_controller.mmnotification_controller_unittest.mmpopup_collection.hpopup_collection_unittest.mmpopup_controller.hpopup_controller.mmpopup_controller_unittest.mmsettings_controller.hsettings_controller.mmsettings_controller_unittest.mmstatus_item_view.hstatus_item_view_unittest.mmtray_controller.htray_controller.mmtray_controller_unittest.mmtray_view_controller.htray_view_controller.mmtray_view_controller_unittest.mm
shell_dialogs
snapshot
webkit/common
@ -8,7 +8,7 @@
|
||||
|
||||
#include "base/i18n/icu_util.h"
|
||||
#include "base/mac/bundle_locations.h"
|
||||
#include "base/memory/scoped_nsobject.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
#include "ui/base/ui_base_paths.h"
|
||||
|
||||
@ -20,9 +20,9 @@ void PreMainMessageLoopStart() {
|
||||
icu_util::Initialize();
|
||||
ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
|
||||
|
||||
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()]);
|
||||
[nib instantiateNibWithOwner:NSApp topLevelObjects:nil];
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/mac/bundle_locations.h"
|
||||
#include "base/memory/scoped_nsobject.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "base/path_service.h"
|
||||
|
||||
namespace ash {
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "base/file_version_info.h"
|
||||
#include "base/memory/scoped_nsobject.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
|
||||
#ifdef __OBJC__
|
||||
@class NSBundle;
|
||||
@ -45,7 +45,7 @@ class FileVersionInfoMac : public FileVersionInfo {
|
||||
// Returns the empty string if the property does not exist.
|
||||
string16 GetString16Value(CFStringRef name);
|
||||
|
||||
scoped_nsobject<NSBundle> bundle_;
|
||||
base::scoped_nsobject<NSBundle> bundle_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(FileVersionInfoMac);
|
||||
};
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "base/mac/mac_logging.h"
|
||||
#include "base/mac/scoped_cftyperef.h"
|
||||
#include "base/mac/scoped_ioobject.h"
|
||||
#include "base/memory/scoped_nsobject.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
@ -99,7 +99,7 @@ LSSharedFileListItemRef GetLoginItemForApp() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
scoped_nsobject<NSArray> login_items_array(
|
||||
base::scoped_nsobject<NSArray> login_items_array(
|
||||
CFToNSCast(LSSharedFileListCopySnapshot(login_items, NULL)));
|
||||
|
||||
NSURL* url = [NSURL fileURLWithPath:[base::mac::MainBundle() bundlePath]];
|
||||
@ -489,17 +489,17 @@ void RemoveFromLoginItems() {
|
||||
bool WasLaunchedAsLoginOrResumeItem() {
|
||||
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||
|
||||
scoped_nsobject<NSDictionary> process_info(
|
||||
CFToNSCast(ProcessInformationCopyDictionary(&psn,
|
||||
kProcessDictionaryIncludeAllInformationMask)));
|
||||
base::scoped_nsobject<NSDictionary> process_info(
|
||||
CFToNSCast(ProcessInformationCopyDictionary(
|
||||
&psn, kProcessDictionaryIncludeAllInformationMask)));
|
||||
|
||||
long long temp = [[process_info objectForKey:@"ParentPSN"] longLongValue];
|
||||
ProcessSerialNumber parent_psn =
|
||||
{ (temp >> 32) & 0x00000000FFFFFFFFLL, temp & 0x00000000FFFFFFFFLL };
|
||||
|
||||
scoped_nsobject<NSDictionary> parent_info(
|
||||
CFToNSCast(ProcessInformationCopyDictionary(&parent_psn,
|
||||
kProcessDictionaryIncludeAllInformationMask)));
|
||||
base::scoped_nsobject<NSDictionary> parent_info(
|
||||
CFToNSCast(ProcessInformationCopyDictionary(
|
||||
&parent_psn, kProcessDictionaryIncludeAllInformationMask)));
|
||||
|
||||
// Check that creator process code is that of loginwindow.
|
||||
BOOL result =
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "base/files/scoped_temp_dir.h"
|
||||
#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/sys_info.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "testing/platform_test.h"
|
||||
@ -125,7 +125,7 @@ TEST_F(MacUtilTest, TestExcludeFileFromBackups) {
|
||||
}
|
||||
|
||||
TEST_F(MacUtilTest, CopyNSImageToCGImage) {
|
||||
scoped_nsobject<NSImage> nsImage(
|
||||
base::scoped_nsobject<NSImage> nsImage(
|
||||
[[NSImage alloc] initWithSize:NSMakeSize(20, 20)]);
|
||||
[nsImage lockFocus];
|
||||
[[NSColor redColor] set];
|
||||
@ -139,7 +139,8 @@ TEST_F(MacUtilTest, CopyNSImageToCGImage) {
|
||||
}
|
||||
|
||||
TEST_F(MacUtilTest, NSObjectRetainRelease) {
|
||||
scoped_nsobject<NSArray> array([[NSArray alloc] initWithObjects:@"foo", nil]);
|
||||
base::scoped_nsobject<NSArray> array(
|
||||
[[NSArray alloc] initWithObjects:@"foo", nil]);
|
||||
EXPECT_EQ(1U, [array retainCount]);
|
||||
|
||||
NSObjectRetain(array);
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "base/base_export.h"
|
||||
#include "base/basictypes.h"
|
||||
#include "base/memory/scoped_nsobject.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "base/message_loop/message_pump_mac.h"
|
||||
|
||||
// Nested event loops can pump IPC messages, including
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "base/debug/debugger.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/mac/scoped_nsautorelease_pool.h"
|
||||
#include "base/memory/scoped_nsobject.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_default.h"
|
||||
#include "base/test/test_suite.h"
|
||||
@ -36,7 +36,7 @@ static char** g_argv;
|
||||
|
||||
@interface ChromeUnitTestDelegate : NSObject {
|
||||
@private
|
||||
scoped_nsobject<UIWindow> window_;
|
||||
base::scoped_nsobject<UIWindow> window_;
|
||||
}
|
||||
- (void)runTests;
|
||||
@end
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "base/mac/mac_logging.h"
|
||||
#include "base/mac/mac_util.h"
|
||||
#include "base/mac/scoped_nsautorelease_pool.h"
|
||||
#include "base/memory/scoped_nsobject.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
@ -81,7 +81,7 @@ class AppShimController : public IPC::Listener {
|
||||
void Close();
|
||||
|
||||
IPC::ChannelProxy* channel_;
|
||||
scoped_nsobject<AppShimDelegate> nsapp_delegate_;
|
||||
base::scoped_nsobject<AppShimDelegate> nsapp_delegate_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AppShimController);
|
||||
};
|
||||
|
@ -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
|
||||
|
@ -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];
|
||||
|
@ -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];
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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];
|
||||
|
@ -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_;
|
||||
};
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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_;
|
||||
|
@ -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];
|
||||
|
@ -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
|
||||
|
@ -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_;
|
||||
|
@ -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"
|
||||
|
@ -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_;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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];
|
||||
|
@ -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
|
||||
|
@ -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];
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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).
|
||||
|
@ -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_
|
||||
|
@ -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];
|
||||
|
@ -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];
|
||||
|
@ -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,
|
||||
|
@ -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];
|
||||
|
||||
|
@ -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];
|
||||
|
@ -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) {
|
||||
|
@ -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];
|
||||
|
||||
|
@ -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];
|
||||
|
@ -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()],
|
||||
|
@ -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.
|
||||
}
|
||||
|
||||
|
@ -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];
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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.
|
||||
}
|
||||
|
||||
|
@ -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];
|
||||
|
@ -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_;
|
||||
};
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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]]];
|
||||
|
@ -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.
|
||||
}
|
||||
|
@ -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_];
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
}
|
||||
|
@ -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)];
|
||||
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
@ -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_;
|
||||
};
|
||||
|
@ -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_;
|
||||
};
|
||||
|
@ -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.
|
||||
}
|
||||
|
@ -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
|
||||
@end
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -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"];
|
||||
|
||||
|
@ -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]));
|
||||
}
|
||||
}
|
||||
|
@ -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]));
|
||||
|
@ -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_];
|
||||
|
@ -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];
|
||||
|
@ -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]);
|
||||
|
@ -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"
|
||||
|
@ -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(),
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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()];
|
||||
|
||||
|
@ -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
|
||||
|
@ -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_.
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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];
|
||||
}
|
||||
|
||||
|
@ -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_);
|
||||
|
@ -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_;
|
||||
};
|
||||
|
||||
|
@ -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]);
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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()];
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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];
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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_;
|
||||
}
|
||||
|
@ -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"
|
||||
|
@ -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_;
|
||||
|
@ -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);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user