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

Side by Side Diff: chrome/chrome_watcher/chrome_watcher_main.cc

Issue 846383003: Record mode of endsession in watcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | 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
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 <windows.h> 5 #include <windows.h>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 return false; 109 return false;
110 } 110 }
111 111
112 return true; 112 return true;
113 } 113 }
114 114
115 void BrowserMonitor::OnEndSession(LPARAM lparam) { 115 void BrowserMonitor::OnEndSession(LPARAM lparam) {
116 DCHECK_EQ(main_thread_, base::MessageLoopProxy::current()); 116 DCHECK_EQ(main_thread_, base::MessageLoopProxy::current());
117 117
118 exit_funnel_.RecordEvent(L"WatcherLogoff"); 118 exit_funnel_.RecordEvent(L"WatcherLogoff");
119 if (lparam & ENDSESSION_CLOSEAPP)
120 exit_funnel_.RecordEvent(L"ES_CloseApp");
121 if (lparam & ENDSESSION_CRITICAL)
122 exit_funnel_.RecordEvent(L"ES_Critical");
123 if (lparam & ENDSESSION_LOGOFF)
124 exit_funnel_.RecordEvent(L"ES_Logoff");
125 const LPARAM kKnownBits =
126 ENDSESSION_CLOSEAPP | ENDSESSION_CRITICAL | ENDSESSION_LOGOFF;
127 if (lparam & ~kKnownBits)
128 exit_funnel_.RecordEvent(L"ES_Other");
119 129
120 // Belt-and-suspenders; make sure our message loop exits ASAP. 130 // Belt-and-suspenders; make sure our message loop exits ASAP.
121 if (browser_exited_) 131 if (browser_exited_)
122 run_loop_->Quit(); 132 run_loop_->Quit();
123 } 133 }
124 134
125 void BrowserMonitor::Watch() { 135 void BrowserMonitor::Watch() {
126 // This needs to run on an IO thread. 136 // This needs to run on an IO thread.
127 DCHECK_NE(main_thread_, base::MessageLoopProxy::current()); 137 DCHECK_NE(main_thread_, base::MessageLoopProxy::current());
128 138
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 199
190 // Wind logging down. 200 // Wind logging down.
191 logging::LogEventProvider::Uninitialize(); 201 logging::LogEventProvider::Uninitialize();
192 202
193 return 0; 203 return 0;
194 } 204 }
195 205
196 static_assert(base::is_same<decltype(&WatcherMain), 206 static_assert(base::is_same<decltype(&WatcherMain),
197 browser_watcher::WatcherMainFunction>::value, 207 browser_watcher::WatcherMainFunction>::value,
198 "WatcherMain() has wrong type"); 208 "WatcherMain() has wrong type");
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698