| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/chrome_pages.h" | 5 #include "chrome/browser/ui/chrome_pages.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "chrome/browser/download/download_shelf.h" | 10 #include "chrome/browser/download/download_shelf.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/signin/signin_manager.h" | 12 #include "chrome/browser/signin/signin_manager.h" |
| 13 #include "chrome/browser/signin/signin_manager_factory.h" | 13 #include "chrome/browser/signin/signin_manager_factory.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_finder.h" | 15 #include "chrome/browser/ui/browser_finder.h" |
| 16 #include "chrome/browser/ui/browser_navigator.h" | 16 #include "chrome/browser/ui/browser_navigator.h" |
| 17 #include "chrome/browser/ui/browser_window.h" | 17 #include "chrome/browser/ui/browser_window.h" |
| 18 #include "chrome/browser/ui/singleton_tabs.h" | 18 #include "chrome/browser/ui/singleton_tabs.h" |
| 19 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 19 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 20 #include "chrome/browser/ui/webui/options/content_settings_handler.h" | 20 #include "chrome/browser/ui/webui/options/content_settings_handler.h" |
| 21 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 21 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 22 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 22 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 23 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" | 23 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" |
| 24 #include "chrome/common/url_constants.h" | 24 #include "chrome/common/url_constants.h" |
| 25 #include "content/public/browser/user_metrics.h" | 25 #include "content/public/browser/user_metrics.h" |
| 26 #include "google_apis/gaia/gaia_urls.h" | 26 #include "google_apis/gaia/gaia_urls.h" |
| 27 #include "googleurl/src/gurl.h" | 27 #include "googleurl/src/gurl.h" |
| 28 #include "net/base/url_util.h" | 28 #include "net/base/url_util.h" |
| 29 | 29 |
| 30 #if defined(OS_WIN) |
| 31 #include "chrome/browser/enumerate_modules_model_win.h" |
| 32 #endif |
| 33 |
| 30 using content::UserMetricsAction; | 34 using content::UserMetricsAction; |
| 31 | 35 |
| 32 namespace chrome { | 36 namespace chrome { |
| 33 namespace { | 37 namespace { |
| 34 | 38 |
| 35 const char kHashMark[] = "#"; | 39 const char kHashMark[] = "#"; |
| 36 | 40 |
| 37 void OpenBookmarkManagerWithHash(Browser* browser, | 41 void OpenBookmarkManagerWithHash(Browser* browser, |
| 38 const std::string& action, | 42 const std::string& action, |
| 39 int64 node_id) { | 43 int64 node_id) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 GURL::Replacements replacements; | 103 GURL::Replacements replacements; |
| 100 std::string query("id="); | 104 std::string query("id="); |
| 101 query += extension_to_highlight; | 105 query += extension_to_highlight; |
| 102 replacements.SetQueryStr(query); | 106 replacements.SetQueryStr(query); |
| 103 params.url = params.url.ReplaceComponents(replacements); | 107 params.url = params.url.ReplaceComponents(replacements); |
| 104 } | 108 } |
| 105 ShowSingletonTabOverwritingNTP(browser, params); | 109 ShowSingletonTabOverwritingNTP(browser, params); |
| 106 } | 110 } |
| 107 | 111 |
| 108 void ShowConflicts(Browser* browser) { | 112 void ShowConflicts(Browser* browser) { |
| 113 #if defined(OS_WIN) |
| 114 EnumerateModulesModel* model = EnumerateModulesModel::GetInstance(); |
| 115 if (model->modules_to_notify_about() > 0) { |
| 116 GURL help_center_url = model->GetFirstNotableConflict(); |
| 117 if (help_center_url.is_valid()) { |
| 118 EnumerateModulesModel::RecordLearnMoreStat(true); |
| 119 ShowSingletonTab(browser, help_center_url); |
| 120 model->AcknowledgeConflictNotification(); |
| 121 return; |
| 122 } |
| 123 } |
| 124 #endif |
| 125 |
| 109 content::RecordAction(UserMetricsAction("AboutConflicts")); | 126 content::RecordAction(UserMetricsAction("AboutConflicts")); |
| 110 ShowSingletonTab(browser, GURL(kChromeUIConflictsURL)); | 127 ShowSingletonTab(browser, GURL(kChromeUIConflictsURL)); |
| 111 } | 128 } |
| 112 | 129 |
| 113 void ShowHelp(Browser* browser, HelpSource source) { | 130 void ShowHelp(Browser* browser, HelpSource source) { |
| 114 content::RecordAction(UserMetricsAction("ShowHelpTab")); | 131 content::RecordAction(UserMetricsAction("ShowHelpTab")); |
| 115 GURL url; | 132 GURL url; |
| 116 switch (source) { | 133 switch (source) { |
| 117 case HELP_SOURCE_KEYBOARD: | 134 case HELP_SOURCE_KEYBOARD: |
| 118 url = GURL(kChromeHelpViaKeyboardURL); | 135 url = GURL(kChromeHelpViaKeyboardURL); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 const std::string& service, | 255 const std::string& service, |
| 239 const GURL& continue_url) { | 256 const GURL& continue_url) { |
| 240 GURL url(GaiaUrls::GetInstance()->service_login_url()); | 257 GURL url(GaiaUrls::GetInstance()->service_login_url()); |
| 241 url = net::AppendQueryParameter(url, "service", service); | 258 url = net::AppendQueryParameter(url, "service", service); |
| 242 if (continue_url.is_valid()) | 259 if (continue_url.is_valid()) |
| 243 url = net::AppendQueryParameter(url, "continue", continue_url.spec()); | 260 url = net::AppendQueryParameter(url, "continue", continue_url.spec()); |
| 244 NavigateToSingletonTab(browser, url); | 261 NavigateToSingletonTab(browser, url); |
| 245 } | 262 } |
| 246 | 263 |
| 247 } // namespace chrome | 264 } // namespace chrome |
| OLD | NEW |