OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/cocoa/preferences_window_controller.h" | 5 #import "chrome/browser/cocoa/preferences_window_controller.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 [self recordUserAction:L"Options_ThemesGallery"]; | 709 [self recordUserAction:L"Options_ThemesGallery"]; |
710 Browser* browser = | 710 Browser* browser = |
711 BrowserList::FindBrowserWithType(profile_, Browser::TYPE_NORMAL); | 711 BrowserList::FindBrowserWithType(profile_, Browser::TYPE_NORMAL); |
712 | 712 |
713 if (!browser || !browser->GetSelectedTabContents()) { | 713 if (!browser || !browser->GetSelectedTabContents()) { |
714 browser = Browser::Create(profile_); | 714 browser = Browser::Create(profile_); |
715 browser->OpenURL( | 715 browser->OpenURL( |
716 GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)), | 716 GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)), |
717 GURL(), NEW_WINDOW, PageTransition::LINK); | 717 GURL(), NEW_WINDOW, PageTransition::LINK); |
718 } else { | 718 } else { |
719 browser->AddTabWithURL( | 719 browser->OpenURL( |
720 GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)), | 720 GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)), |
721 GURL(), PageTransition::LINK, true, -1, false, NULL); | 721 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); |
722 } | 722 } |
723 } | 723 } |
724 | 724 |
725 - (void)setPasswordManagerEnabledIndex:(NSInteger)value { | 725 - (void)setPasswordManagerEnabledIndex:(NSInteger)value { |
726 if (value == kEnabledIndex) | 726 if (value == kEnabledIndex) |
727 [self recordUserAction:L"Options_PasswordManager_Enable"]; | 727 [self recordUserAction:L"Options_PasswordManager_Enable"]; |
728 else | 728 else |
729 [self recordUserAction:L"Options_PasswordManager_Disable"]; | 729 [self recordUserAction:L"Options_PasswordManager_Disable"]; |
730 askSavePasswords_.SetValue(value == kEnabledIndex ? true : false); | 730 askSavePasswords_.SetValue(value == kEnabledIndex ? true : false); |
731 } | 731 } |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 | 925 |
926 // Called when the window is being closed. Send out a notification that the | 926 // Called when the window is being closed. Send out a notification that the |
927 // user is done editing preferences. | 927 // user is done editing preferences. |
928 - (void)windowWillClose:(NSNotification *)notification { | 928 - (void)windowWillClose:(NSNotification *)notification { |
929 [[NSNotificationCenter defaultCenter] | 929 [[NSNotificationCenter defaultCenter] |
930 postNotificationName:kUserDoneEditingPrefsNotification | 930 postNotificationName:kUserDoneEditingPrefsNotification |
931 object:self]; | 931 object:self]; |
932 } | 932 } |
933 | 933 |
934 @end | 934 @end |
OLD | NEW |