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

Side by Side Diff: ios/shared/chrome/browser/tabs/web_state_list_metrics_observer.mm

Issue 2687303003: Convert some of TabModel logic to WebStateListObservers. (Closed)
Patch Set: Rebase. Created 3 years, 10 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
« no previous file with comments | « ios/shared/chrome/browser/tabs/web_state_list_metrics_observer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ios/shared/chrome/browser/tabs/web_state_list_metrics_observer.h"
6
7 #include "base/metrics/user_metrics.h"
8 #include "base/metrics/user_metrics_action.h"
9
10 #if !defined(__has_feature) || !__has_feature(objc_arc)
11 #error "This file requires ARC support."
12 #endif
13
14 WebStateListMetricsObserver::WebStateListMetricsObserver() = default;
15
16 WebStateListMetricsObserver::~WebStateListMetricsObserver() = default;
17
18 void WebStateListMetricsObserver::WebStateInsertedAt(
19 WebStateList* web_state_list,
20 web::WebState* web_state,
21 int index) {
22 base::RecordAction(base::UserMetricsAction("MobileNewTabOpened"));
23 }
24
25 void WebStateListMetricsObserver::WebStateMoved(WebStateList* web_state_list,
26 web::WebState* web_state,
27 int from_index,
28 int to_index) {}
29
30 void WebStateListMetricsObserver::WebStateReplacedAt(
31 WebStateList* web_state_list,
32 web::WebState* old_web_state,
33 web::WebState* new_web_state,
34 int index) {
35 // Record a tab clobber, since swapping tabs bypasses the Tab code that would
36 // normally log clobbers.
37 base::RecordAction(base::UserMetricsAction("MobileTabClobbered"));
38 }
39
40 void WebStateListMetricsObserver::WebStateDetachedAt(
41 WebStateList* web_state_list,
42 web::WebState* web_state,
43 int index) {
44 base::RecordAction(base::UserMetricsAction("MobileTabClosed"));
45 }
OLDNEW
« no previous file with comments | « ios/shared/chrome/browser/tabs/web_state_list_metrics_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698