| 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/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/string16.h" | 13 #include "base/string16.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/google/google_util.h" | 17 #include "chrome/browser/google/google_util.h" |
| 18 #include "chrome/browser/policy/browser_policy_connector.h" | 18 #include "chrome/browser/policy/browser_policy_connector.h" |
| 19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/browser/ui/browser_list.h" | 20 #include "chrome/browser/ui/browser_finder.h" |
| 21 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
| 22 #include "chrome/common/chrome_version_info.h" | 22 #include "chrome/common/chrome_version_info.h" |
| 23 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
| 24 #include "content/public/browser/notification_service.h" | 24 #include "content/public/browser/notification_service.h" |
| 25 #include "content/public/browser/web_ui.h" | 25 #include "content/public/browser/web_ui.h" |
| 26 #include "content/public/common/content_client.h" | 26 #include "content/public/common/content_client.h" |
| 27 #include "grit/chromium_strings.h" | 27 #include "grit/chromium_strings.h" |
| 28 #include "grit/generated_resources.h" | 28 #include "grit/generated_resources.h" |
| 29 #include "grit/google_chrome_strings.h" | 29 #include "grit/google_chrome_strings.h" |
| 30 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 288 } |
| 289 #endif | 289 #endif |
| 290 | 290 |
| 291 void HelpHandler::RelaunchNow(const ListValue* args) { | 291 void HelpHandler::RelaunchNow(const ListValue* args) { |
| 292 DCHECK(args->empty()); | 292 DCHECK(args->empty()); |
| 293 version_updater_->RelaunchBrowser(); | 293 version_updater_->RelaunchBrowser(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void HelpHandler::OpenFeedbackDialog(const ListValue* args) { | 296 void HelpHandler::OpenFeedbackDialog(const ListValue* args) { |
| 297 DCHECK(args->empty()); | 297 DCHECK(args->empty()); |
| 298 Browser* browser = BrowserList::FindBrowserWithWebContents( | 298 Browser* browser = browser::FindBrowserWithWebContents( |
| 299 web_ui()->GetWebContents()); | 299 web_ui()->GetWebContents()); |
| 300 browser->OpenFeedbackDialog(); | 300 browser->OpenFeedbackDialog(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void HelpHandler::OpenHelpPage(const base::ListValue* args) { | 303 void HelpHandler::OpenHelpPage(const base::ListValue* args) { |
| 304 DCHECK(args->empty()); | 304 DCHECK(args->empty()); |
| 305 Browser* browser = BrowserList::FindBrowserWithWebContents( | 305 Browser* browser = browser::FindBrowserWithWebContents( |
| 306 web_ui()->GetWebContents()); | 306 web_ui()->GetWebContents()); |
| 307 browser->ShowHelpTab(); | 307 browser->ShowHelpTab(); |
| 308 } | 308 } |
| 309 | 309 |
| 310 #if defined(OS_CHROMEOS) | 310 #if defined(OS_CHROMEOS) |
| 311 | 311 |
| 312 void HelpHandler::SetReleaseTrack(const ListValue* args) { | 312 void HelpHandler::SetReleaseTrack(const ListValue* args) { |
| 313 if (!CanChangeReleaseChannel()) { | 313 if (!CanChangeReleaseChannel()) { |
| 314 LOG(WARNING) << "Non-owner tried to change release track."; | 314 LOG(WARNING) << "Non-owner tried to change release track."; |
| 315 return; | 315 return; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 | 431 |
| 432 // Note that this string will be internationalized. | 432 // Note that this string will be internationalized. |
| 433 string16 last_updated = base::TimeFormatFriendlyDate(time); | 433 string16 last_updated = base::TimeFormatFriendlyDate(time); |
| 434 g_last_updated_string = Value::CreateStringValue(last_updated); | 434 g_last_updated_string = Value::CreateStringValue(last_updated); |
| 435 } | 435 } |
| 436 | 436 |
| 437 web_ui()->CallJavascriptFunction("help.HelpPage.setLastUpdated", | 437 web_ui()->CallJavascriptFunction("help.HelpPage.setLastUpdated", |
| 438 *g_last_updated_string); | 438 *g_last_updated_string); |
| 439 } | 439 } |
| 440 #endif // defined(OS_CHROMEOS) | 440 #endif // defined(OS_CHROMEOS) |
| OLD | NEW |