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

Unified Diff: chrome/browser/cocoa/toolbar_controller.mm

Issue 149717: [Mac] Refactor location-bar autocomplete cell classes. (Closed)
Patch Set: jrg comment Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/toolbar_controller.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/toolbar_controller.mm
diff --git a/chrome/browser/cocoa/toolbar_controller.mm b/chrome/browser/cocoa/toolbar_controller.mm
index c16ab737b261b2e7907d0331bca3396da3e097dc..bb28cfa3f584f380751ac274d32e405250099285 100644
--- a/chrome/browser/cocoa/toolbar_controller.mm
+++ b/chrome/browser/cocoa/toolbar_controller.mm
@@ -7,6 +7,8 @@
#include "base/mac_util.h"
#include "base/sys_string_conversions.h"
#include "chrome/app/chrome_dll_resource.h"
+#import "chrome/browser/cocoa/autocomplete_text_field.h"
+#import "chrome/browser/cocoa/autocomplete_text_field_editor.h"
#import "chrome/browser/cocoa/location_bar_view_mac.h"
#include "chrome/browser/cocoa/nsimage_cache.h"
#include "chrome/browser/profile.h"
@@ -21,30 +23,6 @@
static NSString* const kStarImageName = @"star_Template.pdf";
static NSString* const kStarredImageName = @"starred.pdf";
-@implementation LocationBarFieldEditor
-- (void)copy:(id)sender {
- NSPasteboard* pb = [NSPasteboard generalPasteboard];
- [self performCopy:pb];
-}
-
-- (void)cut:(id)sender {
- NSPasteboard* pb = [NSPasteboard generalPasteboard];
- [self performCut:pb];
-}
-
-- (void)performCopy:(NSPasteboard*)pb {
- [pb declareTypes:[NSArray array] owner:nil];
- [self writeSelectionToPasteboard:pb types:
- [NSArray arrayWithObject:NSStringPboardType]];
-}
-
-- (void)performCut:(NSPasteboard*)pb {
- [self performCopy:pb];
- [self delete:nil];
-}
-
-@end
-
@interface ToolbarController(Private)
- (void)initCommandStatus:(CommandUpdater*)commands;
- (void)prefChanged:(std::wstring*)prefName;
@@ -245,15 +223,16 @@ class PrefObserverBridge : public NotificationObserver {
if (obj == locationBar_) {
// Lazilly construct Field editor, Cocoa UI code always runs on the
// same thread, so there shoudn't be a race condition here.
- if (locationBarFieldEditor_.get() == nil) {
- locationBarFieldEditor_.reset([[LocationBarFieldEditor alloc] init]);
+ if (autocompleteTextFieldEditor_.get() == nil) {
+ autocompleteTextFieldEditor_.reset(
+ [[AutocompleteTextFieldEditor alloc] init]);
}
// This needs to be called every time, otherwise notifications
// aren't sent correctly.
- DCHECK(locationBarFieldEditor_.get());
- [locationBarFieldEditor_.get() setFieldEditor:YES];
- return locationBarFieldEditor_.get();
+ DCHECK(autocompleteTextFieldEditor_.get());
+ [autocompleteTextFieldEditor_.get() setFieldEditor:YES];
+ return autocompleteTextFieldEditor_.get();
}
return nil;
}
« no previous file with comments | « chrome/browser/cocoa/toolbar_controller.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698