summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/browser_window_cocoa.mm12
-rw-r--r--chrome/browser/cocoa/browser_window_controller.h5
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm6
3 files changed, 22 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/browser_window_cocoa.mm b/chrome/browser/cocoa/browser_window_cocoa.mm
index 9dbe789..e3fecac 100644
--- a/chrome/browser/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/cocoa/browser_window_cocoa.mm
@@ -19,6 +19,7 @@
#import "chrome/browser/cocoa/clear_browsing_data_controller.h"
#import "chrome/browser/cocoa/content_settings_dialog_controller.h"
#import "chrome/browser/cocoa/download_shelf_controller.h"
+#import "chrome/browser/cocoa/edit_search_engine_cocoa_controller.h"
#import "chrome/browser/cocoa/html_dialog_window_controller.h"
#import "chrome/browser/cocoa/import_settings_dialog.h"
#import "chrome/browser/cocoa/keyword_editor_cocoa_controller.h"
@@ -195,7 +196,16 @@ gfx::Rect BrowserWindowCocoa::GetRootWindowResizerRect() const {
void BrowserWindowCocoa::ConfirmAddSearchProvider(
const TemplateURL* template_url,
Profile* profile) {
- NOTIMPLEMENTED();
+ // The controller will release itself when the window closes.
+ EditSearchEngineCocoaController* editor =
+ [[EditSearchEngineCocoaController alloc] initWithProfile:profile
+ delegate:NULL
+ templateURL:template_url];
+ [NSApp beginSheet:[editor window]
+ modalForWindow:window()
+ modalDelegate:controller_
+ didEndSelector:@selector(sheetDidEnd:returnCode:context:)
+ contextInfo:NULL];
}
LocationBar* BrowserWindowCocoa::GetLocationBar() const {
diff --git a/chrome/browser/cocoa/browser_window_controller.h b/chrome/browser/cocoa/browser_window_controller.h
index 2c808c8..3d49356 100644
--- a/chrome/browser/cocoa/browser_window_controller.h
+++ b/chrome/browser/cocoa/browser_window_controller.h
@@ -252,6 +252,11 @@ class TabStripModelObserverBridge;
// browser.
- (void)toggleTabStripDisplayMode;
+// Called when the Add Search Engine dialog is closed.
+- (void)sheetDidEnd:(NSWindow*)sheet
+ returnCode:(NSInteger)code
+ context:(void*)context;
+
@end // @interface BrowserWindowController
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index 4f98a6f..360dead 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -1633,6 +1633,12 @@ willAnimateFromState:(bookmarks::VisualState)oldState
return browser_->tabstrip_model()->delegate()->UseVerticalTabs();
}
+- (void)sheetDidEnd:(NSWindow*)sheet
+ returnCode:(NSInteger)code
+ context:(void*)context {
+ [sheet orderOut:self];
+}
+
@end // @implementation BrowserWindowController