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

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

Issue 2127143002: Integrate audible tab tracking into desktop engagement service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « chrome/browser/ui/browser_list.h ('k') | chrome/browser/ui/browser_list_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser_list.h" 5 #include "chrome/browser/ui/browser_list.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 content::RecordAction(UserMetricsAction("ActiveBrowserChanged")); 190 content::RecordAction(UserMetricsAction("ActiveBrowserChanged"));
191 191
192 RemoveBrowserFrom(browser, &GetInstance()->last_active_browsers_); 192 RemoveBrowserFrom(browser, &GetInstance()->last_active_browsers_);
193 GetInstance()->last_active_browsers_.push_back(browser); 193 GetInstance()->last_active_browsers_.push_back(browser);
194 194
195 FOR_EACH_OBSERVER(chrome::BrowserListObserver, observers_.Get(), 195 FOR_EACH_OBSERVER(chrome::BrowserListObserver, observers_.Get(),
196 OnBrowserSetLastActive(browser)); 196 OnBrowserSetLastActive(browser));
197 } 197 }
198 198
199 // static 199 // static
200 void BrowserList::NotifyBrowserNoLongerActive(Browser* browser) {
201 FOR_EACH_OBSERVER(chrome::BrowserListObserver, observers_.Get(),
202 OnBrowserNoLongerActive(browser));
203 }
204
205 // static
200 bool BrowserList::IsIncognitoSessionActive() { 206 bool BrowserList::IsIncognitoSessionActive() {
201 for (auto* browser : *BrowserList::GetInstance()) { 207 for (auto* browser : *BrowserList::GetInstance()) {
202 if (browser->profile()->IsOffTheRecord()) 208 if (browser->profile()->IsOffTheRecord())
203 return true; 209 return true;
204 } 210 }
205 return false; 211 return false;
206 } 212 }
207 213
208 // static 214 // static
209 bool BrowserList::IsIncognitoSessionActiveForProfile(Profile* profile) { 215 bool BrowserList::IsIncognitoSessionActiveForProfile(Profile* profile) {
(...skipping 16 matching lines...) Expand all
226 } 232 }
227 233
228 // static 234 // static
229 void BrowserList::RemoveBrowserFrom(Browser* browser, 235 void BrowserList::RemoveBrowserFrom(Browser* browser,
230 BrowserVector* browser_list) { 236 BrowserVector* browser_list) {
231 BrowserVector::iterator remove_browser = 237 BrowserVector::iterator remove_browser =
232 std::find(browser_list->begin(), browser_list->end(), browser); 238 std::find(browser_list->begin(), browser_list->end(), browser);
233 if (remove_browser != browser_list->end()) 239 if (remove_browser != browser_list->end())
234 browser_list->erase(remove_browser); 240 browser_list->erase(remove_browser);
235 } 241 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_list.h ('k') | chrome/browser/ui/browser_list_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698