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 3366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3377 // doing, and what the PM want, but it doesn't make it right. | 3377 // doing, and what the PM want, but it doesn't make it right. |
3378 } | 3378 } |
3379 } | 3379 } |
3380 | 3380 |
3381 #pragma mark - Showing popups | 3381 #pragma mark - Showing popups |
3382 | 3382 |
3383 - (void)showToolsMenuPopup { | 3383 - (void)showToolsMenuPopup { |
3384 DCHECK(_browserState); | 3384 DCHECK(_browserState); |
3385 DCHECK(self.visible || self.dismissingModal); | 3385 DCHECK(self.visible || self.dismissingModal); |
3386 | 3386 |
| 3387 // Record the time this menu was requested; to be stored in the configuration |
| 3388 // object. |
| 3389 NSDate* showToolsMenuPopupRequestDate = [NSDate date]; |
| 3390 |
3387 // Dismiss the omnibox (if open). | 3391 // Dismiss the omnibox (if open). |
3388 [_toolbarController cancelOmniboxEdit]; | 3392 [_toolbarController cancelOmniboxEdit]; |
3389 // Dismiss the soft keyboard (if open). | 3393 // Dismiss the soft keyboard (if open). |
3390 [[_model currentTab].webController dismissKeyboard]; | 3394 [[_model currentTab].webController dismissKeyboard]; |
3391 // Dismiss Find in Page focus. | 3395 // Dismiss Find in Page focus. |
3392 [self updateFindBar:NO shouldFocus:NO]; | 3396 [self updateFindBar:NO shouldFocus:NO]; |
3393 | 3397 |
3394 ToolsMenuConfiguration* configuration = | 3398 ToolsMenuConfiguration* configuration = |
3395 [[ToolsMenuConfiguration alloc] initWithDisplayView:[self view]]; | 3399 [[ToolsMenuConfiguration alloc] initWithDisplayView:[self view]]; |
| 3400 configuration.requestStartTime = |
| 3401 showToolsMenuPopupRequestDate.timeIntervalSinceReferenceDate; |
3396 if ([_model count] == 0) | 3402 if ([_model count] == 0) |
3397 [configuration setNoOpenedTabs:YES]; | 3403 [configuration setNoOpenedTabs:YES]; |
3398 | 3404 |
3399 if (_isOffTheRecord) | 3405 if (_isOffTheRecord) |
3400 [configuration setInIncognito:YES]; | 3406 [configuration setInIncognito:YES]; |
3401 | 3407 |
3402 if (!_readingListMenuNotifier) { | 3408 if (!_readingListMenuNotifier) { |
3403 _readingListMenuNotifier = [[ReadingListMenuNotifier alloc] | 3409 _readingListMenuNotifier = [[ReadingListMenuNotifier alloc] |
3404 initWithReadingList:ReadingListModelFactory::GetForBrowserState( | 3410 initWithReadingList:ReadingListModelFactory::GetForBrowserState( |
3405 _browserState)]; | 3411 _browserState)]; |
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5169 | 5175 |
5170 - (UIView*)voiceSearchButton { | 5176 - (UIView*)voiceSearchButton { |
5171 return _voiceSearchButton; | 5177 return _voiceSearchButton; |
5172 } | 5178 } |
5173 | 5179 |
5174 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { | 5180 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { |
5175 return [self currentLogoAnimationControllerOwner]; | 5181 return [self currentLogoAnimationControllerOwner]; |
5176 } | 5182 } |
5177 | 5183 |
5178 @end | 5184 @end |
OLD | NEW |