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 "chrome/browser/sessions/session_service.h" | 5 #include "chrome/browser/sessions/session_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1376 return false; | 1376 return false; |
1377 } | 1377 } |
1378 | 1378 |
1379 bool SessionService::ShouldTrackChangesToWindow(const SessionID& window_id) { | 1379 bool SessionService::ShouldTrackChangesToWindow(const SessionID& window_id) { |
1380 return windows_tracking_.find(window_id.id()) != windows_tracking_.end(); | 1380 return windows_tracking_.find(window_id.id()) != windows_tracking_.end(); |
1381 } | 1381 } |
1382 | 1382 |
1383 | 1383 |
1384 bool SessionService::should_track_changes_for_browser_type(Browser::Type type) { | 1384 bool SessionService::should_track_changes_for_browser_type(Browser::Type type) { |
1385 return type == Browser::TYPE_TABBED || | 1385 return type == Browser::TYPE_TABBED || |
1386 type == Browser::TYPE_APP || | |
sky
2012/02/13 16:01:32
nit: keep spacing consistent.
DaveMoore
2012/02/13 18:58:40
Done.
| |
1386 (type == Browser::TYPE_POPUP && browser_defaults::kRestorePopups); | 1387 (type == Browser::TYPE_POPUP && browser_defaults::kRestorePopups); |
1387 } | 1388 } |
1388 | 1389 |
1389 SessionService::WindowType SessionService::WindowTypeForBrowserType( | 1390 SessionService::WindowType SessionService::WindowTypeForBrowserType( |
1390 Browser::Type type) { | 1391 Browser::Type type) { |
1391 switch (type) { | 1392 switch (type) { |
1392 case Browser::TYPE_POPUP: | 1393 case Browser::TYPE_POPUP: |
1393 return TYPE_POPUP; | 1394 return TYPE_POPUP; |
1394 case Browser::TYPE_TABBED: | 1395 case Browser::TYPE_TABBED: |
1395 return TYPE_TABBED; | 1396 return TYPE_TABBED; |
1397 case Browser::TYPE_APP: | |
1398 return TYPE_APP; | |
1396 default: | 1399 default: |
1397 DCHECK(false); | 1400 DCHECK(false); |
1398 return TYPE_TABBED; | 1401 return TYPE_TABBED; |
1399 } | 1402 } |
1400 } | 1403 } |
1401 | 1404 |
1402 Browser::Type SessionService::BrowserTypeForWindowType(WindowType type) { | 1405 Browser::Type SessionService::BrowserTypeForWindowType(WindowType type) { |
1403 switch (type) { | 1406 switch (type) { |
1404 case TYPE_POPUP: | 1407 case TYPE_POPUP: |
1405 return Browser::TYPE_POPUP; | 1408 return Browser::TYPE_POPUP; |
1409 case TYPE_APP: | |
1410 return Browser::TYPE_APP; | |
1406 case TYPE_TABBED: | 1411 case TYPE_TABBED: |
1407 default: | 1412 default: |
1408 return Browser::TYPE_TABBED; | 1413 return Browser::TYPE_TABBED; |
1409 } | 1414 } |
1410 } | 1415 } |
1411 | 1416 |
1412 void SessionService::RecordSessionUpdateHistogramData(int type, | 1417 void SessionService::RecordSessionUpdateHistogramData(int type, |
1413 base::TimeTicks* last_updated_time) { | 1418 base::TimeTicks* last_updated_time) { |
1414 if (!last_updated_time->is_null()) { | 1419 if (!last_updated_time->is_null()) { |
1415 base::TimeDelta delta = base::TimeTicks::Now() - *last_updated_time; | 1420 base::TimeDelta delta = base::TimeTicks::Now() - *last_updated_time; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1531 50); | 1536 50); |
1532 if (use_long_period) { | 1537 if (use_long_period) { |
1533 std::string long_name_("SessionRestore.SaveLongPeriod"); | 1538 std::string long_name_("SessionRestore.SaveLongPeriod"); |
1534 UMA_HISTOGRAM_CUSTOM_TIMES(long_name_, | 1539 UMA_HISTOGRAM_CUSTOM_TIMES(long_name_, |
1535 delta, | 1540 delta, |
1536 save_delay_in_mins_, | 1541 save_delay_in_mins_, |
1537 save_delay_in_hrs_, | 1542 save_delay_in_hrs_, |
1538 50); | 1543 50); |
1539 } | 1544 } |
1540 } | 1545 } |
OLD | NEW |