OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/l10n_util_mac.h" | 10 #include "app/l10n_util_mac.h" |
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1305 [ImportSettingsDialogController showImportSettingsDialogForProfile:profile_]; | 1305 [ImportSettingsDialogController showImportSettingsDialogForProfile:profile_]; |
1306 } | 1306 } |
1307 | 1307 |
1308 - (IBAction)resetThemeToDefault:(id)sender { | 1308 - (IBAction)resetThemeToDefault:(id)sender { |
1309 [self recordUserAction:"Options_ThemesReset"]; | 1309 [self recordUserAction:"Options_ThemesReset"]; |
1310 profile_->ClearTheme(); | 1310 profile_->ClearTheme(); |
1311 } | 1311 } |
1312 | 1312 |
1313 - (IBAction)themesGallery:(id)sender { | 1313 - (IBAction)themesGallery:(id)sender { |
1314 [self recordUserAction:"Options_ThemesGallery"]; | 1314 [self recordUserAction:"Options_ThemesGallery"]; |
1315 Browser* browser = | 1315 Browser* browser = BrowserList::GetLastActive(); |
Avi (use Gerrit)
2010/03/23 16:24:14
BTW, you don't have to worry about finding the "no
| |
1316 BrowserList::FindBrowserWithType(profile_, Browser::TYPE_NORMAL); | |
1317 | 1316 |
1318 if (!browser || !browser->GetSelectedTabContents()) { | 1317 if (!browser || !browser->GetSelectedTabContents()) |
1319 browser = Browser::Create(profile_); | 1318 browser = Browser::Create(profile_); |
1320 browser->OpenURL( | 1319 browser->OpenThemeGalleryTabAndActivate(); |
1321 GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)), | |
1322 GURL(), NEW_WINDOW, PageTransition::LINK); | |
1323 } else { | |
1324 browser->OpenURL( | |
1325 GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)), | |
1326 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); | |
1327 } | |
1328 } | 1320 } |
1329 | 1321 |
1330 // Called when the "stop syncing" confirmation dialog started by | 1322 // Called when the "stop syncing" confirmation dialog started by |
1331 // doSyncAction is finished. Stop syncing only If the user clicked | 1323 // doSyncAction is finished. Stop syncing only If the user clicked |
1332 // OK. | 1324 // OK. |
1333 - (void)stopSyncAlertDidEnd:(NSAlert*)alert | 1325 - (void)stopSyncAlertDidEnd:(NSAlert*)alert |
1334 returnCode:(int)returnCode | 1326 returnCode:(int)returnCode |
1335 contextInfo:(void*)contextInfo { | 1327 contextInfo:(void*)contextInfo { |
1336 DCHECK(syncService_); | 1328 DCHECK(syncService_); |
1337 if (returnCode == NSAlertFirstButtonReturn) { | 1329 if (returnCode == NSAlertFirstButtonReturn) { |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1946 case OPTIONS_PAGE_ADVANCED: | 1938 case OPTIONS_PAGE_ADVANCED: |
1947 return underTheHoodView_; | 1939 return underTheHoodView_; |
1948 case OPTIONS_PAGE_DEFAULT: | 1940 case OPTIONS_PAGE_DEFAULT: |
1949 case OPTIONS_PAGE_COUNT: | 1941 case OPTIONS_PAGE_COUNT: |
1950 LOG(DFATAL) << "Invalid page value " << page; | 1942 LOG(DFATAL) << "Invalid page value " << page; |
1951 } | 1943 } |
1952 return basicsView_; | 1944 return basicsView_; |
1953 } | 1945 } |
1954 | 1946 |
1955 @end | 1947 @end |
OLD | NEW |