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

Unified Diff: chrome/browser/ui/webui/feedback_ui.cc

Issue 12737006: Allow feedback form to be shown in an App Launcher feedback mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Touch up rebase Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/feedback.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/feedback_ui.cc
diff --git a/chrome/browser/ui/webui/feedback_ui.cc b/chrome/browser/ui/webui/feedback_ui.cc
index 6c74f80ac7d675397aa2dd062b64002268c70804..f79d94fd11aa74a939b8855450561c3eb1707f06 100644
--- a/chrome/browser/ui/webui/feedback_ui.cc
+++ b/chrome/browser/ui/webui/feedback_ui.cc
@@ -203,28 +203,29 @@ void ShowFeedbackPage(Browser* browser,
return;
}
- std::vector<unsigned char>* last_screenshot_png =
- FeedbackUtil::GetScreenshotPng();
- last_screenshot_png->clear();
+ if (category_tag != kAppLauncherCategoryTag) {
+ std::vector<unsigned char>* last_screenshot_png =
+ FeedbackUtil::GetScreenshotPng();
+ last_screenshot_png->clear();
- gfx::NativeWindow native_window;
- gfx::Rect snapshot_bounds;
+ gfx::NativeWindow native_window;
+ gfx::Rect snapshot_bounds;
#if defined(OS_CHROMEOS)
- // For ChromeOS, don't use the browser window but the root window
- // instead to grab the screenshot. We want everything on the screen, not
- // just the current browser.
- native_window = ash::Shell::GetPrimaryRootWindow();
- snapshot_bounds = gfx::Rect(native_window->bounds());
+ // For ChromeOS, don't use the browser window but the root window
+ // instead to grab the screenshot. We want everything on the screen, not
+ // just the current browser.
+ native_window = ash::Shell::GetPrimaryRootWindow();
+ snapshot_bounds = gfx::Rect(native_window->bounds());
#else
- native_window = browser->window()->GetNativeWindow();
- snapshot_bounds = gfx::Rect(browser->window()->GetBounds().size());
+ native_window = browser->window()->GetNativeWindow();
+ snapshot_bounds = gfx::Rect(browser->window()->GetBounds().size());
#endif
- bool success = chrome::GrabWindowSnapshotForUser(native_window,
- last_screenshot_png,
- snapshot_bounds);
- FeedbackUtil::SetScreenshotSize(success ? snapshot_bounds : gfx::Rect());
-
+ bool success = chrome::GrabWindowSnapshotForUser(native_window,
+ last_screenshot_png,
+ snapshot_bounds);
+ FeedbackUtil::SetScreenshotSize(success ? snapshot_bounds : gfx::Rect());
+ }
std::string feedback_url = std::string(chrome::kChromeUIFeedbackURL) + "?" +
kSessionIDParameter + base::IntToString(browser->session_id().id()) +
"&" + kTabIndexParameter +
@@ -282,6 +283,7 @@ class FeedbackHandler : public WebUIMessageHandler,
scoped_refptr<FeedbackData> feedback_data_;
std::string target_tab_url_;
+ std::string category_tag_;
#if defined(OS_CHROMEOS)
// Timestamp of when the feedback request was initiated.
std::string timestamp_;
@@ -337,6 +339,9 @@ content::WebUIDataSource* CreateFeedbackUIHTMLSource(bool successful_init) {
source->AddLocalizedString("no-saved-screenshots",
IDS_FEEDBACK_NO_SAVED_SCREENSHOTS_HELP);
source->AddLocalizedString("privacy-note", IDS_FEEDBACK_PRIVACY_NOTE);
+ source->AddLocalizedString("launcher-title", IDS_FEEDBACK_LAUNCHER_TITLE);
+ source->AddLocalizedString("launcher-description",
+ IDS_FEEDBACK_LAUNCHER_DESCRIPTION_LABEL);
source->SetJsonPath("strings.js");
source->AddResourcePath("feedback.js", IDR_FEEDBACK_JS);
@@ -407,29 +412,28 @@ bool FeedbackHandler::Init() {
&query_str, 0, kSessionIDParameter, "");
if (!base::StringToInt(query_str, &session_id))
return false;
- continue;
- }
- if (StartsWithASCII(*it, std::string(kTabIndexParameter), true)) {
+ } else if (StartsWithASCII(*it, std::string(kTabIndexParameter), true)) {
ReplaceFirstSubstringAfterOffset(
&query_str, 0, kTabIndexParameter, "");
if (!base::StringToInt(query_str, &index))
return false;
- continue;
- }
- if (StartsWithASCII(*it, std::string(kCustomPageUrlParameter), true)) {
+ } else if (StartsWithASCII(*it, std::string(kCustomPageUrlParameter),
+ true)) {
ReplaceFirstSubstringAfterOffset(
&query_str, 0, kCustomPageUrlParameter, "");
custom_page_url = query_str;
- continue;
- }
+ } else if (StartsWithASCII(*it, std::string(kCategoryTagParameter),
+ true)) {
+ ReplaceFirstSubstringAfterOffset(
+ &query_str, 0, kCategoryTagParameter, "");
+ category_tag_ = query_str;
#if defined(OS_CHROMEOS)
- if (StartsWithASCII(*it, std::string(kTimestampParameter), true)) {
+ } else if (StartsWithASCII(*it, std::string(kTimestampParameter), true)) {
ReplaceFirstSubstringAfterOffset(
&query_str, 0, kTimestampParameter, "");
timestamp_ = query_str;
- continue;
- }
#endif
+ }
}
}
@@ -490,6 +494,9 @@ void FeedbackHandler::HandleGetDialogDefaults(const ListValue*) {
// Send back values which the dialog js needs initially.
DictionaryValue dialog_defaults;
+ if (category_tag_ == chrome::kAppLauncherCategoryTag)
+ dialog_defaults.SetBoolean("launcherFeedback", true);
+
// Current url.
dialog_defaults.SetString("currentUrl", target_tab_url_);
« no previous file with comments | « chrome/browser/resources/feedback.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698