| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/md_feedback/md_feedback_ui.h" | 5 #include "chrome/browser/ui/webui/md_feedback/md_feedback_ui.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/common/url_constants.h" | 8 #include "chrome/common/url_constants.h" |
| 9 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
| 10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 namespace { | 73 namespace { |
| 74 | 74 |
| 75 content::WebUIDataSource* CreateMdFeedbackUIHTMLSource(Profile* profile) { | 75 content::WebUIDataSource* CreateMdFeedbackUIHTMLSource(Profile* profile) { |
| 76 content::WebUIDataSource* html_source = | 76 content::WebUIDataSource* html_source = |
| 77 content::WebUIDataSource::Create(chrome::kChromeUIFeedbackHost); | 77 content::WebUIDataSource::Create(chrome::kChromeUIFeedbackHost); |
| 78 | 78 |
| 79 // General strings. | 79 // General strings. |
| 80 html_source->AddLocalizedString("headingText", | 80 html_source->AddLocalizedString("headingText", |
| 81 IDS_MD_FEEDBACK_HEADING); | 81 IDS_MD_FEEDBACK_HEADING); |
| 82 #if defined(GOOGLE_CHROME_BUILD) |
| 83 html_source->AddLocalizedString("privacyNote", |
| 84 IDS_MD_FEEDBACK_PRIVACY_NOTE); |
| 85 #endif |
| 82 | 86 |
| 83 // Input labels. | 87 // Input labels. |
| 84 html_source->AddLocalizedString("emailLabel", | 88 html_source->AddLocalizedString("emailLabel", |
| 85 IDS_MD_FEEDBACK_USER_EMAIL_LABEL); | 89 IDS_MD_FEEDBACK_USER_EMAIL_LABEL); |
| 86 html_source->AddLocalizedString("openEndedLabel", | 90 html_source->AddLocalizedString("openEndedLabel", |
| 87 IDS_MD_FEEDBACK_OPEN_ENDED_LABEL); | 91 IDS_MD_FEEDBACK_OPEN_ENDED_LABEL); |
| 88 html_source->AddLocalizedString("urlLabel", | 92 html_source->AddLocalizedString("urlLabel", |
| 89 IDS_MD_FEEDBACK_URL_LABEL); | 93 IDS_MD_FEEDBACK_URL_LABEL); |
| 90 | 94 |
| 91 // Buttons. | 95 // Buttons. |
| 92 html_source->AddLocalizedString("cancelButton", | 96 html_source->AddLocalizedString("cancelButton", |
| 93 IDS_MD_FEEDBACK_CANCEL_BUTTON); | 97 IDS_MD_FEEDBACK_CANCEL_BUTTON); |
| 94 html_source->AddLocalizedString("sendReportButton", | 98 html_source->AddLocalizedString("sendReportButton", |
| 95 IDS_MD_FEEDBACK_SEND_REPORT_BUTTON); | 99 IDS_MD_FEEDBACK_SEND_REPORT_BUTTON); |
| 96 | 100 |
| 101 // Checkbox labels. |
| 102 html_source->AddLocalizedString("includeScreenshotLabel", |
| 103 IDS_MD_FEEDBACK_SCREENSHOT_LABEL); |
| 104 html_source->AddLocalizedString("sendSystemInfoLabel", |
| 105 IDS_MD_FEEDBACK_SEND_SYSTEM_INFO_LABEL); |
| 106 |
| 97 // Polymer resources. | 107 // Polymer resources. |
| 98 html_source->AddResourcePath("feedback_container.html", | 108 html_source->AddResourcePath("feedback_container.html", |
| 99 IDR_MD_FEEDBACK_FEEDBACK_CONTAINER_HTML); | 109 IDR_MD_FEEDBACK_FEEDBACK_CONTAINER_HTML); |
| 100 html_source->AddResourcePath("feedback_container.js", | 110 html_source->AddResourcePath("feedback_container.js", |
| 101 IDR_MD_FEEDBACK_FEEDBACK_CONTAINER_JS); | 111 IDR_MD_FEEDBACK_FEEDBACK_CONTAINER_JS); |
| 102 | 112 |
| 103 html_source->SetJsonPath("strings.js"); | 113 html_source->SetJsonPath("strings.js"); |
| 104 html_source->SetDefaultResource(IDR_MD_FEEDBACK_FEEDBACK_HTML); | 114 html_source->SetDefaultResource(IDR_MD_FEEDBACK_FEEDBACK_HTML); |
| 105 return html_source; | 115 return html_source; |
| 106 } | 116 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 120 | 130 |
| 121 void ShowFeedbackWebDialog( | 131 void ShowFeedbackWebDialog( |
| 122 content::BrowserContext* browser_context) { | 132 content::BrowserContext* browser_context) { |
| 123 // TODO(apacible): Platform dependent implementations. | 133 // TODO(apacible): Platform dependent implementations. |
| 124 #if !defined(OS_MACOSX) | 134 #if !defined(OS_MACOSX) |
| 125 // TODO(apacible): If a feedback dialog is already open, bring that dialog | 135 // TODO(apacible): If a feedback dialog is already open, bring that dialog |
| 126 // to the front rather than creating a new dialog. | 136 // to the front rather than creating a new dialog. |
| 127 chrome::ShowWebDialog(NULL, browser_context, new MdFeedbackDialogDelegate()); | 137 chrome::ShowWebDialog(NULL, browser_context, new MdFeedbackDialogDelegate()); |
| 128 #endif // !OS_MACOSX | 138 #endif // !OS_MACOSX |
| 129 } | 139 } |
| OLD | NEW |