Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 7276030: Show singleton tab instead of opening multiple help tabs. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "chrome/browser/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 // static 741 // static
742 void Browser::OpenDownloadsWindow(Profile* profile) { 742 void Browser::OpenDownloadsWindow(Profile* profile) {
743 Browser* browser = Browser::Create(profile); 743 Browser* browser = Browser::Create(profile);
744 browser->ShowDownloadsTab(); 744 browser->ShowDownloadsTab();
745 browser->window()->Show(); 745 browser->window()->Show();
746 } 746 }
747 747
748 // static 748 // static
749 void Browser::OpenHelpWindow(Profile* profile) { 749 void Browser::OpenHelpWindow(Profile* profile) {
750 Browser* browser = Browser::Create(profile); 750 Browser* browser = Browser::Create(profile);
751 browser->OpenHelpTab(); 751 browser->ShowHelpTab();
752 browser->window()->Show(); 752 browser->window()->Show();
753 } 753 }
754 754
755 // static 755 // static
756 void Browser::OpenOptionsWindow(Profile* profile) { 756 void Browser::OpenOptionsWindow(Profile* profile) {
757 Browser* browser = Browser::Create(profile); 757 Browser* browser = Browser::Create(profile);
758 browser->OpenOptionsDialog(); 758 browser->OpenOptionsDialog();
759 browser->window()->Show(); 759 browser->window()->Show();
760 } 760 }
761 761
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after
2046 #else 2046 #else
2047 window_->ShowAboutChromeDialog(); 2047 window_->ShowAboutChromeDialog();
2048 #endif 2048 #endif
2049 } 2049 }
2050 2050
2051 void Browser::OpenUpdateChromeDialog() { 2051 void Browser::OpenUpdateChromeDialog() {
2052 UserMetrics::RecordAction(UserMetricsAction("UpdateChrome")); 2052 UserMetrics::RecordAction(UserMetricsAction("UpdateChrome"));
2053 window_->ShowUpdateChromeDialog(); 2053 window_->ShowUpdateChromeDialog();
2054 } 2054 }
2055 2055
2056 void Browser::OpenHelpTab() { 2056 void Browser::ShowHelpTab() {
2057 GURL help_url(kHelpContentUrl); 2057 GURL help_url(kHelpContentUrl);
2058 GURL localized_help_url = google_util::AppendGoogleLocaleParam(help_url); 2058 GURL localized_help_url = google_util::AppendGoogleLocaleParam(help_url);
2059 AddSelectedTabWithURL(localized_help_url, PageTransition::AUTO_BOOKMARK); 2059 ShowSingletonTab(localized_help_url);
2060 } 2060 }
2061 2061
2062 void Browser::OpenThemeGalleryTabAndActivate() { 2062 void Browser::OpenThemeGalleryTabAndActivate() {
2063 AddSelectedTabWithURL(GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)), 2063 AddSelectedTabWithURL(GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)),
2064 PageTransition::LINK); 2064 PageTransition::LINK);
2065 } 2065 }
2066 2066
2067 void Browser::OpenPrivacyDashboardTabAndActivate() { 2067 void Browser::OpenPrivacyDashboardTabAndActivate() {
2068 OpenURL(GURL(kPrivacyDashboardUrl), GURL(), 2068 OpenURL(GURL(kPrivacyDashboardUrl), GURL(),
2069 NEW_FOREGROUND_TAB, PageTransition::LINK); 2069 NEW_FOREGROUND_TAB, PageTransition::LINK);
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 case IDC_MANAGE_EXTENSIONS: ShowExtensionsTab(); break; 2476 case IDC_MANAGE_EXTENSIONS: ShowExtensionsTab(); break;
2477 case IDC_SYNC_BOOKMARKS: OpenSyncMyBookmarksDialog(); break; 2477 case IDC_SYNC_BOOKMARKS: OpenSyncMyBookmarksDialog(); break;
2478 case IDC_OPTIONS: OpenOptionsDialog(); break; 2478 case IDC_OPTIONS: OpenOptionsDialog(); break;
2479 case IDC_EDIT_SEARCH_ENGINES: OpenSearchEngineOptionsDialog(); break; 2479 case IDC_EDIT_SEARCH_ENGINES: OpenSearchEngineOptionsDialog(); break;
2480 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; 2480 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break;
2481 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; 2481 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break;
2482 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; 2482 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break;
2483 case IDC_ABOUT: OpenAboutChromeDialog(); break; 2483 case IDC_ABOUT: OpenAboutChromeDialog(); break;
2484 case IDC_UPGRADE_DIALOG: OpenUpdateChromeDialog(); break; 2484 case IDC_UPGRADE_DIALOG: OpenUpdateChromeDialog(); break;
2485 case IDC_VIEW_INCOMPATIBILITIES: ShowAboutConflictsTab(); break; 2485 case IDC_VIEW_INCOMPATIBILITIES: ShowAboutConflictsTab(); break;
2486 case IDC_HELP_PAGE: OpenHelpTab(); break; 2486 case IDC_HELP_PAGE: ShowHelpTab(); break;
2487 #if defined(OS_CHROMEOS) 2487 #if defined(OS_CHROMEOS)
2488 case IDC_FILE_MANAGER: OpenFileManager(); break; 2488 case IDC_FILE_MANAGER: OpenFileManager(); break;
2489 case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break; 2489 case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break;
2490 case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break; 2490 case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break;
2491 case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break; 2491 case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break;
2492 #endif 2492 #endif
2493 2493
2494 default: 2494 default:
2495 LOG(WARNING) << "Received Unimplemented Command: " << id; 2495 LOG(WARNING) << "Received Unimplemented Command: " << id;
2496 break; 2496 break;
(...skipping 2229 matching lines...) Expand 10 before | Expand all | Expand 10 after
4726 // end up querying state once they process the tab switch. 4726 // end up querying state once they process the tab switch.
4727 return; 4727 return;
4728 } 4728 }
4729 4729
4730 BookmarkBar::AnimateChangeType animate_type = 4730 BookmarkBar::AnimateChangeType animate_type =
4731 (reason == BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE) ? 4731 (reason == BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE) ?
4732 BookmarkBar::ANIMATE_STATE_CHANGE : 4732 BookmarkBar::ANIMATE_STATE_CHANGE :
4733 BookmarkBar::DONT_ANIMATE_STATE_CHANGE; 4733 BookmarkBar::DONT_ANIMATE_STATE_CHANGE;
4734 window_->BookmarkBarStateChanged(animate_type); 4734 window_->BookmarkBarStateChanged(animate_type);
4735 } 4735 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698