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

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

Issue 207027: [Mac] Polish the search engine manager (Closed)
Patch Set: '' Created 11 years, 3 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
Index: chrome/browser/cocoa/edit_search_engine_cocoa_controller.mm
diff --git a/chrome/browser/cocoa/edit_search_engine_cocoa_controller.mm b/chrome/browser/cocoa/edit_search_engine_cocoa_controller.mm
index 00e4913ec5a6f1edf3ab21ce9e2a1a64996539ae..d3e213151027e8ba882201512a6aad1b4ccf6b2e 100644
--- a/chrome/browser/cocoa/edit_search_engine_cocoa_controller.mm
+++ b/chrome/browser/cocoa/edit_search_engine_cocoa_controller.mm
@@ -102,8 +102,18 @@ void ShiftOriginY(NSView* view, CGFloat amount) {
[self autorelease];
}
+// Performs the logic of closing the window. If we are a sheet, then it ends the
+// modal session; otherwise, it closes the window.
+- (void)doClose {
+ if ([[self window] isSheet]) {
+ [NSApp endSheet:[self window]];
+ } else {
+ [[self window] close];
+ }
+}
+
- (IBAction)cancel:(id)sender {
- [[self window] close];
+ [self doClose];
}
- (IBAction)save:(id)sender {
@@ -112,7 +122,7 @@ void ShiftOriginY(NSView* view, CGFloat amount) {
std::wstring keyword = base::SysNSStringToWide([keywordField_ stringValue]);
std::wstring url = base::SysNSStringToWide([urlField_ stringValue]);
controller_->AcceptAddOrEdit(title, keyword, url);
- [[self window] close];
+ [self doClose];
}
// Delegate method for the text fields.

Powered by Google App Engine
This is Rietveld 408576698