OLD | NEW |
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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 | 111 |
112 // This method can be checked to see whether any incognito window has been | 112 // This method can be checked to see whether any incognito window has been |
113 // opened since the time this object was created. | 113 // opened since the time this object was created. |
114 bool incognito_launched() { | 114 bool incognito_launched() { |
115 return incognito_launched_; | 115 return incognito_launched_; |
116 } | 116 } |
117 | 117 |
118 private: | 118 private: |
119 // chrome::BrowserListObserver implementation. | 119 // chrome::BrowserListObserver implementation. |
120 virtual void OnBrowserAdded(Browser* browser) OVERRIDE { | 120 virtual void OnBrowserAdded(Browser* browser) override { |
121 if (browser->profile()->IsOffTheRecord()) | 121 if (browser->profile()->IsOffTheRecord()) |
122 incognito_launched_ = true; | 122 incognito_launched_ = true; |
123 } | 123 } |
124 | 124 |
125 bool incognito_launched_; | 125 bool incognito_launched_; |
126 }; | 126 }; |
127 | 127 |
128 PerfProvider::PerfProvider() | 128 PerfProvider::PerfProvider() |
129 : login_observer_(this), | 129 : login_observer_(this), |
130 next_profiling_interval_start_(base::TimeTicks::Now()), | 130 next_profiling_interval_start_(base::TimeTicks::Now()), |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 DCHECK(!login_time_.is_null()); | 395 DCHECK(!login_time_.is_null()); |
396 collection_data. | 396 collection_data. |
397 set_ms_after_login((base::TimeTicks::Now() - login_time_) | 397 set_ms_after_login((base::TimeTicks::Now() - login_time_) |
398 .InMilliseconds()); | 398 .InMilliseconds()); |
399 | 399 |
400 // Finally, store the perf data itself. | 400 // Finally, store the perf data itself. |
401 collection_data.mutable_perf_data()->Swap(&perf_data_proto); | 401 collection_data.mutable_perf_data()->Swap(&perf_data_proto); |
402 } | 402 } |
403 | 403 |
404 } // namespace metrics | 404 } // namespace metrics |
OLD | NEW |