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

Side by Side Diff: ios/chrome/browser/ui/omnibox/page_info_view_controller.mm

Issue 2912863005: Use MDCTypography instead of MDFRobotoFontLoader directly. (Closed)
Patch Set: Tentative fix for ManualTextFramerTest Created 3 years, 6 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 unified diff | Download patch
OLDNEW
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 #import "ios/chrome/browser/ui/omnibox/page_info_view_controller.h" 5 #import "ios/chrome/browser/ui/omnibox/page_info_view_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #import "base/mac/foundation_util.h" 10 #import "base/mac/foundation_util.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
13 #include "base/strings/sys_string_conversions.h" 13 #include "base/strings/sys_string_conversions.h"
14 #include "base/threading/thread_task_runner_handle.h" 14 #include "base/threading/thread_task_runner_handle.h"
15 #include "components/strings/grit/components_strings.h" 15 #include "components/strings/grit/components_strings.h"
16 #import "ios/chrome/browser/ui/animation_util.h" 16 #import "ios/chrome/browser/ui/animation_util.h"
17 #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" 17 #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h"
18 #include "ios/chrome/browser/ui/commands/ios_command_ids.h" 18 #include "ios/chrome/browser/ui/commands/ios_command_ids.h"
19 #import "ios/chrome/browser/ui/fancy_ui/bidi_container_view.h" 19 #import "ios/chrome/browser/ui/fancy_ui/bidi_container_view.h"
20 #include "ios/chrome/browser/ui/omnibox/page_info_model.h" 20 #include "ios/chrome/browser/ui/omnibox/page_info_model.h"
21 #import "ios/chrome/browser/ui/popup_menu/popup_menu_view.h" 21 #import "ios/chrome/browser/ui/popup_menu/popup_menu_view.h"
22 #include "ios/chrome/browser/ui/rtl_geometry.h" 22 #include "ios/chrome/browser/ui/rtl_geometry.h"
23 #include "ios/chrome/browser/ui/ui_util.h" 23 #include "ios/chrome/browser/ui/ui_util.h"
24 #import "ios/chrome/browser/ui/uikit_ui_util.h" 24 #import "ios/chrome/browser/ui/uikit_ui_util.h"
25 #import "ios/chrome/common/material_timing.h" 25 #import "ios/chrome/common/material_timing.h"
26 #include "ios/chrome/grit/ios_strings.h" 26 #include "ios/chrome/grit/ios_strings.h"
27 #import "ios/third_party/material_components_ios/src/components/Typography/src/M aterialTypography.h" 27 #import "ios/third_party/material_components_ios/src/components/Typography/src/M aterialTypography.h"
28 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF ontLoader.h"
29 #include "ui/base/l10n/l10n_util.h" 28 #include "ui/base/l10n/l10n_util.h"
30 #include "ui/base/l10n/l10n_util_mac.h" 29 #include "ui/base/l10n/l10n_util_mac.h"
31 #import "ui/gfx/ios/NSString+CrStringDrawing.h" 30 #import "ui/gfx/ios/NSString+CrStringDrawing.h"
32 #import "ui/gfx/ios/uikit_util.h" 31 #import "ui/gfx/ios/uikit_util.h"
33 32
34 #if !defined(__has_feature) || !__has_feature(objc_arc) 33 #if !defined(__has_feature) || !__has_feature(objc_arc)
35 #error "This file requires ARC support." 34 #error "This file requires ARC support."
36 #endif 35 #endif
37 36
38 using ios::material::TimingFunction; 37 using ios::material::TimingFunction;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 73
75 inline UIColor* PageInfoTextColor() { 74 inline UIColor* PageInfoTextColor() {
76 return [UIColor colorWithWhite:kPageInfoTextGreyComponent alpha:1]; 75 return [UIColor colorWithWhite:kPageInfoTextGreyComponent alpha:1];
77 } 76 }
78 77
79 inline UIColor* PageInfoHelpButtonColor() { 78 inline UIColor* PageInfoHelpButtonColor() {
80 return UIColorFromRGB(kPageInfoHelpButtonRGB); 79 return UIColorFromRGB(kPageInfoHelpButtonRGB);
81 } 80 }
82 81
83 inline UIFont* PageInfoHeadlineFont() { 82 inline UIFont* PageInfoHeadlineFont() {
84 return [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:16]; 83 return [[MDCTypography fontLoader] mediumFontOfSize:16];
85 } 84 }
86 85
87 inline CATransform3D PageInfoAnimationScale() { 86 inline CATransform3D PageInfoAnimationScale() {
88 return CATransform3DMakeScale(0.03, 0.03, 1); 87 return CATransform3DMakeScale(0.03, 0.03, 1);
89 } 88 }
90 89
91 // Offset to make sure image aligns with the header line. 90 // Offset to make sure image aligns with the header line.
92 inline CGFloat PageInfoImageVerticalOffset() { 91 inline CGFloat PageInfoImageVerticalOffset() {
93 return ui::AlignValueToUpperPixel((kHeadlineHeight - kImageSize) / 2.0); 92 return ui::AlignValueToUpperPixel((kHeadlineHeight - kImageSize) / 2.0);
94 } 93 }
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 [opacityAnimation setFromValue:@1]; 641 [opacityAnimation setFromValue:@1];
643 [opacityAnimation setToValue:@0]; 642 [opacityAnimation setToValue:@0];
644 [[containerView_ layer] addAnimation:opacityAnimation forKey:@"animateOut"]; 643 [[containerView_ layer] addAnimation:opacityAnimation forKey:@"animateOut"];
645 644
646 [popupContainer_ setAlpha:0]; 645 [popupContainer_ setAlpha:0];
647 [containerView_ setAlpha:0]; 646 [containerView_ setAlpha:0];
648 [CATransaction commit]; 647 [CATransaction commit];
649 } 648 }
650 649
651 @end 650 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698