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

Unified Diff: chrome/browser/dom_ui/bug_report_ui.cc

Issue 3155038: Change the path used to refer to tabs to a reference. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/bug_report_ui.cc
diff --git a/chrome/browser/dom_ui/bug_report_ui.cc b/chrome/browser/dom_ui/bug_report_ui.cc
index 09ac979467786f2690e392137cd5d85cf1d5a6ad..a2b184fe1ed225d5987f991c76783995c9cac626 100644
--- a/chrome/browser/dom_ui/bug_report_ui.cc
+++ b/chrome/browser/dom_ui/bug_report_ui.cc
@@ -165,7 +165,7 @@ void RefreshLastScreenshot(views::Window* parent) {
// Global "display this dialog" function declared in browser_dialogs.h.
void ShowHtmlBugReportView(views::Window* parent, Browser* browser) {
std::string bug_report_url = std::string(chrome::kChromeUIBugReportURL) +
- base::IntToString(browser->selected_index());
+ "#" + base::IntToString(browser->selected_index());
RefreshLastScreenshot(parent);
browser->ShowSingletonTab(GURL(bug_report_url));
@@ -424,10 +424,11 @@ base::StringPiece BugReportHandler::Init() {
}
std::string params = page_url.substr(strlen(chrome::kChromeUIBugReportURL));
+ // Erase the # - the first character.
+ params.erase(params.begin(),params.begin() + 1);
int index = 0;
if (!base::StringToInt(params, &index)) {
- ClobberScreenshotsSource();
return base::StringPiece(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_BUGREPORT_HTML_INVALID));
@@ -435,7 +436,6 @@ base::StringPiece BugReportHandler::Init() {
// Sanity checks.
if (((index == 0) && (params != "0")) || (index >= browser_->tab_count())) {
- ClobberScreenshotsSource();
return base::StringPiece(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_BUGREPORT_HTML_INVALID));
@@ -446,6 +446,9 @@ base::StringPiece BugReportHandler::Init() {
else
LOG(FATAL) << "Failed to get last active browser.";
+ // Setup the screenshot source after we've verified input is legit.
+ SetupScreenshotsSource();
+
return base::StringPiece(
ResourceBundle::GetSharedInstance().GetRawDataResource(
#if defined(OS_CHROMEOS)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698