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 <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 2057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2068 | 2068 |
2069 void Browser::OpenBookmarkManagerAddNodeIn(int64 node_id) { | 2069 void Browser::OpenBookmarkManagerAddNodeIn(int64 node_id) { |
2070 OpenBookmarkManagerWithHash("a=", node_id); | 2070 OpenBookmarkManagerWithHash("a=", node_id); |
2071 } | 2071 } |
2072 | 2072 |
2073 void Browser::ShowAppMenu() { | 2073 void Browser::ShowAppMenu() { |
2074 // We record the user metric for this event in WrenchMenu::RunMenu. | 2074 // We record the user metric for this event in WrenchMenu::RunMenu. |
2075 window_->ShowAppMenu(); | 2075 window_->ShowAppMenu(); |
2076 } | 2076 } |
2077 | 2077 |
| 2078 void Browser::ShowAvatarMenu() { |
| 2079 window_->ShowAvatarBubbleFromAvatarButton(); |
| 2080 } |
| 2081 |
2078 void Browser::ShowHistoryTab() { | 2082 void Browser::ShowHistoryTab() { |
2079 UserMetrics::RecordAction(UserMetricsAction("ShowHistory")); | 2083 UserMetrics::RecordAction(UserMetricsAction("ShowHistory")); |
2080 ShowSingletonTabOverwritingNTP( | 2084 ShowSingletonTabOverwritingNTP( |
2081 GetSingletonTabNavigateParams(GURL(chrome::kChromeUIHistoryURL))); | 2085 GetSingletonTabNavigateParams(GURL(chrome::kChromeUIHistoryURL))); |
2082 } | 2086 } |
2083 | 2087 |
2084 void Browser::ShowDownloadsTab() { | 2088 void Browser::ShowDownloadsTab() { |
2085 UserMetrics::RecordAction(UserMetricsAction("ShowDownloads")); | 2089 UserMetrics::RecordAction(UserMetricsAction("ShowDownloads")); |
2086 #if !defined(OS_CHROMEOS) | 2090 #if !defined(OS_CHROMEOS) |
2087 // ChromiumOS uses ActiveDownloadsUI instead of of DownloadShelf. | 2091 // ChromiumOS uses ActiveDownloadsUI instead of of DownloadShelf. |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2765 break; | 2769 break; |
2766 case IDC_TASK_MANAGER: OpenTaskManager(false); break; | 2770 case IDC_TASK_MANAGER: OpenTaskManager(false); break; |
2767 case IDC_VIEW_BACKGROUND_PAGES: OpenTaskManager(true); break; | 2771 case IDC_VIEW_BACKGROUND_PAGES: OpenTaskManager(true); break; |
2768 case IDC_FEEDBACK: OpenBugReportDialog(); break; | 2772 case IDC_FEEDBACK: OpenBugReportDialog(); break; |
2769 | 2773 |
2770 case IDC_SHOW_BOOKMARK_BAR: ToggleBookmarkBar(); break; | 2774 case IDC_SHOW_BOOKMARK_BAR: ToggleBookmarkBar(); break; |
2771 case IDC_PROFILING_ENABLED: Profiling::Toggle(); break; | 2775 case IDC_PROFILING_ENABLED: Profiling::Toggle(); break; |
2772 | 2776 |
2773 case IDC_SHOW_BOOKMARK_MANAGER: OpenBookmarkManager(); break; | 2777 case IDC_SHOW_BOOKMARK_MANAGER: OpenBookmarkManager(); break; |
2774 case IDC_SHOW_APP_MENU: ShowAppMenu(); break; | 2778 case IDC_SHOW_APP_MENU: ShowAppMenu(); break; |
| 2779 case IDC_SHOW_AVATAR_MENU: ShowAvatarMenu(); break; |
2775 case IDC_SHOW_HISTORY: ShowHistoryTab(); break; | 2780 case IDC_SHOW_HISTORY: ShowHistoryTab(); break; |
2776 case IDC_SHOW_DOWNLOADS: ShowDownloadsTab(); break; | 2781 case IDC_SHOW_DOWNLOADS: ShowDownloadsTab(); break; |
2777 case IDC_MANAGE_EXTENSIONS: ShowExtensionsTab(); break; | 2782 case IDC_MANAGE_EXTENSIONS: ShowExtensionsTab(); break; |
2778 case IDC_SYNC_BOOKMARKS: OpenSyncMyBookmarksDialog(); break; | 2783 case IDC_SYNC_BOOKMARKS: OpenSyncMyBookmarksDialog(); break; |
2779 case IDC_OPTIONS: OpenOptionsDialog(); break; | 2784 case IDC_OPTIONS: OpenOptionsDialog(); break; |
2780 case IDC_EDIT_SEARCH_ENGINES: OpenSearchEngineOptionsDialog(); break; | 2785 case IDC_EDIT_SEARCH_ENGINES: OpenSearchEngineOptionsDialog(); break; |
2781 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; | 2786 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; |
2782 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; | 2787 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; |
2783 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; | 2788 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; |
2784 case IDC_ABOUT: OpenAboutChromeDialog(); break; | 2789 case IDC_ABOUT: OpenAboutChromeDialog(); break; |
(...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4582 command_updater_.UpdateCommandEnabled(IDC_FEEDBACK, show_main_ui); | 4587 command_updater_.UpdateCommandEnabled(IDC_FEEDBACK, show_main_ui); |
4583 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, show_main_ui); | 4588 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, show_main_ui); |
4584 command_updater_.UpdateCommandEnabled(IDC_SYNC_BOOKMARKS, | 4589 command_updater_.UpdateCommandEnabled(IDC_SYNC_BOOKMARKS, |
4585 show_main_ui && profile_->GetOriginalProfile()->IsSyncAccessible()); | 4590 show_main_ui && profile_->GetOriginalProfile()->IsSyncAccessible()); |
4586 | 4591 |
4587 command_updater_.UpdateCommandEnabled(IDC_OPTIONS, show_main_ui); | 4592 command_updater_.UpdateCommandEnabled(IDC_OPTIONS, show_main_ui); |
4588 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); | 4593 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); |
4589 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); | 4594 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); |
4590 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); | 4595 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); |
4591 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); | 4596 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); |
| 4597 command_updater_.UpdateCommandEnabled(IDC_SHOW_AVATAR_MENU, |
| 4598 show_main_ui && !profile()->IsOffTheRecord()); |
4592 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC) | 4599 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC) |
4593 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); | 4600 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); |
4594 #endif | 4601 #endif |
4595 | 4602 |
4596 UpdateCommandsForBookmarkBar(); | 4603 UpdateCommandsForBookmarkBar(); |
4597 } | 4604 } |
4598 | 4605 |
4599 void Browser::UpdateCommandsForTabState() { | 4606 void Browser::UpdateCommandsForTabState() { |
4600 TabContents* current_tab = GetSelectedTabContents(); | 4607 TabContents* current_tab = GetSelectedTabContents(); |
4601 TabContentsWrapper* current_tab_wrapper = GetSelectedTabContentsWrapper(); | 4608 TabContentsWrapper* current_tab_wrapper = GetSelectedTabContentsWrapper(); |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5499 } | 5506 } |
5500 | 5507 |
5501 void Browser::UpdateFullscreenExitBubbleContent() { | 5508 void Browser::UpdateFullscreenExitBubbleContent() { |
5502 GURL url; | 5509 GURL url; |
5503 if (fullscreened_tab_) | 5510 if (fullscreened_tab_) |
5504 url = fullscreened_tab_->tab_contents()->GetURL(); | 5511 url = fullscreened_tab_->tab_contents()->GetURL(); |
5505 | 5512 |
5506 window_->UpdateFullscreenExitBubbleContent( | 5513 window_->UpdateFullscreenExitBubbleContent( |
5507 url, GetFullscreenExitBubbleType()); | 5514 url, GetFullscreenExitBubbleType()); |
5508 } | 5515 } |
OLD | NEW |