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

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

Issue 2894513002: Adding tools menu responsiveness metric. (Closed)
Patch Set: Created 3 years, 7 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 3366 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 responsiveness of this show menu operation.
3388 NSTimeInterval startTime = [NSDate timeIntervalSinceReferenceDate];
rohitrao (ping after 24h) 2017/05/18 01:16:25 Another option would be to add this startTime to T
PL 2017/05/18 23:36:34 Done! This is a smart idea... the configuration is
3389 __block id<NSObject> oneTimeObserver = [[NSNotificationCenter defaultCenter]
3390 addObserverForName:kMenuDidShowNotification
3391 object:nil
3392 queue:nil
3393 usingBlock:^(NSNotification* _Nonnull note) {
3394 UMA_HISTOGRAM_TIMES(
3395 "UI.Performance.ShowToolsMenuResponsiveness",
3396 base::TimeDelta::FromSecondsD(
3397 [NSDate timeIntervalSinceReferenceDate] - startTime));
3398 [[NSNotificationCenter defaultCenter]
3399 removeObserver:oneTimeObserver];
3400 oneTimeObserver = nil;
3401 }];
3402
3387 // Dismiss the omnibox (if open). 3403 // Dismiss the omnibox (if open).
3388 [_toolbarController cancelOmniboxEdit]; 3404 [_toolbarController cancelOmniboxEdit];
3389 // Dismiss the soft keyboard (if open). 3405 // Dismiss the soft keyboard (if open).
3390 [[_model currentTab].webController dismissKeyboard]; 3406 [[_model currentTab].webController dismissKeyboard];
3391 // Dismiss Find in Page focus. 3407 // Dismiss Find in Page focus.
3392 [self updateFindBar:NO shouldFocus:NO]; 3408 [self updateFindBar:NO shouldFocus:NO];
3393 3409
3394 ToolsMenuConfiguration* configuration = 3410 ToolsMenuConfiguration* configuration =
3395 [[ToolsMenuConfiguration alloc] initWithDisplayView:[self view]]; 3411 [[ToolsMenuConfiguration alloc] initWithDisplayView:[self view]];
3396 if ([_model count] == 0) 3412 if ([_model count] == 0)
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after
5169 5185
5170 - (UIView*)voiceSearchButton { 5186 - (UIView*)voiceSearchButton {
5171 return _voiceSearchButton; 5187 return _voiceSearchButton;
5172 } 5188 }
5173 5189
5174 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5190 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5175 return [self currentLogoAnimationControllerOwner]; 5191 return [self currentLogoAnimationControllerOwner];
5176 } 5192 }
5177 5193
5178 @end 5194 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/ui/toolbar/toolbar_controller.h » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698