| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_commands.h" | 5 #include "chrome/browser/ui/browser_commands.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/lifetime/application_lifetime.h" | 23 #include "chrome/browser/lifetime/application_lifetime.h" |
| 24 #include "chrome/browser/platform_util.h" | 24 #include "chrome/browser/platform_util.h" |
| 25 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 25 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 27 #include "chrome/browser/rlz/rlz.h" | 27 #include "chrome/browser/rlz/rlz.h" |
| 28 #include "chrome/browser/search/search.h" | 28 #include "chrome/browser/search/search.h" |
| 29 #include "chrome/browser/sessions/session_service_factory.h" | 29 #include "chrome/browser/sessions/session_service_factory.h" |
| 30 #include "chrome/browser/sessions/tab_restore_service.h" | 30 #include "chrome/browser/sessions/tab_restore_service.h" |
| 31 #include "chrome/browser/sessions/tab_restore_service_delegate.h" | 31 #include "chrome/browser/sessions/tab_restore_service_delegate.h" |
| 32 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 32 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 33 #include "chrome/browser/signin/signin_header_helper.h" |
| 33 #include "chrome/browser/translate/translate_tab_helper.h" | 34 #include "chrome/browser/translate/translate_tab_helper.h" |
| 34 #include "chrome/browser/ui/accelerator_utils.h" | 35 #include "chrome/browser/ui/accelerator_utils.h" |
| 35 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 36 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| 36 #include "chrome/browser/ui/browser.h" | 37 #include "chrome/browser/ui/browser.h" |
| 37 #include "chrome/browser/ui/browser_command_controller.h" | 38 #include "chrome/browser/ui/browser_command_controller.h" |
| 38 #include "chrome/browser/ui/browser_dialogs.h" | 39 #include "chrome/browser/ui/browser_dialogs.h" |
| 39 #include "chrome/browser/ui/browser_instant_controller.h" | 40 #include "chrome/browser/ui/browser_instant_controller.h" |
| 40 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 41 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
| 41 #include "chrome/browser/ui/browser_tabstrip.h" | 42 #include "chrome/browser/ui/browser_tabstrip.h" |
| 42 #include "chrome/browser/ui/browser_window.h" | 43 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 ToggleBookmarkBarWhenVisible(browser->profile()); | 1036 ToggleBookmarkBarWhenVisible(browser->profile()); |
| 1036 } | 1037 } |
| 1037 | 1038 |
| 1038 void ShowAppMenu(Browser* browser) { | 1039 void ShowAppMenu(Browser* browser) { |
| 1039 // We record the user metric for this event in WrenchMenu::RunMenu. | 1040 // We record the user metric for this event in WrenchMenu::RunMenu. |
| 1040 browser->window()->ShowAppMenu(); | 1041 browser->window()->ShowAppMenu(); |
| 1041 } | 1042 } |
| 1042 | 1043 |
| 1043 void ShowAvatarMenu(Browser* browser) { | 1044 void ShowAvatarMenu(Browser* browser) { |
| 1044 browser->window()->ShowAvatarBubbleFromAvatarButton( | 1045 browser->window()->ShowAvatarBubbleFromAvatarButton( |
| 1045 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT); | 1046 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT, |
| 1047 signin::GAIA_SERVICE_TYPE_NONE); |
| 1046 } | 1048 } |
| 1047 | 1049 |
| 1048 void OpenUpdateChromeDialog(Browser* browser) { | 1050 void OpenUpdateChromeDialog(Browser* browser) { |
| 1049 if (UpgradeDetector::GetInstance()->is_outdated_install()) { | 1051 if (UpgradeDetector::GetInstance()->is_outdated_install()) { |
| 1050 content::NotificationService::current()->Notify( | 1052 content::NotificationService::current()->Notify( |
| 1051 chrome::NOTIFICATION_OUTDATED_INSTALL, | 1053 chrome::NOTIFICATION_OUTDATED_INSTALL, |
| 1052 content::NotificationService::AllSources(), | 1054 content::NotificationService::AllSources(), |
| 1053 content::NotificationService::NoDetails()); | 1055 content::NotificationService::NoDetails()); |
| 1054 } else if (UpgradeDetector::GetInstance()->is_outdated_install_no_au()) { | 1056 } else if (UpgradeDetector::GetInstance()->is_outdated_install_no_au()) { |
| 1055 content::NotificationService::current()->Notify( | 1057 content::NotificationService::current()->Notify( |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 browser->profile(), | 1260 browser->profile(), |
| 1259 browser->host_desktop_type())); | 1261 browser->host_desktop_type())); |
| 1260 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1262 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1261 | 1263 |
| 1262 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1264 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1263 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1265 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1264 app_browser->window()->Show(); | 1266 app_browser->window()->Show(); |
| 1265 } | 1267 } |
| 1266 | 1268 |
| 1267 } // namespace chrome | 1269 } // namespace chrome |
| OLD | NEW |