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

Side by Side Diff: trunk/src/chrome/browser/ui/webui/help/help_handler.cc

Issue 192283002: Revert 255858 "Simplify the user agent code some more since afte..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 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 (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/webui/help/help_handler.h" 5 #include "chrome/browser/ui/webui/help/help_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/chrome_notification_types.h" 18 #include "chrome/browser/chrome_notification_types.h"
19 #include "chrome/browser/google/google_util.h" 19 #include "chrome/browser/google/google_util.h"
20 #include "chrome/browser/ui/browser.h" 20 #include "chrome/browser/ui/browser.h"
21 #include "chrome/browser/ui/browser_commands.h" 21 #include "chrome/browser/ui/browser_commands.h"
22 #include "chrome/browser/ui/browser_finder.h" 22 #include "chrome/browser/ui/browser_finder.h"
23 #include "chrome/browser/ui/chrome_pages.h" 23 #include "chrome/browser/ui/chrome_pages.h"
24 #include "chrome/common/chrome_content_client.h"
25 #include "chrome/common/chrome_version_info.h" 24 #include "chrome/common/chrome_version_info.h"
26 #include "chrome/common/pref_names.h" 25 #include "chrome/common/pref_names.h"
27 #include "chrome/common/url_constants.h" 26 #include "chrome/common/url_constants.h"
28 #include "content/public/browser/browser_thread.h" 27 #include "content/public/browser/browser_thread.h"
29 #include "content/public/browser/notification_service.h" 28 #include "content/public/browser/notification_service.h"
30 #include "content/public/browser/web_ui.h" 29 #include "content/public/browser/web_ui.h"
31 #include "content/public/browser/web_ui_data_source.h" 30 #include "content/public/browser/web_ui_data_source.h"
31 #include "content/public/common/content_client.h"
32 #include "grit/chromium_strings.h" 32 #include "grit/chromium_strings.h"
33 #include "grit/generated_resources.h" 33 #include "grit/generated_resources.h"
34 #include "grit/google_chrome_strings.h" 34 #include "grit/google_chrome_strings.h"
35 #include "ui/base/l10n/l10n_util.h" 35 #include "ui/base/l10n/l10n_util.h"
36 #include "ui/base/resource/resource_bundle.h" 36 #include "ui/base/resource/resource_bundle.h"
37 #include "v8/include/v8.h" 37 #include "v8/include/v8.h"
38 #include "webkit/common/user_agent/user_agent_util.h" 38 #include "webkit/common/user_agent/user_agent_util.h"
39 39
40 #if defined(OS_MACOSX) 40 #if defined(OS_MACOSX)
41 #include "chrome/browser/mac/obsolete_system.h" 41 #include "chrome/browser/mac/obsolete_system.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 base::string16 tos = l10n_util::GetStringFUTF16( 274 base::string16 tos = l10n_util::GetStringFUTF16(
275 IDS_ABOUT_TERMS_OF_SERVICE, base::UTF8ToUTF16(chrome::kChromeUITermsURL)); 275 IDS_ABOUT_TERMS_OF_SERVICE, base::UTF8ToUTF16(chrome::kChromeUITermsURL));
276 source->AddString("productTOS", tos); 276 source->AddString("productTOS", tos);
277 277
278 source->AddString("webkitVersion", webkit_glue::GetWebKitVersion()); 278 source->AddString("webkitVersion", webkit_glue::GetWebKitVersion());
279 279
280 source->AddString("jsEngine", "V8"); 280 source->AddString("jsEngine", "V8");
281 source->AddString("jsEngineVersion", v8::V8::GetVersion()); 281 source->AddString("jsEngineVersion", v8::V8::GetVersion());
282 282
283 source->AddString("userAgentInfo", GetUserAgent()); 283 source->AddString("userAgentInfo", content::GetUserAgent(GURL()));
284 284
285 CommandLine::StringType command_line = 285 CommandLine::StringType command_line =
286 CommandLine::ForCurrentProcess()->GetCommandLineString(); 286 CommandLine::ForCurrentProcess()->GetCommandLineString();
287 source->AddString("commandLineInfo", command_line); 287 source->AddString("commandLineInfo", command_line);
288 } 288 }
289 289
290 void HelpHandler::RegisterMessages() { 290 void HelpHandler::RegisterMessages() {
291 registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED, 291 registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
292 content::NotificationService::AllSources()); 292 content::NotificationService::AllSources());
293 293
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 web_ui()->CallJavascriptFunction( 546 web_ui()->CallJavascriptFunction(
547 "help.HelpPage.updateCurrentChannel", base::StringValue(channel)); 547 "help.HelpPage.updateCurrentChannel", base::StringValue(channel));
548 } 548 }
549 549
550 void HelpHandler::OnTargetChannel(const std::string& channel) { 550 void HelpHandler::OnTargetChannel(const std::string& channel) {
551 web_ui()->CallJavascriptFunction( 551 web_ui()->CallJavascriptFunction(
552 "help.HelpPage.updateTargetChannel", base::StringValue(channel)); 552 "help.HelpPage.updateTargetChannel", base::StringValue(channel));
553 } 553 }
554 554
555 #endif // defined(OS_CHROMEOS) 555 #endif // defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698