| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 layout->AddView(action_button_, 1, 1, views::GridLayout::TRAILING, | 199 layout->AddView(action_button_, 1, 1, views::GridLayout::TRAILING, |
| 200 views::GridLayout::LEADING); | 200 views::GridLayout::LEADING); |
| 201 } | 201 } |
| 202 layout->AddPaddingRow(2, views::kPanelSubVerticalSpacing); | 202 layout->AddPaddingRow(2, views::kPanelSubVerticalSpacing); |
| 203 } | 203 } |
| 204 | 204 |
| 205 SadTabView::~SadTabView() {} | 205 SadTabView::~SadTabView() {} |
| 206 | 206 |
| 207 void SadTabView::LinkClicked(views::Link* source, int event_flags) { | 207 void SadTabView::LinkClicked(views::Link* source, int event_flags) { |
| 208 DCHECK(web_contents_); | 208 DCHECK(web_contents_); |
| 209 OpenURLParams params(GURL(total_crashes_ > kCrashesBeforeFeedbackIsDisplayed ? | 209 OpenURLParams params(GURL(total_crashes_ > kCrashesBeforeFeedbackIsDisplayed |
| 210 chrome::kCrashReasonFeedbackDisplayedURL : | 210 ? chrome::kCrashReasonFeedbackDisplayedURL |
| 211 chrome::kCrashReasonURL), content::Referrer(), | 211 : chrome::kCrashReasonURL), |
| 212 CURRENT_TAB, ui::PAGE_TRANSITION_LINK, false); | 212 content::Referrer(), WindowOpenDisposition::CURRENT_TAB, |
| 213 ui::PAGE_TRANSITION_LINK, false); |
| 213 web_contents_->OpenURL(params); | 214 web_contents_->OpenURL(params); |
| 214 } | 215 } |
| 215 | 216 |
| 216 void SadTabView::ButtonPressed(views::Button* sender, | 217 void SadTabView::ButtonPressed(views::Button* sender, |
| 217 const ui::Event& event) { | 218 const ui::Event& event) { |
| 218 DCHECK(web_contents_); | 219 DCHECK(web_contents_); |
| 219 DCHECK_EQ(action_button_, sender); | 220 DCHECK_EQ(action_button_, sender); |
| 220 | 221 |
| 221 if (action_button_->tag() == SAD_TAB_BUTTON_FEEDBACK) { | 222 if (action_button_->tag() == SAD_TAB_BUTTON_FEEDBACK) { |
| 222 chrome::ShowFeedbackPage( | 223 chrome::ShowFeedbackPage( |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 } | 319 } |
| 319 | 320 |
| 320 namespace chrome { | 321 namespace chrome { |
| 321 | 322 |
| 322 SadTab* SadTab::Create(content::WebContents* web_contents, | 323 SadTab* SadTab::Create(content::WebContents* web_contents, |
| 323 SadTabKind kind) { | 324 SadTabKind kind) { |
| 324 return new SadTabView(web_contents, kind); | 325 return new SadTabView(web_contents, kind); |
| 325 } | 326 } |
| 326 | 327 |
| 327 } // namespace chrome | 328 } // namespace chrome |
| OLD | NEW |