| OLD | NEW |
| 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.h" | 5 #import "ios/chrome/browser/ui/browser_view_controller.h" |
| 6 | 6 |
| 7 #import <AssetsLibrary/AssetsLibrary.h> | 7 #import <AssetsLibrary/AssetsLibrary.h> |
| 8 #import <MobileCoreServices/MobileCoreServices.h> | 8 #import <MobileCoreServices/MobileCoreServices.h> |
| 9 #import <PassKit/PassKit.h> | 9 #import <PassKit/PassKit.h> |
| 10 #import <Photos/Photos.h> | 10 #import <Photos/Photos.h> |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 #include "ios/chrome/grit/ios_strings.h" | 165 #include "ios/chrome/grit/ios_strings.h" |
| 166 #import "ios/net/request_tracker.h" | 166 #import "ios/net/request_tracker.h" |
| 167 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 167 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
| 168 #include "ios/public/provider/chrome/browser/ui/app_rating_prompt.h" | 168 #include "ios/public/provider/chrome/browser/ui/app_rating_prompt.h" |
| 169 #include "ios/public/provider/chrome/browser/ui/default_ios_web_view_factory.h" | 169 #include "ios/public/provider/chrome/browser/ui/default_ios_web_view_factory.h" |
| 170 #import "ios/public/provider/chrome/browser/voice/voice_search_bar.h" | 170 #import "ios/public/provider/chrome/browser/voice/voice_search_bar.h" |
| 171 #import "ios/public/provider/chrome/browser/voice/voice_search_bar_owner.h" | 171 #import "ios/public/provider/chrome/browser/voice/voice_search_bar_owner.h" |
| 172 #include "ios/public/provider/chrome/browser/voice/voice_search_controller.h" | 172 #include "ios/public/provider/chrome/browser/voice/voice_search_controller.h" |
| 173 #include "ios/public/provider/chrome/browser/voice/voice_search_controller_deleg
ate.h" | 173 #include "ios/public/provider/chrome/browser/voice/voice_search_controller_deleg
ate.h" |
| 174 #include "ios/public/provider/chrome/browser/voice/voice_search_provider.h" | 174 #include "ios/public/provider/chrome/browser/voice/voice_search_provider.h" |
| 175 #import "ios/web/navigation/crw_session_controller.h" | |
| 176 #include "ios/web/navigation/navigation_manager_impl.h" | 175 #include "ios/web/navigation/navigation_manager_impl.h" |
| 177 #include "ios/web/public/active_state_manager.h" | 176 #include "ios/web/public/active_state_manager.h" |
| 178 #include "ios/web/public/navigation_item.h" | 177 #include "ios/web/public/navigation_item.h" |
| 179 #import "ios/web/public/navigation_manager.h" | 178 #import "ios/web/public/navigation_manager.h" |
| 180 #include "ios/web/public/referrer_util.h" | 179 #include "ios/web/public/referrer_util.h" |
| 181 #include "ios/web/public/ssl_status.h" | 180 #include "ios/web/public/ssl_status.h" |
| 182 #include "ios/web/public/url_scheme_util.h" | 181 #include "ios/web/public/url_scheme_util.h" |
| 183 #include "ios/web/public/user_agent.h" | 182 #include "ios/web/public/user_agent.h" |
| 184 #include "ios/web/public/web_client.h" | 183 #include "ios/web/public/web_client.h" |
| 185 #import "ios/web/public/web_state/context_menu_params.h" | 184 #import "ios/web/public/web_state/context_menu_params.h" |
| (...skipping 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2429 openedByDOM:YES | 2428 openedByDOM:YES |
| 2430 atIndex:TabModelConstants::kTabPositionAutomatically | 2429 atIndex:TabModelConstants::kTabPositionAutomatically |
| 2431 inBackground:NO]; | 2430 inBackground:NO]; |
| 2432 return childTab.webState; | 2431 return childTab.webState; |
| 2433 } | 2432 } |
| 2434 | 2433 |
| 2435 - (void)closeWebState:(web::WebState*)webState { | 2434 - (void)closeWebState:(web::WebState*)webState { |
| 2436 // Only allow a web page to close itself if it was opened by DOM, or if there | 2435 // Only allow a web page to close itself if it was opened by DOM, or if there |
| 2437 // are no navigation items. | 2436 // are no navigation items. |
| 2438 Tab* tab = LegacyTabHelper::GetTabForWebState(webState); | 2437 Tab* tab = LegacyTabHelper::GetTabForWebState(webState); |
| 2439 DCHECK([[tab navigationManagerImpl]->GetSessionController() isOpenedByDOM] || | 2438 DCHECK(webState && webState->IsOpenedByDOM() || |
| 2440 ![tab navigationManager]->GetItemCount()); | 2439 ![tab navigationManager]->GetItemCount()); |
| 2441 | 2440 |
| 2442 if (![self tabModel]) | 2441 if (![self tabModel]) |
| 2443 return; | 2442 return; |
| 2444 | 2443 |
| 2445 NSUInteger index = [[self tabModel] indexOfTab:tab]; | 2444 NSUInteger index = [[self tabModel] indexOfTab:tab]; |
| 2446 if (index != NSNotFound) | 2445 if (index != NSNotFound) |
| 2447 [[self tabModel] closeTabAtIndex:index]; | 2446 [[self tabModel] closeTabAtIndex:index]; |
| 2448 } | 2447 } |
| 2449 | 2448 |
| (...skipping 2676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5126 | 5125 |
| 5127 - (UIView*)voiceSearchButton { | 5126 - (UIView*)voiceSearchButton { |
| 5128 return _voiceSearchButton; | 5127 return _voiceSearchButton; |
| 5129 } | 5128 } |
| 5130 | 5129 |
| 5131 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { | 5130 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { |
| 5132 return [self currentLogoAnimationControllerOwner]; | 5131 return [self currentLogoAnimationControllerOwner]; |
| 5133 } | 5132 } |
| 5134 | 5133 |
| 5135 @end | 5134 @end |
| OLD | NEW |