| OLD | NEW |
| 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 <shellapi.h> | 8 #include <shellapi.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 // static | 733 // static |
| 734 void Browser::OpenDownloadsWindow(Profile* profile) { | 734 void Browser::OpenDownloadsWindow(Profile* profile) { |
| 735 Browser* browser = Browser::Create(profile); | 735 Browser* browser = Browser::Create(profile); |
| 736 browser->ShowDownloadsTab(); | 736 browser->ShowDownloadsTab(); |
| 737 browser->window()->Show(); | 737 browser->window()->Show(); |
| 738 } | 738 } |
| 739 | 739 |
| 740 // static | 740 // static |
| 741 void Browser::OpenHelpWindow(Profile* profile) { | 741 void Browser::OpenHelpWindow(Profile* profile) { |
| 742 Browser* browser = Browser::Create(profile); | 742 Browser* browser = Browser::Create(profile); |
| 743 browser->OpenHelpTab(); | 743 browser->ShowHelpTab(); |
| 744 browser->window()->Show(); | 744 browser->window()->Show(); |
| 745 } | 745 } |
| 746 | 746 |
| 747 // static | 747 // static |
| 748 void Browser::OpenOptionsWindow(Profile* profile) { | 748 void Browser::OpenOptionsWindow(Profile* profile) { |
| 749 Browser* browser = Browser::Create(profile); | 749 Browser* browser = Browser::Create(profile); |
| 750 browser->OpenOptionsDialog(); | 750 browser->OpenOptionsDialog(); |
| 751 browser->window()->Show(); | 751 browser->window()->Show(); |
| 752 } | 752 } |
| 753 | 753 |
| (...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2038 #else | 2038 #else |
| 2039 window_->ShowAboutChromeDialog(); | 2039 window_->ShowAboutChromeDialog(); |
| 2040 #endif | 2040 #endif |
| 2041 } | 2041 } |
| 2042 | 2042 |
| 2043 void Browser::OpenUpdateChromeDialog() { | 2043 void Browser::OpenUpdateChromeDialog() { |
| 2044 UserMetrics::RecordAction(UserMetricsAction("UpdateChrome")); | 2044 UserMetrics::RecordAction(UserMetricsAction("UpdateChrome")); |
| 2045 window_->ShowUpdateChromeDialog(); | 2045 window_->ShowUpdateChromeDialog(); |
| 2046 } | 2046 } |
| 2047 | 2047 |
| 2048 void Browser::OpenHelpTab() { | 2048 void Browser::ShowHelpTab() { |
| 2049 GURL help_url(kHelpContentUrl); | 2049 GURL help_url(kHelpContentUrl); |
| 2050 GURL localized_help_url = google_util::AppendGoogleLocaleParam(help_url); | 2050 GURL localized_help_url = google_util::AppendGoogleLocaleParam(help_url); |
| 2051 AddSelectedTabWithURL(localized_help_url, PageTransition::AUTO_BOOKMARK); | 2051 ShowSingletonTab(localized_help_url); |
| 2052 } | 2052 } |
| 2053 | 2053 |
| 2054 void Browser::OpenThemeGalleryTabAndActivate() { | 2054 void Browser::OpenThemeGalleryTabAndActivate() { |
| 2055 AddSelectedTabWithURL(GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)), | 2055 AddSelectedTabWithURL(GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)), |
| 2056 PageTransition::LINK); | 2056 PageTransition::LINK); |
| 2057 } | 2057 } |
| 2058 | 2058 |
| 2059 void Browser::OpenPrivacyDashboardTabAndActivate() { | 2059 void Browser::OpenPrivacyDashboardTabAndActivate() { |
| 2060 OpenURL(GURL(kPrivacyDashboardUrl), GURL(), | 2060 OpenURL(GURL(kPrivacyDashboardUrl), GURL(), |
| 2061 NEW_FOREGROUND_TAB, PageTransition::LINK); | 2061 NEW_FOREGROUND_TAB, PageTransition::LINK); |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2468 case IDC_MANAGE_EXTENSIONS: ShowExtensionsTab(); break; | 2468 case IDC_MANAGE_EXTENSIONS: ShowExtensionsTab(); break; |
| 2469 case IDC_SYNC_BOOKMARKS: OpenSyncMyBookmarksDialog(); break; | 2469 case IDC_SYNC_BOOKMARKS: OpenSyncMyBookmarksDialog(); break; |
| 2470 case IDC_OPTIONS: OpenOptionsDialog(); break; | 2470 case IDC_OPTIONS: OpenOptionsDialog(); break; |
| 2471 case IDC_EDIT_SEARCH_ENGINES: OpenSearchEngineOptionsDialog(); break; | 2471 case IDC_EDIT_SEARCH_ENGINES: OpenSearchEngineOptionsDialog(); break; |
| 2472 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; | 2472 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; |
| 2473 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; | 2473 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; |
| 2474 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; | 2474 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; |
| 2475 case IDC_ABOUT: OpenAboutChromeDialog(); break; | 2475 case IDC_ABOUT: OpenAboutChromeDialog(); break; |
| 2476 case IDC_UPGRADE_DIALOG: OpenUpdateChromeDialog(); break; | 2476 case IDC_UPGRADE_DIALOG: OpenUpdateChromeDialog(); break; |
| 2477 case IDC_VIEW_INCOMPATIBILITIES: ShowAboutConflictsTab(); break; | 2477 case IDC_VIEW_INCOMPATIBILITIES: ShowAboutConflictsTab(); break; |
| 2478 case IDC_HELP_PAGE: OpenHelpTab(); break; | 2478 case IDC_HELP_PAGE: ShowHelpTab(); break; |
| 2479 #if defined(OS_CHROMEOS) | 2479 #if defined(OS_CHROMEOS) |
| 2480 case IDC_FILE_MANAGER: OpenFileManager(); break; | 2480 case IDC_FILE_MANAGER: OpenFileManager(); break; |
| 2481 case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break; | 2481 case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break; |
| 2482 case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break; | 2482 case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break; |
| 2483 case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break; | 2483 case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break; |
| 2484 #endif | 2484 #endif |
| 2485 | 2485 |
| 2486 default: | 2486 default: |
| 2487 LOG(WARNING) << "Received Unimplemented Command: " << id; | 2487 LOG(WARNING) << "Received Unimplemented Command: " << id; |
| 2488 break; | 2488 break; |
| (...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4695 TabContents* current_tab = GetSelectedTabContents(); | 4695 TabContents* current_tab = GetSelectedTabContents(); |
| 4696 if (current_tab) { | 4696 if (current_tab) { |
| 4697 content_restrictions = current_tab->content_restrictions(); | 4697 content_restrictions = current_tab->content_restrictions(); |
| 4698 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); | 4698 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); |
| 4699 // See comment in UpdateCommandsForTabState about why we call url(). | 4699 // See comment in UpdateCommandsForTabState about why we call url(). |
| 4700 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) | 4700 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) |
| 4701 content_restrictions |= CONTENT_RESTRICTION_SAVE; | 4701 content_restrictions |= CONTENT_RESTRICTION_SAVE; |
| 4702 } | 4702 } |
| 4703 return content_restrictions; | 4703 return content_restrictions; |
| 4704 } | 4704 } |
| OLD | NEW |