| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/sad_tab_view.h" | 5 #include "chrome/browser/ui/views/sad_tab_view.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/google/google_util.h" | 9 #include "chrome/browser/google/google_util.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } | 56 } |
| 57 | 57 |
| 58 SadTabView::~SadTabView() {} | 58 SadTabView::~SadTabView() {} |
| 59 | 59 |
| 60 void SadTabView::LinkClicked(views::Link* source, int event_flags) { | 60 void SadTabView::LinkClicked(views::Link* source, int event_flags) { |
| 61 if (tab_contents_ != NULL && source == help_link_) { | 61 if (tab_contents_ != NULL && source == help_link_) { |
| 62 GURL help_url = | 62 GURL help_url = |
| 63 google_util::AppendGoogleLocaleParam(GURL(kind_ == CRASHED ? | 63 google_util::AppendGoogleLocaleParam(GURL(kind_ == CRASHED ? |
| 64 chrome::kCrashReasonURL : | 64 chrome::kCrashReasonURL : |
| 65 chrome::kKillReasonURL)); | 65 chrome::kKillReasonURL)); |
| 66 tab_contents_->OpenURL(help_url, GURL(), CURRENT_TAB, PageTransition::LINK); | 66 tab_contents_->OpenURL( |
| 67 help_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_LINK); |
| 67 } else if (tab_contents_ != NULL && source == feedback_link_) { | 68 } else if (tab_contents_ != NULL && source == feedback_link_) { |
| 68 browser::ShowHtmlBugReportView( | 69 browser::ShowHtmlBugReportView( |
| 69 Browser::GetBrowserForController(&tab_contents_->controller(), NULL), | 70 Browser::GetBrowserForController(&tab_contents_->controller(), NULL), |
| 70 l10n_util::GetStringUTF8(IDS_KILLED_TAB_FEEDBACK_MESSAGE), | 71 l10n_util::GetStringUTF8(IDS_KILLED_TAB_FEEDBACK_MESSAGE), |
| 71 userfeedback::ChromeOsData_ChromeOsCategory_CRASH); | 72 userfeedback::ChromeOsData_ChromeOsCategory_CRASH); |
| 72 } | 73 } |
| 73 } | 74 } |
| 74 | 75 |
| 75 void SadTabView::Layout() { | 76 void SadTabView::Layout() { |
| 76 // Specify the maximum message width explicitly. | 77 // Specify the maximum message width explicitly. |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 168 } |
| 168 | 169 |
| 169 void SadTabView::OnPaint(gfx::Canvas* canvas) { | 170 void SadTabView::OnPaint(gfx::Canvas* canvas) { |
| 170 if (!painted_) { | 171 if (!painted_) { |
| 171 // User actually saw the error, keep track for user experience stats. | 172 // User actually saw the error, keep track for user experience stats. |
| 172 UMA_HISTOGRAM_COUNTS("SadTab.Displayed", kind_); | 173 UMA_HISTOGRAM_COUNTS("SadTab.Displayed", kind_); |
| 173 painted_ = true; | 174 painted_ = true; |
| 174 } | 175 } |
| 175 View::OnPaint(canvas); | 176 View::OnPaint(canvas); |
| 176 } | 177 } |
| OLD | NEW |