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

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

Issue 2755823002: Moved |openedByDOM| to WebState's CreateParams and public interface. (Closed)
Patch Set: . Created 3 years, 9 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 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
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 2225 matching lines...) Expand 10 before | Expand all | Expand 10 after
2411 openedByDOM:YES 2410 openedByDOM:YES
2412 atIndex:TabModelConstants::kTabPositionAutomatically 2411 atIndex:TabModelConstants::kTabPositionAutomatically
2413 inBackground:NO]; 2412 inBackground:NO];
2414 return childTab.webState; 2413 return childTab.webState;
2415 } 2414 }
2416 2415
2417 - (void)closeWebState:(web::WebState*)webState { 2416 - (void)closeWebState:(web::WebState*)webState {
2418 // Only allow a web page to close itself if it was opened by DOM, or if there 2417 // Only allow a web page to close itself if it was opened by DOM, or if there
2419 // are no navigation items. 2418 // are no navigation items.
2420 Tab* tab = LegacyTabHelper::GetTabForWebState(webState); 2419 Tab* tab = LegacyTabHelper::GetTabForWebState(webState);
2421 DCHECK([[tab navigationManagerImpl]->GetSessionController() isOpenedByDOM] || 2420 DCHECK(webState->HasOpener() || ![tab navigationManager]->GetItemCount());
2422 ![tab navigationManager]->GetItemCount());
2423 2421
2424 if (![self tabModel]) 2422 if (![self tabModel])
2425 return; 2423 return;
2426 2424
2427 NSUInteger index = [[self tabModel] indexOfTab:tab]; 2425 NSUInteger index = [[self tabModel] indexOfTab:tab];
2428 if (index != NSNotFound) 2426 if (index != NSNotFound)
2429 [[self tabModel] closeTabAtIndex:index]; 2427 [[self tabModel] closeTabAtIndex:index];
2430 } 2428 }
2431 2429
2432 - (web::WebState*)webState:(web::WebState*)webState 2430 - (web::WebState*)webState:(web::WebState*)webState
(...skipping 2696 matching lines...) Expand 10 before | Expand all | Expand 10 after
5129 5127
5130 - (UIView*)voiceSearchButton { 5128 - (UIView*)voiceSearchButton {
5131 return _voiceSearchButton; 5129 return _voiceSearchButton;
5132 } 5130 }
5133 5131
5134 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5132 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5135 return [self currentLogoAnimationControllerOwner]; 5133 return [self currentLogoAnimationControllerOwner];
5136 } 5134 }
5137 5135
5138 @end 5136 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/tabs/tab_unittest.mm ('k') | ios/chrome/browser/ui/browser_view_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698