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

Side by Side Diff: chrome/browser/ui/unload_controller.cc

Issue 2335203003: Add metrics to keep track of the tab activate/deactivate cycle (Closed)
Patch Set: Addressed comments Created 4 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "chrome/browser/ui/unload_controller.h" 5 #include "chrome/browser/ui/unload_controller.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 218
219 if (is_attempting_to_close_browser_) { 219 if (is_attempting_to_close_browser_) {
220 ClearUnloadState(content::Source<content::WebContents>(source).ptr(), 220 ClearUnloadState(content::Source<content::WebContents>(source).ptr(),
221 false); // See comment for ClearUnloadState(). 221 false); // See comment for ClearUnloadState().
222 } 222 }
223 } 223 }
224 224
225 //////////////////////////////////////////////////////////////////////////////// 225 ////////////////////////////////////////////////////////////////////////////////
226 // UnloadController, TabStripModelObserver implementation: 226 // UnloadController, TabStripModelObserver implementation:
227 227
228 void UnloadController::TabInsertedAt(content::WebContents* contents, 228 void UnloadController::TabInsertedAt(TabStripModel* tab_strip_model,
229 content::WebContents* contents,
229 int index, 230 int index,
230 bool foreground) { 231 bool foreground) {
231 TabAttachedImpl(contents); 232 TabAttachedImpl(contents);
232 } 233 }
233 234
234 void UnloadController::TabDetachedAt(content::WebContents* contents, 235 void UnloadController::TabDetachedAt(content::WebContents* contents,
235 int index) { 236 int index) {
236 TabDetachedImpl(contents); 237 TabDetachedImpl(contents);
237 } 238 }
238 239
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 ProcessPendingTabs(); 361 ProcessPendingTabs();
361 } else { 362 } else {
362 base::ThreadTaskRunnerHandle::Get()->PostTask( 363 base::ThreadTaskRunnerHandle::Get()->PostTask(
363 FROM_HERE, base::Bind(&UnloadController::ProcessPendingTabs, 364 FROM_HERE, base::Bind(&UnloadController::ProcessPendingTabs,
364 weak_factory_.GetWeakPtr())); 365 weak_factory_.GetWeakPtr()));
365 } 366 }
366 } 367 }
367 } 368 }
368 369
369 } // namespace chrome 370 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698