Commit e788980f authored by jrg@chromium.org's avatar jrg@chromium.org

Landing http://codereview.chromium.org/337006 for mrossetti

BUG=21908

TEST=Control-click on the bookmark bar, either on an existing folder
or on the blank area and choose "Add Folder..." from the contextual
menu. A sheet will drop down from the bookmark bar asking for the name
of the folder to add. The edit field will be populated with the
proposed name 'New folder'. ('New folder' will be appropriately
localized.)


git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30136 0039d316-1c4b-4281-b951-d872f2087c98
parent 9cdd4354
...@@ -2,10 +2,12 @@ ...@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "app/l10n_util.h"
#include "base/mac_util.h" #include "base/mac_util.h"
#include "base/sys_string_conversions.h" #include "base/sys_string_conversions.h"
#include "chrome/browser/profile.h" #include "chrome/browser/profile.h"
#import "chrome/browser/cocoa/bookmark_name_folder_controller.h" #import "chrome/browser/cocoa/bookmark_name_folder_controller.h"
#include "grit/generated_resources.h"
@implementation BookmarkNameFolderController @implementation BookmarkNameFolderController
...@@ -19,23 +21,15 @@ ...@@ -19,23 +21,15 @@
parentWindow_ = window; parentWindow_ = window;
profile_ = profile; profile_ = profile;
node_ = node; node_ = node;
if (node_) { std::wstring newFolderString =
initialName_.reset([base::SysWideToNSString(node_->GetTitle()) retain]); l10n_util::GetString(IDS_BOOMARK_EDITOR_NEW_FOLDER_NAME);
} else { initialName_.reset([base::SysWideToNSString(newFolderString) retain]);
initialName_.reset([@"" retain]);
}
} }
return self; return self;
} }
- (void)awakeFromNib { - (void)awakeFromNib {
[nameField_ setStringValue:initialName_.get()]; [nameField_ setStringValue:initialName_.get()];
if (node_) {
// TODO(jrg)?: on Windows the dialog is named either New Folder or
// Edit Folder Name. However, since we're a sheet on the Mac, the
// title is never seen. If we switch from a sheet, correct the
// title right here.
}
[self controlTextDidChange:nil]; [self controlTextDidChange:nil];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment