| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 using base::TimeDelta; | 135 using base::TimeDelta; |
| 136 | 136 |
| 137 /////////////////////////////////////////////////////////////////////////////// | 137 /////////////////////////////////////////////////////////////////////////////// |
| 138 | 138 |
| 139 namespace { | 139 namespace { |
| 140 | 140 |
| 141 // The URL to be loaded to display Help. | 141 // The URL to be loaded to display Help. |
| 142 #if defined(OS_CHROMEOS) | 142 #if defined(OS_CHROMEOS) |
| 143 const char kHelpContentUrl[] = | 143 const char kHelpContentUrl[] = |
| 144 "chrome-extension://honijodknafkokifofgiaalefdiedpko/main.html"; | 144 "chrome-extension://honijodknafkokifofgiaalefdiedpko/main.html"; |
| 145 const char kHelpContentOnlineUrl[] = | |
| 146 "http://www.google.com/support/chromeos/"; | |
| 147 #else | 145 #else |
| 148 const char kHelpContentUrl[] = | 146 const char kHelpContentUrl[] = |
| 149 "http://www.google.com/support/chrome/"; | 147 "http://www.google.com/support/chrome/"; |
| 150 #endif | 148 #endif |
| 151 | 149 |
| 152 // The URL to be opened when the Help link on the Autofill dialog is clicked. | 150 // The URL to be opened when the Help link on the Autofill dialog is clicked. |
| 153 const char kAutofillHelpUrl[] = | 151 const char kAutofillHelpUrl[] = |
| 154 #if defined(OS_CHROMEOS) | 152 #if defined(OS_CHROMEOS) |
| 155 "http://www.google.com/support/chromeos/bin/answer.py?answer=142893"; | 153 "http://www.google.com/support/chromeos/bin/answer.py?answer=142893"; |
| 156 #else | 154 #else |
| (...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1855 #endif | 1853 #endif |
| 1856 } | 1854 } |
| 1857 | 1855 |
| 1858 void Browser::OpenUpdateChromeDialog() { | 1856 void Browser::OpenUpdateChromeDialog() { |
| 1859 UserMetrics::RecordAction(UserMetricsAction("UpdateChrome"), profile_); | 1857 UserMetrics::RecordAction(UserMetricsAction("UpdateChrome"), profile_); |
| 1860 window_->ShowUpdateChromeDialog(); | 1858 window_->ShowUpdateChromeDialog(); |
| 1861 } | 1859 } |
| 1862 | 1860 |
| 1863 void Browser::OpenHelpTab() { | 1861 void Browser::OpenHelpTab() { |
| 1864 GURL help_url(kHelpContentUrl); | 1862 GURL help_url(kHelpContentUrl); |
| 1865 #if defined(OS_CHROMEOS) | |
| 1866 // TODO(nkostylev): Always redirect to HelpApp http://crosbug.com/6923 | |
| 1867 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) | |
| 1868 help_url = GURL(kHelpContentOnlineUrl); | |
| 1869 #endif | |
| 1870 GURL localized_help_url = google_util::AppendGoogleLocaleParam(help_url); | 1863 GURL localized_help_url = google_util::AppendGoogleLocaleParam(help_url); |
| 1871 AddSelectedTabWithURL(localized_help_url, PageTransition::AUTO_BOOKMARK); | 1864 AddSelectedTabWithURL(localized_help_url, PageTransition::AUTO_BOOKMARK); |
| 1872 } | 1865 } |
| 1873 | 1866 |
| 1874 void Browser::OpenThemeGalleryTabAndActivate() { | 1867 void Browser::OpenThemeGalleryTabAndActivate() { |
| 1875 AddSelectedTabWithURL(GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)), | 1868 AddSelectedTabWithURL(GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)), |
| 1876 PageTransition::LINK); | 1869 PageTransition::LINK); |
| 1877 } | 1870 } |
| 1878 | 1871 |
| 1879 void Browser::OpenPrivacyDashboardTabAndActivate() { | 1872 void Browser::OpenPrivacyDashboardTabAndActivate() { |
| (...skipping 2382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4262 // The page transition below is only for the purpose of inserting the tab. | 4255 // The page transition below is only for the purpose of inserting the tab. |
| 4263 browser->AddTab(view_source_contents, PageTransition::LINK); | 4256 browser->AddTab(view_source_contents, PageTransition::LINK); |
| 4264 } | 4257 } |
| 4265 | 4258 |
| 4266 if (profile_->HasSessionService()) { | 4259 if (profile_->HasSessionService()) { |
| 4267 SessionService* session_service = profile_->GetSessionService(); | 4260 SessionService* session_service = profile_->GetSessionService(); |
| 4268 if (session_service) | 4261 if (session_service) |
| 4269 session_service->TabRestored(&view_source_contents->controller(), false); | 4262 session_service->TabRestored(&view_source_contents->controller(), false); |
| 4270 } | 4263 } |
| 4271 } | 4264 } |
| OLD | NEW |