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

Side by Side Diff: ios/chrome/browser/ui/browser_view_controller_dependency_factory.mm

Issue 2798903003: [ObjC ARC] Converts ios/chrome/browser/ui:ui_internal to ARC. (Closed)
Patch Set: missing weaks from another patch Created 3 years, 8 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/chrome/browser/ui/browser_view_controller_dependency_factory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/browser_view_controller_dependency_factory.h" 5 #import "ios/chrome/browser/ui/browser_view_controller_dependency_factory.h"
6 6
7 #import <PassKit/PassKit.h> 7 #import <PassKit/PassKit.h>
8 8
9 #include "base/ios/ios_util.h" 9 #include "base/ios/ios_util.h"
10 #include "components/infobars/core/infobar_manager.h" 10 #include "components/infobars/core/infobar_manager.h"
11 #include "components/infobars/core/simple_alert_infobar_delegate.h" 11 #include "components/infobars/core/simple_alert_infobar_delegate.h"
12 #include "components/strings/grit/components_strings.h" 12 #include "components/strings/grit/components_strings.h"
13 #include "components/toolbar/toolbar_model_impl.h" 13 #include "components/toolbar/toolbar_model_impl.h"
14 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 14 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
15 #import "ios/chrome/browser/tabs/tab_model.h" 15 #import "ios/chrome/browser/tabs/tab_model.h"
16 #import "ios/chrome/browser/ui/activity_services/activity_service_controller.h" 16 #import "ios/chrome/browser/ui/activity_services/activity_service_controller.h"
17 #import "ios/chrome/browser/ui/activity_services/share_protocol.h" 17 #import "ios/chrome/browser/ui/activity_services/share_protocol.h"
18 #import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h" 18 #import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h"
19 #import "ios/chrome/browser/ui/key_commands_provider.h" 19 #import "ios/chrome/browser/ui/key_commands_provider.h"
20 #import "ios/chrome/browser/ui/preload_controller.h" 20 #import "ios/chrome/browser/ui/preload_controller.h"
21 #include "ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h" 21 #include "ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h"
22 #include "ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios.h" 22 #include "ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios.h"
23 #import "ios/chrome/browser/ui/toolbar/web_toolbar_controller.h" 23 #import "ios/chrome/browser/ui/toolbar/web_toolbar_controller.h"
24 #include "ios/chrome/grit/ios_strings.h" 24 #include "ios/chrome/grit/ios_strings.h"
25 #import "ios/third_party/material_components_ios/src/components/Snackbar/src/Mat erialSnackbar.h" 25 #import "ios/third_party/material_components_ios/src/components/Snackbar/src/Mat erialSnackbar.h"
26 #include "ui/base/l10n/l10n_util.h" 26 #include "ui/base/l10n/l10n_util.h"
27 #include "ui/base/l10n/l10n_util_mac.h" 27 #include "ui/base/l10n/l10n_util_mac.h"
28 28
29 #if !defined(__has_feature) || !__has_feature(objc_arc)
30 #error "This file requires ARC support."
31 #endif
32
29 NSString* const kBrowserViewControllerSnackbarCategory = 33 NSString* const kBrowserViewControllerSnackbarCategory =
30 @"BrowserViewControllerSnackbarCategory"; 34 @"BrowserViewControllerSnackbarCategory";
31 35
32 @implementation BrowserViewControllerDependencyFactory 36 @implementation BrowserViewControllerDependencyFactory {
37 ios::ChromeBrowserState* browserState_;
38 }
33 39
34 - (id)initWithBrowserState:(ios::ChromeBrowserState*)browserState { 40 - (id)initWithBrowserState:(ios::ChromeBrowserState*)browserState {
35 self = [super init]; 41 self = [super init];
36 if (self) { 42 if (self) {
37 browserState_ = browserState; 43 browserState_ = browserState;
38 } 44 }
39 return self; 45 return self;
40 } 46 }
41 47
42 - (id<ShareProtocol>)shareControllerInstance { 48 - (id<ShareProtocol>)shareControllerInstance {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 message.accessibilityLabel = text; 97 message.accessibilityLabel = text;
92 message.duration = 2.0; 98 message.duration = 2.0;
93 message.category = kBrowserViewControllerSnackbarCategory; 99 message.category = kBrowserViewControllerSnackbarCategory;
94 [MDCSnackbarManager showMessage:message]; 100 [MDCSnackbarManager showMessage:message];
95 } 101 }
96 102
97 - (AlertCoordinator*)alertCoordinatorWithTitle:(NSString*)title 103 - (AlertCoordinator*)alertCoordinatorWithTitle:(NSString*)title
98 message:(NSString*)message 104 message:(NSString*)message
99 viewController: 105 viewController:
100 (UIViewController*)viewController { 106 (UIViewController*)viewController {
101 AlertCoordinator* alertCoordinator = [[[AlertCoordinator alloc] 107 AlertCoordinator* alertCoordinator =
102 initWithBaseViewController:viewController 108 [[AlertCoordinator alloc] initWithBaseViewController:viewController
103 title:title 109 title:title
104 message:message] autorelease]; 110 message:message];
105 [alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_OK) 111 [alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_OK)
106 action:nil 112 action:nil
107 style:UIAlertActionStyleDefault]; 113 style:UIAlertActionStyleDefault];
108 return alertCoordinator; 114 return alertCoordinator;
109 } 115 }
110 116
111 @end 117 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/browser_view_controller_dependency_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698