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

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

Issue 2925973002: Migrate upgrade notifications to observer (Closed)
Patch Set: Add DISALLOW_COPY_AND_ASSIGN Created 3 years, 6 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
OLDNEW
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_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/metrics/user_metrics.h" 9 #include "base/metrics/user_metrics.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "chrome/app/chrome_command_ids.h" 12 #include "chrome/app/chrome_command_ids.h"
13 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 13 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/browsing_data/browsing_data_helper.h" 15 #include "chrome/browser/browsing_data/browsing_data_helper.h"
16 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" 16 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
17 #include "chrome/browser/chrome_notification_types.h"
18 #include "chrome/browser/devtools/devtools_window.h" 17 #include "chrome/browser/devtools/devtools_window.h"
19 #include "chrome/browser/dom_distiller/tab_utils.h" 18 #include "chrome/browser/dom_distiller/tab_utils.h"
20 #include "chrome/browser/lifetime/application_lifetime.h" 19 #include "chrome/browser/lifetime/application_lifetime.h"
21 #include "chrome/browser/media/router/media_router_dialog_controller.h" // nogn check 20 #include "chrome/browser/media/router/media_router_dialog_controller.h" // nogn check
22 #include "chrome/browser/media/router/media_router_feature.h" 21 #include "chrome/browser/media/router/media_router_feature.h"
23 #include "chrome/browser/platform_util.h" 22 #include "chrome/browser/platform_util.h"
24 #include "chrome/browser/prefs/incognito_mode_prefs.h" 23 #include "chrome/browser/prefs/incognito_mode_prefs.h"
25 #include "chrome/browser/profiles/profile.h" 24 #include "chrome/browser/profiles/profile.h"
26 #include "chrome/browser/sessions/session_service_factory.h" 25 #include "chrome/browser/sessions/session_service_factory.h"
27 #include "chrome/browser/sessions/tab_restore_service_factory.h" 26 #include "chrome/browser/sessions/tab_restore_service_factory.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 #include "components/signin/core/browser/signin_header_helper.h" 67 #include "components/signin/core/browser/signin_header_helper.h"
69 #include "components/translate/core/browser/language_state.h" 68 #include "components/translate/core/browser/language_state.h"
70 #include "components/version_info/version_info.h" 69 #include "components/version_info/version_info.h"
71 #include "components/web_modal/web_contents_modal_dialog_manager.h" 70 #include "components/web_modal/web_contents_modal_dialog_manager.h"
72 #include "components/zoom/page_zoom.h" 71 #include "components/zoom/page_zoom.h"
73 #include "components/zoom/zoom_controller.h" 72 #include "components/zoom/zoom_controller.h"
74 #include "content/public/browser/browsing_data_remover.h" 73 #include "content/public/browser/browsing_data_remover.h"
75 #include "content/public/browser/devtools_agent_host.h" 74 #include "content/public/browser/devtools_agent_host.h"
76 #include "content/public/browser/navigation_controller.h" 75 #include "content/public/browser/navigation_controller.h"
77 #include "content/public/browser/navigation_entry.h" 76 #include "content/public/browser/navigation_entry.h"
78 #include "content/public/browser/notification_service.h"
79 #include "content/public/browser/page_navigator.h" 77 #include "content/public/browser/page_navigator.h"
80 #include "content/public/browser/render_view_host.h" 78 #include "content/public/browser/render_view_host.h"
81 #include "content/public/browser/render_widget_host_view.h" 79 #include "content/public/browser/render_widget_host_view.h"
82 #include "content/public/browser/web_contents.h" 80 #include "content/public/browser/web_contents.h"
83 #include "content/public/common/page_state.h" 81 #include "content/public/common/page_state.h"
84 #include "content/public/common/renderer_preferences.h" 82 #include "content/public/common/renderer_preferences.h"
85 #include "content/public/common/url_constants.h" 83 #include "content/public/common/url_constants.h"
86 #include "content/public/common/url_utils.h" 84 #include "content/public/common/url_utils.h"
87 #include "content/public/common/user_agent.h" 85 #include "content/public/common/user_agent.h"
88 #include "extensions/features/features.h" 86 #include "extensions/features/features.h"
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 } 1130 }
1133 1131
1134 void ShowAvatarMenu(Browser* browser) { 1132 void ShowAvatarMenu(Browser* browser) {
1135 browser->window()->ShowAvatarBubbleFromAvatarButton( 1133 browser->window()->ShowAvatarBubbleFromAvatarButton(
1136 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT, signin::ManageAccountsParams(), 1134 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT, signin::ManageAccountsParams(),
1137 signin_metrics::AccessPoint::ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN, true); 1135 signin_metrics::AccessPoint::ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN, true);
1138 } 1136 }
1139 1137
1140 void OpenUpdateChromeDialog(Browser* browser) { 1138 void OpenUpdateChromeDialog(Browser* browser) {
1141 if (UpgradeDetector::GetInstance()->is_outdated_install()) { 1139 if (UpgradeDetector::GetInstance()->is_outdated_install()) {
1142 content::NotificationService::current()->Notify( 1140 UpgradeDetector::GetInstance()->NotifyOutdatedInstall();
1143 chrome::NOTIFICATION_OUTDATED_INSTALL,
1144 content::NotificationService::AllSources(),
1145 content::NotificationService::NoDetails());
1146 } else if (UpgradeDetector::GetInstance()->is_outdated_install_no_au()) { 1141 } else if (UpgradeDetector::GetInstance()->is_outdated_install_no_au()) {
1147 content::NotificationService::current()->Notify( 1142 UpgradeDetector::GetInstance()->NotifyOutdatedInstallNoAutoUpdate();
1148 chrome::NOTIFICATION_OUTDATED_INSTALL_NO_AU,
1149 content::NotificationService::AllSources(),
1150 content::NotificationService::NoDetails());
1151 } else { 1143 } else {
1152 base::RecordAction(UserMetricsAction("UpdateChrome")); 1144 base::RecordAction(UserMetricsAction("UpdateChrome"));
1153 browser->window()->ShowUpdateChromeDialog(); 1145 browser->window()->ShowUpdateChromeDialog();
1154 } 1146 }
1155 } 1147 }
1156 1148
1157 void DistillCurrentPage(Browser* browser) { 1149 void DistillCurrentPage(Browser* browser) {
1158 DistillCurrentPageAndView(browser->tab_strip_model()->GetActiveWebContents()); 1150 DistillCurrentPageAndView(browser->tab_strip_model()->GetActiveWebContents());
1159 } 1151 }
1160 1152
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 } 1302 }
1311 1303
1312 bool CanCreateBookmarkApp(const Browser* browser) { 1304 bool CanCreateBookmarkApp(const Browser* browser) {
1313 return extensions::TabHelper::FromWebContents( 1305 return extensions::TabHelper::FromWebContents(
1314 browser->tab_strip_model()->GetActiveWebContents()) 1306 browser->tab_strip_model()->GetActiveWebContents())
1315 ->CanCreateBookmarkApp(); 1307 ->CanCreateBookmarkApp();
1316 } 1308 }
1317 #endif // BUILDFLAG(ENABLE_EXTENSIONS) 1309 #endif // BUILDFLAG(ENABLE_EXTENSIONS)
1318 1310
1319 } // namespace chrome 1311 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/system_tray_client_browsertest.cc ('k') | chrome/browser/ui/toolbar/app_menu_icon_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698