| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/cocoa/bookmark_bar_controller.h" | 5 #import "chrome/browser/cocoa/bookmark_bar_controller.h" |
| 6 #include "app/l10n_util_mac.h" | 6 #include "app/l10n_util_mac.h" |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_editor.h" | 10 #include "chrome/browser/bookmarks/bookmark_editor.h" |
| 11 #include "chrome/browser/bookmarks/bookmark_model.h" | 11 #include "chrome/browser/bookmarks/bookmark_model.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 26 #import "chrome/browser/cocoa/bookmark_folder_target.h" | 26 #import "chrome/browser/cocoa/bookmark_folder_target.h" |
| 27 #import "chrome/browser/cocoa/bookmark_menu.h" | 27 #import "chrome/browser/cocoa/bookmark_menu.h" |
| 28 #import "chrome/browser/cocoa/bookmark_menu_cocoa_controller.h" | 28 #import "chrome/browser/cocoa/bookmark_menu_cocoa_controller.h" |
| 29 #import "chrome/browser/cocoa/bookmark_name_folder_controller.h" | 29 #import "chrome/browser/cocoa/bookmark_name_folder_controller.h" |
| 30 #import "chrome/browser/cocoa/browser_window_controller.h" | 30 #import "chrome/browser/cocoa/browser_window_controller.h" |
| 31 #import "chrome/browser/cocoa/event_utils.h" | 31 #import "chrome/browser/cocoa/event_utils.h" |
| 32 #import "chrome/browser/cocoa/import_settings_dialog.h" | 32 #import "chrome/browser/cocoa/import_settings_dialog.h" |
| 33 #import "chrome/browser/cocoa/menu_button.h" | 33 #import "chrome/browser/cocoa/menu_button.h" |
| 34 #import "chrome/browser/cocoa/themed_window.h" | 34 #import "chrome/browser/cocoa/themed_window.h" |
| 35 #import "chrome/browser/cocoa/toolbar_controller.h" | 35 #import "chrome/browser/cocoa/toolbar_controller.h" |
| 36 #import "chrome/browser/cocoa/view_id_util.h" |
| 36 #import "chrome/browser/cocoa/view_resizer.h" | 37 #import "chrome/browser/cocoa/view_resizer.h" |
| 37 #include "chrome/browser/metrics/user_metrics.h" | 38 #include "chrome/browser/metrics/user_metrics.h" |
| 38 #include "chrome/browser/pref_service.h" | 39 #include "chrome/browser/pref_service.h" |
| 39 #include "chrome/browser/profile.h" | 40 #include "chrome/browser/profile.h" |
| 40 #include "chrome/browser/tab_contents/tab_contents.h" | 41 #include "chrome/browser/tab_contents/tab_contents.h" |
| 41 #include "chrome/browser/tab_contents/tab_contents_view.h" | 42 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 42 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| 43 #include "grit/app_resources.h" | 44 #include "grit/app_resources.h" |
| 44 #include "grit/generated_resources.h" | 45 #include "grit/generated_resources.h" |
| 45 #include "grit/theme_resources.h" | 46 #include "grit/theme_resources.h" |
| (...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 | 1080 |
| 1080 // TODO(jrg): remove duplicate code | 1081 // TODO(jrg): remove duplicate code |
| 1081 NSCell* cell = [self cellForBookmarkNode:bookmarkModel_->other_node()]; | 1082 NSCell* cell = [self cellForBookmarkNode:bookmarkModel_->other_node()]; |
| 1082 int ignored = 0; | 1083 int ignored = 0; |
| 1083 NSRect frame = [self frameForBookmarkButtonFromCell:cell xOffset:&ignored]; | 1084 NSRect frame = [self frameForBookmarkButtonFromCell:cell xOffset:&ignored]; |
| 1084 frame.origin.x = [[self buttonView] bounds].size.width - frame.size.width; | 1085 frame.origin.x = [[self buttonView] bounds].size.width - frame.size.width; |
| 1085 frame.origin.x -= bookmarks::kBookmarkHorizontalPadding; | 1086 frame.origin.x -= bookmarks::kBookmarkHorizontalPadding; |
| 1086 BookmarkButton* button = [[BookmarkButton alloc] initWithFrame:frame]; | 1087 BookmarkButton* button = [[BookmarkButton alloc] initWithFrame:frame]; |
| 1087 [button setDraggable:NO]; | 1088 [button setDraggable:NO]; |
| 1088 otherBookmarksButton_.reset(button); | 1089 otherBookmarksButton_.reset(button); |
| 1090 view_id_util::SetID(button, VIEW_ID_OTHER_BOOKMARKS); |
| 1089 | 1091 |
| 1090 // Make sure this button, like all other BookmarkButtons, lives | 1092 // Make sure this button, like all other BookmarkButtons, lives |
| 1091 // until the end of the current event loop. | 1093 // until the end of the current event loop. |
| 1092 [[button retain] autorelease]; | 1094 [[button retain] autorelease]; |
| 1093 | 1095 |
| 1094 // Peg at right; keep same height as bar. | 1096 // Peg at right; keep same height as bar. |
| 1095 [button setAutoresizingMask:(NSViewMinXMargin)]; | 1097 [button setAutoresizingMask:(NSViewMinXMargin)]; |
| 1096 [button setCell:cell]; | 1098 [button setCell:cell]; |
| 1097 [button setDelegate:self]; | 1099 [button setDelegate:self]; |
| 1098 [button setTarget:self]; | 1100 [button setTarget:self]; |
| (...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2354 // to minimize touching the object passed in (likely a mock). | 2356 // to minimize touching the object passed in (likely a mock). |
| 2355 - (void)setButtonContextMenu:(id)menu { | 2357 - (void)setButtonContextMenu:(id)menu { |
| 2356 buttonContextMenu_ = menu; | 2358 buttonContextMenu_ = menu; |
| 2357 } | 2359 } |
| 2358 | 2360 |
| 2359 - (void)setIgnoreAnimations:(BOOL)ignore { | 2361 - (void)setIgnoreAnimations:(BOOL)ignore { |
| 2360 ignoreAnimations_ = ignore; | 2362 ignoreAnimations_ = ignore; |
| 2361 } | 2363 } |
| 2362 | 2364 |
| 2363 @end | 2365 @end |
| OLD | NEW |