| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #import "ios/chrome/browser/ui/sad_tab/sad_tab_view.h" | 5 #import "ios/chrome/browser/ui/sad_tab/sad_tab_view.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" |
| 7 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 8 #include "components/grit/components_scaled_resources.h" | 9 #include "components/grit/components_scaled_resources.h" |
| 9 #include "components/strings/grit/components_strings.h" | 10 #include "components/strings/grit/components_strings.h" |
| 11 #include "components/ui_metrics/sadtab_metrics_types.h" |
| 10 #include "ios/chrome/browser/chrome_url_constants.h" | 12 #include "ios/chrome/browser/chrome_url_constants.h" |
| 11 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" | 13 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" |
| 12 #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" | 14 #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" |
| 13 #import "ios/chrome/browser/ui/commands/ios_command_ids.h" | 15 #import "ios/chrome/browser/ui/commands/ios_command_ids.h" |
| 14 #import "ios/chrome/browser/ui/commands/open_url_command.h" | 16 #import "ios/chrome/browser/ui/commands/open_url_command.h" |
| 15 #include "ios/chrome/browser/ui/rtl_geometry.h" | 17 #include "ios/chrome/browser/ui/rtl_geometry.h" |
| 16 #import "ios/chrome/browser/ui/uikit_ui_util.h" | 18 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
| 17 #import "ios/chrome/browser/ui/url_loader.h" | 19 #import "ios/chrome/browser/ui/url_loader.h" |
| 18 #import "ios/chrome/browser/ui/util/label_link_controller.h" | 20 #import "ios/chrome/browser/ui/util/label_link_controller.h" |
| 19 #import "ios/third_party/material_components_ios/src/components/Buttons/src/Mate
rialButtons.h" | 21 #import "ios/third_party/material_components_ios/src/components/Buttons/src/Mate
rialButtons.h" |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 self.containerView.frame = AlignRectOriginAndSizeToPixels( | 551 self.containerView.frame = AlignRectOriginAndSizeToPixels( |
| 550 CGRectMake(containerOriginX, containerOriginY, containerSize.width, | 552 CGRectMake(containerOriginX, containerOriginY, containerSize.width, |
| 551 containerSize.height)); | 553 containerSize.height)); |
| 552 } | 554 } |
| 553 | 555 |
| 554 #pragma mark Util | 556 #pragma mark Util |
| 555 | 557 |
| 556 - (void)handleActionButtonTapped:(id)sender { | 558 - (void)handleActionButtonTapped:(id)sender { |
| 557 switch (self.mode) { | 559 switch (self.mode) { |
| 558 case SadTabViewMode::RELOAD: | 560 case SadTabViewMode::RELOAD: |
| 561 UMA_HISTOGRAM_ENUMERATION(ui_metrics::kSadTabReloadHistogramKey, |
| 562 ui_metrics::SadTabEvent::BUTTON_CLICKED, |
| 563 ui_metrics::SadTabEvent::MAX_SAD_TAB_EVENT); |
| 559 self.navigationManager->Reload(web::ReloadType::NORMAL, true); | 564 self.navigationManager->Reload(web::ReloadType::NORMAL, true); |
| 560 break; | 565 break; |
| 561 case SadTabViewMode::FEEDBACK: { | 566 case SadTabViewMode::FEEDBACK: { |
| 567 UMA_HISTOGRAM_ENUMERATION(ui_metrics::kSadTabFeedbackHistogramKey, |
| 568 ui_metrics::SadTabEvent::BUTTON_CLICKED, |
| 569 ui_metrics::SadTabEvent::MAX_SAD_TAB_EVENT); |
| 562 GenericChromeCommand* command = | 570 GenericChromeCommand* command = |
| 563 [[GenericChromeCommand alloc] initWithTag:IDC_REPORT_AN_ISSUE]; | 571 [[GenericChromeCommand alloc] initWithTag:IDC_REPORT_AN_ISSUE]; |
| 564 [self chromeExecuteCommand:command]; | 572 [self chromeExecuteCommand:command]; |
| 565 break; | 573 break; |
| 566 } | 574 } |
| 567 }; | 575 }; |
| 568 } | 576 } |
| 569 | 577 |
| 570 + (UIColor*)sadTabBackgroundColor { | 578 + (UIColor*)sadTabBackgroundColor { |
| 571 return [UIColor colorWithWhite:kBackgroundColorBrightness alpha:1.0]; | 579 return [UIColor colorWithWhite:kBackgroundColorBrightness alpha:1.0]; |
| 572 } | 580 } |
| 573 | 581 |
| 574 @end | 582 @end |
| OLD | NEW |