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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 // Shows a panel within the New Tab Page. | 618 // Shows a panel within the New Tab Page. |
619 - (void)showNTPPanel:(NewTabPage::PanelIdentifier)panel; | 619 - (void)showNTPPanel:(NewTabPage::PanelIdentifier)panel; |
620 // Shows the "rate this app" dialog. | 620 // Shows the "rate this app" dialog. |
621 - (void)showRateThisAppDialog; | 621 - (void)showRateThisAppDialog; |
622 // Dismisses the "rate this app" dialog. | 622 // Dismisses the "rate this app" dialog. |
623 - (void)dismissRateThisAppDialog; | 623 - (void)dismissRateThisAppDialog; |
624 #if !defined(NDEBUG) | 624 #if !defined(NDEBUG) |
625 // Shows the source of the current page. | 625 // Shows the source of the current page. |
626 - (void)viewSource; | 626 - (void)viewSource; |
627 #endif | 627 #endif |
628 // Whether the given tab's url begins with the chrome prefix. | 628 // Whether the given tab's URL is an application specific URL. |
629 - (BOOL)isTabNativePage:(Tab*)tab; | 629 - (BOOL)isTabNativePage:(Tab*)tab; |
630 // Returns the view to use when animating a page in or out, positioning it to | 630 // Returns the view to use when animating a page in or out, positioning it to |
631 // fill the content area but not actually adding it to the view hierarchy. | 631 // fill the content area but not actually adding it to the view hierarchy. |
632 - (UIImageView*)pageOpenCloseAnimationView; | 632 - (UIImageView*)pageOpenCloseAnimationView; |
633 // Returns the view to use when animating full screen NTP paper in, filling the | 633 // Returns the view to use when animating full screen NTP paper in, filling the |
634 // entire screen but not actually adding it to the view hierarchy. | 634 // entire screen but not actually adding it to the view hierarchy. |
635 - (UIImageView*)pageFullScreenOpenCloseAnimationView; | 635 - (UIImageView*)pageFullScreenOpenCloseAnimationView; |
636 // Updates the toolbar display based on the current tab. | 636 // Updates the toolbar display based on the current tab. |
637 - (void)updateToolbar; | 637 - (void)updateToolbar; |
638 // Updates |dialogPresenter|'s |active| property to account for the BVC's | 638 // Updates |dialogPresenter|'s |active| property to account for the BVC's |
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2044 params.extra_headers.reset([@{ @"Content-Type" : contentType } retain]); | 2044 params.extra_headers.reset([@{ @"Content-Type" : contentType } retain]); |
2045 } | 2045 } |
2046 Tab* tab = [_model insertTabWithLoadParams:params | 2046 Tab* tab = [_model insertTabWithLoadParams:params |
2047 opener:nil | 2047 opener:nil |
2048 openedByDOM:NO | 2048 openedByDOM:NO |
2049 atIndex:position | 2049 atIndex:position |
2050 inBackground:NO]; | 2050 inBackground:NO]; |
2051 return tab; | 2051 return tab; |
2052 } | 2052 } |
2053 | 2053 |
2054 // Whether the given tab's url begins with the chrome prefix. | 2054 // Whether the given tab's URL is an application specific URL. |
2055 - (BOOL)isTabNativePage:(Tab*)tab { | 2055 - (BOOL)isTabNativePage:(Tab*)tab { |
2056 return tab && tab.url.SchemeIs(kChromeUIScheme); | 2056 web::WebState* webState = tab.webState; |
| 2057 if (!webState) |
| 2058 return NO; |
| 2059 web::NavigationManager* navigationManager = webState->GetNavigationManager(); |
| 2060 if (!navigationManager) |
| 2061 return NO; |
| 2062 web::NavigationItem* visibleItem = navigationManager->GetVisibleItem(); |
| 2063 if (!visibleItem) |
| 2064 return NO; |
| 2065 return web::GetWebClient()->IsAppSpecificURL(visibleItem->GetURL()); |
2057 } | 2066 } |
2058 | 2067 |
2059 - (void)expectNewForegroundTab { | 2068 - (void)expectNewForegroundTab { |
2060 _expectingForegroundTab = YES; | 2069 _expectingForegroundTab = YES; |
2061 } | 2070 } |
2062 | 2071 |
2063 - (UIImageView*)pageFullScreenOpenCloseAnimationView { | 2072 - (UIImageView*)pageFullScreenOpenCloseAnimationView { |
2064 CGRect viewBounds, remainder; | 2073 CGRect viewBounds, remainder; |
2065 CGRectDivide(self.view.bounds, &remainder, &viewBounds, StatusBarHeight(), | 2074 CGRectDivide(self.view.bounds, &remainder, &viewBounds, StatusBarHeight(), |
2066 CGRectMinYEdge); | 2075 CGRectMinYEdge); |
(...skipping 2945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5012 | 5021 |
5013 - (UIView*)voiceSearchButton { | 5022 - (UIView*)voiceSearchButton { |
5014 return _voiceSearchButton; | 5023 return _voiceSearchButton; |
5015 } | 5024 } |
5016 | 5025 |
5017 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { | 5026 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { |
5018 return [self currentLogoAnimationControllerOwner]; | 5027 return [self currentLogoAnimationControllerOwner]; |
5019 } | 5028 } |
5020 | 5029 |
5021 @end | 5030 @end |
OLD | NEW |