Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(545)

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.mm

Issue 2771233002: Remove the wrapper functions content::RecordAction et al (Closed)
Patch Set: Rebased Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/cocoa/bookmarks/bookmark_bar_folder_view.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.h"
6 6
7 #include "base/metrics/user_metrics.h"
7 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
8 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" 9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target.h" 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target.h"
10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 11 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
11 #include "components/bookmarks/browser/bookmark_pasteboard_helper_mac.h" 12 #include "components/bookmarks/browser/bookmark_pasteboard_helper_mac.h"
12 #include "components/bookmarks/browser/bookmark_utils.h" 13 #include "components/bookmarks/browser/bookmark_utils.h"
13 #include "content/public/browser/user_metrics.h"
14 14
15 using base::UserMetricsAction; 15 using base::UserMetricsAction;
16 using bookmarks::BookmarkModel; 16 using bookmarks::BookmarkModel;
17 using bookmarks::BookmarkNode; 17 using bookmarks::BookmarkNode;
18 18
19 #import "third_party/mozilla/NSPasteboard+Utils.h" 19 #import "third_party/mozilla/NSPasteboard+Utils.h"
20 #include "ui/base/clipboard/clipboard_util_mac.h" 20 #include "ui/base/clipboard/clipboard_util_mac.h"
21 21
22 @interface BookmarkBarFolderView() 22 @interface BookmarkBarFolderView()
23 23
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 const BookmarkNode* const source_node = [button bookmarkNode]; 170 const BookmarkNode* const source_node = [button bookmarkNode];
171 const BookmarkNode* const target_node = 171 const BookmarkNode* const target_node =
172 bookmarks::GetBookmarkNodeByID(model, source_node->id()); 172 bookmarks::GetBookmarkNodeByID(model, source_node->id());
173 173
174 BOOL copy = 174 BOOL copy =
175 !([info draggingSourceOperationMask] & NSDragOperationMove) || 175 !([info draggingSourceOperationMask] & NSDragOperationMove) ||
176 (source_node != target_node); 176 (source_node != target_node);
177 doDrag = [[self controller] dragButton:button 177 doDrag = [[self controller] dragButton:button
178 to:[info draggingLocation] 178 to:[info draggingLocation]
179 copy:copy]; 179 copy:copy];
180 content::RecordAction(UserMetricsAction("BookmarkBarFolder_DragEnd")); 180 base::RecordAction(UserMetricsAction("BookmarkBarFolder_DragEnd"));
181 } 181 }
182 return doDrag; 182 return doDrag;
183 } 183 }
184 184
185 - (BOOL)performDragOperation:(id<NSDraggingInfo>)info { 185 - (BOOL)performDragOperation:(id<NSDraggingInfo>)info {
186 if ([[self controller] dragBookmarkData:info]) 186 if ([[self controller] dragBookmarkData:info])
187 return YES; 187 return YES;
188 NSPasteboard* pboard = [info draggingPasteboard]; 188 NSPasteboard* pboard = [info draggingPasteboard];
189 if ([pboard dataForType:ui::ClipboardUtil::UTIForPasteboardType( 189 if ([pboard dataForType:ui::ClipboardUtil::UTIForPasteboardType(
190 kBookmarkButtonDragType)] && 190 kBookmarkButtonDragType)] &&
(...skipping 18 matching lines...) Expand all
209 [dropIndicator_ setBorderType:NSLineBorder]; 209 [dropIndicator_ setBorderType:NSLineBorder];
210 [dropIndicator_ setAlphaValue:0.85]; 210 [dropIndicator_ setAlphaValue:0.85];
211 [self addSubview:dropIndicator_]; 211 [self addSubview:dropIndicator_];
212 } else { 212 } else {
213 [dropIndicator_ removeFromSuperview]; 213 [dropIndicator_ removeFromSuperview];
214 dropIndicator_.reset(); 214 dropIndicator_.reset();
215 } 215 }
216 } 216 }
217 217
218 @end 218 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698