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

Side by Side Diff: ios/showcase/toolbar/sc_toolbar_coordinator.mm

Issue 2936773003: [ios clean] Toolbar accessibility and showcase egtests (Closed)
Patch Set: Rename A11y string 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
« no previous file with comments | « ios/showcase/toolbar/BUILD.gn ('k') | ios/showcase/toolbar/sc_toolbar_egtest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/showcase/toolbar/sc_toolbar_coordinator.h" 5 #import "ios/showcase/toolbar/sc_toolbar_coordinator.h"
6 6
7 #import "ios/clean/chrome/browser/ui/commands/navigation_commands.h" 7 #import "ios/clean/chrome/browser/ui/commands/navigation_commands.h"
8 #import "ios/clean/chrome/browser/ui/commands/tab_grid_commands.h" 8 #import "ios/clean/chrome/browser/ui/commands/tab_grid_commands.h"
9 #import "ios/clean/chrome/browser/ui/commands/tab_strip_commands.h" 9 #import "ios/clean/chrome/browser/ui/commands/tab_strip_commands.h"
10 #import "ios/clean/chrome/browser/ui/commands/tools_menu_commands.h" 10 #import "ios/clean/chrome/browser/ui/commands/tools_menu_commands.h"
(...skipping 26 matching lines...) Expand all
37 37
38 UIViewController* containerViewController = [[UIViewController alloc] init]; 38 UIViewController* containerViewController = [[UIViewController alloc] init];
39 containerViewController.view.backgroundColor = [UIColor whiteColor]; 39 containerViewController.view.backgroundColor = [UIColor whiteColor];
40 containerViewController.title = @"Toolbar"; 40 containerViewController.title = @"Toolbar";
41 41
42 UIView* containerView = [[UIView alloc] init]; 42 UIView* containerView = [[UIView alloc] init];
43 [containerViewController.view addSubview:containerView]; 43 [containerViewController.view addSubview:containerView];
44 containerView.backgroundColor = [UIColor redColor]; 44 containerView.backgroundColor = [UIColor redColor];
45 containerView.translatesAutoresizingMaskIntoConstraints = NO; 45 containerView.translatesAutoresizingMaskIntoConstraints = NO;
46 46
47 ToolbarViewController* toolbarViewController = 47 id dispatcher =
48 [[ToolbarViewController alloc] init];
49 toolbarViewController.dispatcher =
50 static_cast<id<NavigationCommands, TabGridCommands, TabStripCommands, 48 static_cast<id<NavigationCommands, TabGridCommands, TabStripCommands,
51 ToolsMenuCommands>>(self.alerter); 49 ToolsMenuCommands>>(self.alerter);
50 ToolbarViewController* toolbarViewController =
51 [[ToolbarViewController alloc] initWithDispatcher:dispatcher];
52 [containerViewController addChildViewController:toolbarViewController]; 52 [containerViewController addChildViewController:toolbarViewController];
53 toolbarViewController.view.frame = containerView.frame; 53 toolbarViewController.view.frame = containerView.frame;
54 [containerView addSubview:toolbarViewController.view]; 54 [containerView addSubview:toolbarViewController.view];
55 [toolbarViewController didMoveToParentViewController:containerViewController]; 55 [toolbarViewController didMoveToParentViewController:containerViewController];
56 56
57 [NSLayoutConstraint activateConstraints:@[ 57 [NSLayoutConstraint activateConstraints:@[
58 [containerView.heightAnchor constraintEqualToConstant:kToolbarHeight], 58 [containerView.heightAnchor constraintEqualToConstant:kToolbarHeight],
59 [containerView.leadingAnchor 59 [containerView.leadingAnchor
60 constraintEqualToAnchor:containerViewController.view.leadingAnchor], 60 constraintEqualToAnchor:containerViewController.view.leadingAnchor],
61 [containerView.trailingAnchor 61 [containerView.trailingAnchor
62 constraintEqualToAnchor:containerViewController.view.trailingAnchor], 62 constraintEqualToAnchor:containerViewController.view.trailingAnchor],
63 [containerView.centerYAnchor 63 [containerView.centerYAnchor
64 constraintEqualToAnchor:containerViewController.view.centerYAnchor], 64 constraintEqualToAnchor:containerViewController.view.centerYAnchor],
65 ]]; 65 ]];
66 66
67 [self.baseViewController pushViewController:containerViewController 67 [self.baseViewController pushViewController:containerViewController
68 animated:YES]; 68 animated:YES];
69 } 69 }
70 70
71 @end 71 @end
OLDNEW
« no previous file with comments | « ios/showcase/toolbar/BUILD.gn ('k') | ios/showcase/toolbar/sc_toolbar_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698