| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/session_crashed_bubble_view.h" | 5 #include "chrome/browser/ui/views/session_crashed_bubble_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 link_style); | 275 link_style); |
| 276 views::StyledLabel::RangeStyleInfo uma_style; | 276 views::StyledLabel::RangeStyleInfo uma_style; |
| 277 uma_style.color = kTextColor; | 277 uma_style.color = kTextColor; |
| 278 gfx::Range before_link_range(0, offset); | 278 gfx::Range before_link_range(0, offset); |
| 279 if (!before_link_range.is_empty()) | 279 if (!before_link_range.is_empty()) |
| 280 uma_label->AddStyleRange(before_link_range, uma_style); | 280 uma_label->AddStyleRange(before_link_range, uma_style); |
| 281 gfx::Range after_link_range(offset + link_text.length(), uma_text.length()); | 281 gfx::Range after_link_range(offset + link_text.length(), uma_text.length()); |
| 282 if (!after_link_range.is_empty()) | 282 if (!after_link_range.is_empty()) |
| 283 uma_label->AddStyleRange(after_link_range, uma_style); | 283 uma_label->AddStyleRange(after_link_range, uma_style); |
| 284 // Shift the text down by 1px to align with the checkbox. | 284 // Shift the text down by 1px to align with the checkbox. |
| 285 uma_label->SetBorder(views::Border::CreateEmptyBorder(1, 0, 0, 0)); | 285 uma_label->SetBorder(views::CreateEmptyBorder(1, 0, 0, 0)); |
| 286 | 286 |
| 287 // Create a view to hold the checkbox and the text. | 287 // Create a view to hold the checkbox and the text. |
| 288 views::View* uma_view = new views::View(); | 288 views::View* uma_view = new views::View(); |
| 289 GridLayout* uma_layout = new GridLayout(uma_view); | 289 GridLayout* uma_layout = new GridLayout(uma_view); |
| 290 uma_view->SetLayoutManager(uma_layout); | 290 uma_view->SetLayoutManager(uma_layout); |
| 291 | 291 |
| 292 const int kReportColumnSetId = 0; | 292 const int kReportColumnSetId = 0; |
| 293 views::ColumnSet* cs = uma_layout->AddColumnSet(kReportColumnSetId); | 293 views::ColumnSet* cs = uma_layout->AddColumnSet(kReportColumnSetId); |
| 294 cs->AddColumn(GridLayout::CENTER, GridLayout::LEADING, 0, | 294 cs->AddColumn(GridLayout::CENTER, GridLayout::LEADING, 0, |
| 295 GridLayout::USE_PREF, 0, 0); | 295 GridLayout::USE_PREF, 0, 0); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 if (uma_option_ && uma_option_->checked()) { | 379 if (uma_option_ && uma_option_->checked()) { |
| 380 ChangeMetricsReportingState(true); | 380 ChangeMetricsReportingState(true); |
| 381 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_UMA_OPTIN); | 381 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_UMA_OPTIN); |
| 382 } | 382 } |
| 383 CloseBubble(); | 383 CloseBubble(); |
| 384 } | 384 } |
| 385 | 385 |
| 386 void SessionCrashedBubbleView::CloseBubble() { | 386 void SessionCrashedBubbleView::CloseBubble() { |
| 387 GetWidget()->Close(); | 387 GetWidget()->Close(); |
| 388 } | 388 } |
| OLD | NEW |