summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-05 13:15:53 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-05 13:15:53 +0000
commit9a2c6564702b8b6be0b29cec5a0cc20639c12f69 (patch)
tree00d2de4b02d4f6cf2a97c2fd5343ea2868f7831f /chrome/browser/cocoa
parent10998f75376382ab86b1b128c0262a4e1dc3b94d (diff)
downloadchromium_src-9a2c6564702b8b6be0b29cec5a0cc20639c12f69.zip
chromium_src-9a2c6564702b8b6be0b29cec5a0cc20639c12f69.tar.gz
chromium_src-9a2c6564702b8b6be0b29cec5a0cc20639c12f69.tar.bz2
[Mac] Implement BrowserWindowCocoa::ConfirmAddSearchProvider.
BUG=48327 TEST=Install the Google SSL search extension, click "Add as Search Engine". Review URL: http://codereview.chromium.org/2803036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51638 0039d316-1c4b-4281-b951-d872f2087c98
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