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

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

Issue 11440020: Add an outdated upgrade bubble view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More CR comments addressed and now a testable version without current time test yet. Created 7 years, 11 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
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.h" 8 #include "base/metrics/histogram.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/bookmarks/bookmark_model.h" 10 #include "chrome/browser/bookmarks/bookmark_model.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 45 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
46 #include "chrome/browser/ui/find_bar/find_tab_helper.h" 46 #include "chrome/browser/ui/find_bar/find_tab_helper.h"
47 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" 47 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
48 #include "chrome/browser/ui/omnibox/location_bar.h" 48 #include "chrome/browser/ui/omnibox/location_bar.h"
49 #include "chrome/browser/ui/search/search.h" 49 #include "chrome/browser/ui/search/search.h"
50 #include "chrome/browser/ui/search/search_model.h" 50 #include "chrome/browser/ui/search/search_model.h"
51 #include "chrome/browser/ui/status_bubble.h" 51 #include "chrome/browser/ui/status_bubble.h"
52 #include "chrome/browser/ui/tabs/tab_strip_model.h" 52 #include "chrome/browser/ui/tabs/tab_strip_model.h"
53 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" 53 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h"
54 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" 54 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
55 #include "chrome/browser/upgrade_detector.h"
55 #include "chrome/browser/web_applications/web_app.h" 56 #include "chrome/browser/web_applications/web_app.h"
56 #include "chrome/common/chrome_switches.h" 57 #include "chrome/common/chrome_switches.h"
57 #include "chrome/common/pref_names.h" 58 #include "chrome/common/pref_names.h"
58 #include "content/public/browser/devtools_agent_host.h" 59 #include "content/public/browser/devtools_agent_host.h"
59 #include "content/public/browser/navigation_controller.h" 60 #include "content/public/browser/navigation_controller.h"
60 #include "content/public/browser/navigation_entry.h" 61 #include "content/public/browser/navigation_entry.h"
61 #include "content/public/browser/page_navigator.h" 62 #include "content/public/browser/page_navigator.h"
62 #include "content/public/browser/render_view_host.h" 63 #include "content/public/browser/render_view_host.h"
63 #include "content/public/browser/user_metrics.h" 64 #include "content/public/browser/user_metrics.h"
64 #include "content/public/browser/web_contents.h" 65 #include "content/public/browser/web_contents.h"
(...skipping 12 matching lines...) Expand all
77 #include "ui/base/cocoa/find_pasteboard.h" 78 #include "ui/base/cocoa/find_pasteboard.h"
78 #endif 79 #endif
79 80
80 #if defined(OS_WIN) 81 #if defined(OS_WIN)
81 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" 82 #include "chrome/browser/ui/metro_pin_tab_helper_win.h"
82 #include "win8/util/win8_util.h" 83 #include "win8/util/win8_util.h"
83 #endif 84 #endif
84 85
85 namespace { 86 namespace {
86 const char kOsOverrideForTabletSite[] = "Linux; Android 4.0.3"; 87 const char kOsOverrideForTabletSite[] = "Linux; Android 4.0.3";
88
89 const char kDownloadChromeUrl[] = "https://www.google.com/chrome";
87 } 90 }
88 91
89 using content::NavigationController; 92 using content::NavigationController;
90 using content::NavigationEntry; 93 using content::NavigationEntry;
91 using content::OpenURLParams; 94 using content::OpenURLParams;
92 using content::Referrer; 95 using content::Referrer;
93 using content::SSLStatus; 96 using content::SSLStatus;
94 using content::UserMetricsAction; 97 using content::UserMetricsAction;
95 using content::WebContents; 98 using content::WebContents;
96 99
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 908
906 void ShowAppMenu(Browser* browser) { 909 void ShowAppMenu(Browser* browser) {
907 // We record the user metric for this event in WrenchMenu::RunMenu. 910 // We record the user metric for this event in WrenchMenu::RunMenu.
908 browser->window()->ShowAppMenu(); 911 browser->window()->ShowAppMenu();
909 } 912 }
910 913
911 void ShowAvatarMenu(Browser* browser) { 914 void ShowAvatarMenu(Browser* browser) {
912 browser->window()->ShowAvatarBubbleFromAvatarButton(); 915 browser->window()->ShowAvatarBubbleFromAvatarButton();
913 } 916 }
914 917
918 void NavigateToChromeInstallPage(Browser* browser) {
919 content::RecordAction(
920 content::UserMetricsAction("OutdatedUpgradeReinstall"));
Finnur 2013/01/24 10:13:33 This is a general purpose browser commands file, s
MAD 2013/01/24 17:29:35 I thought actually that it might be useful to have
Finnur 2013/01/25 11:39:22 I was thinking either making the UMA metric more g
921 chrome::AddSelectedTabWithURL(
922 browser, GURL(kDownloadChromeUrl), content::PAGE_TRANSITION_LINK);
923 }
924
915 void OpenUpdateChromeDialog(Browser* browser) { 925 void OpenUpdateChromeDialog(Browser* browser) {
916 content::RecordAction(UserMetricsAction("UpdateChrome")); 926 if (UpgradeDetector::GetInstance()->IsOutdatedInstall()) {
917 browser->window()->ShowUpdateChromeDialog(); 927 NavigateToChromeInstallPage(browser);
928 } else {
929 content::RecordAction(UserMetricsAction("UpdateChrome"));
930 browser->window()->ShowUpdateChromeDialog();
931 }
918 } 932 }
919 933
920 void ToggleSpeechInput(Browser* browser) { 934 void ToggleSpeechInput(Browser* browser) {
921 browser->tab_strip_model()->GetActiveWebContents()-> 935 browser->tab_strip_model()->GetActiveWebContents()->
922 GetRenderViewHost()->ToggleSpeechInput(); 936 GetRenderViewHost()->ToggleSpeechInput();
923 } 937 }
924 938
925 bool CanRequestTabletSite(WebContents* current_tab) { 939 bool CanRequestTabletSite(WebContents* current_tab) {
926 if (!current_tab) 940 if (!current_tab)
927 return false; 941 return false;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 Browser::CreateParams::CreateForApp( 1103 Browser::CreateParams::CreateForApp(
1090 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile())); 1104 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile()));
1091 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1105 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1092 1106
1093 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1107 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1094 contents->GetRenderViewHost()->SyncRendererPrefs(); 1108 contents->GetRenderViewHost()->SyncRendererPrefs();
1095 app_browser->window()->Show(); 1109 app_browser->window()->Show();
1096 } 1110 }
1097 1111
1098 } // namespace chrome 1112 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698