| 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 1198342a4fee7d6c970168bcd96ef8b58849fa6d..cd1ba07514e91df7c8560576a49f4b50a5294b13 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,
|
|
|
| FeedbackData* feedback_data_;
|
| std::string target_tab_url_;
|
| + std::string category_tag_;
|
| #if defined(OS_CHROMEOS)
|
| // Variables to track SyslogsProvider::RequestSyslogs.
|
| CancelableTaskTracker::TaskId syslogs_task_id_;
|
| @@ -341,6 +343,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);
|
| @@ -434,6 +439,12 @@ bool FeedbackHandler::Init() {
|
| custom_page_url = query_str;
|
| continue;
|
| }
|
| + if (StartsWithASCII(*it, std::string(kCategoryTagParameter), true)) {
|
| + ReplaceFirstSubstringAfterOffset(
|
| + &query_str, 0, kCategoryTagParameter, "");
|
| + category_tag_ = query_str;
|
| + continue;
|
| + }
|
| #if defined(OS_CHROMEOS)
|
| if (StartsWithASCII(*it, std::string(kTimestampParameter), true)) {
|
| ReplaceFirstSubstringAfterOffset(
|
| @@ -503,6 +514,9 @@ void FeedbackHandler::HandleGetDialogDefaults(const ListValue*) {
|
| // Send back values which the dialog js needs initially.
|
| DictionaryValue dialog_defaults;
|
|
|
| + if (category_tag_ == kAppLauncherCategoryTag)
|
| + dialog_defaults.SetBoolean("launcherFeedback", true);
|
| +
|
| // Current url.
|
| dialog_defaults.SetString("currentUrl", target_tab_url_);
|
|
|
|
|