Chromium Code Reviews| 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..92c7dbd4bcaa8faa980d5fcbd099b270e215f8cc 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); |
|
Dan Beam
2013/03/15 15:29:51
^ I guess you guy are already using i18n-keys-with
|
| + 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; |
| + } |
|
Dan Beam
2013/03/15 15:29:51
what's the difference between if () { continue; }
benwells
2013/03/18 05:21:19
I'm not sure there is any difference. TBH I just f
|
| #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_ == chrome::kAppLauncherCategoryTag) |
| + dialog_defaults.SetBoolean("launcherFeedback", true); |
| + |
| // Current url. |
| dialog_defaults.SetString("currentUrl", target_tab_url_); |