summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm
diff options
context:
space:
mode:
authorpam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-21 17:40:32 +0000
committerpam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-21 17:40:32 +0000
commit9bed75f6d0a89236c1c88bde9a1348702f039f09 (patch)
tree82f2d0f96856c065d4054a2534b082897c0985be /chrome/browser/cocoa/keyword_editor_cocoa_controller.mm
parent86c10a17c5b7fbaa21d39b1f8d69b858a9fce417 (diff)
downloadchromium_src-9bed75f6d0a89236c1c88bde9a1348702f039f09.zip
chromium_src-9bed75f6d0a89236c1c88bde9a1348702f039f09.tar.gz
chromium_src-9bed75f6d0a89236c1c88bde9a1348702f039f09.tar.bz2
Use the original profile when opening the keyword editor window, since
otherwise the profile pointer may go stale if it was opened from an Incognito window. Simplify the check that already does this on Mac. GetOriginalProfile() returns the profile it's called on, if it isn't incognito. BUG=23359 TEST=open Incognito window, right-click in omnibox, Edit Search Engines, close Incog window, edit an engine Review URL: http://codereview.chromium.org/307010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29666 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/keyword_editor_cocoa_controller.mm')
-rw-r--r--chrome/browser/cocoa/keyword_editor_cocoa_controller.mm6
1 files changed, 2 insertions, 4 deletions
diff --git a/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm b/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm
index a511a23..032ffbb 100644
--- a/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm
+++ b/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm
@@ -134,9 +134,7 @@ typedef std::map<Profile*,KeywordEditorCocoaController*> ProfileControllerMap;
// opened from an incognito window, which can leave the panel
// holding onto a stale profile. Since the same panel is used
// either way, arrange to use the original profile instead.
- if (profile->IsOffTheRecord()) {
- profile = profile->GetOriginalProfile();
- }
+ profile = profile->GetOriginalProfile();
ProfileControllerMap* map = Singleton<ProfileControllerMap>::get();
DCHECK(map != NULL);
@@ -326,7 +324,7 @@ typedef std::map<Profile*,KeywordEditorCocoaController*> ProfileControllerMap;
// Set the favicon and title for the search engine in the name column.
if ([[tableColumn identifier] isEqualToString:@"name"]) {
DCHECK([cell isKindOfClass:[NSButtonCell class]]);
- NSButtonCell* buttonCell = static_cast<NSButtonCell*>(cell);
+ NSButtonCell* buttonCell = static_cast<NSButtonCell*>(cell);
std::wstring title = controller_->table_model()->GetText(row,
IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN);
[buttonCell setTitle:base::SysWideToNSString(title)];