OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_list.h" | 5 #include "chrome/browser/browser_list.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/browser_shutdown.h" | 12 #include "chrome/browser/browser_shutdown.h" |
13 #include "chrome/browser/browser_window.h" | 13 #include "chrome/browser/browser_window.h" |
14 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 15 #include "chrome/browser/sessions/tab_restore_service_delegate.h" |
15 #include "chrome/common/result_codes.h" | 16 #include "chrome/common/result_codes.h" |
16 #include "content/browser/renderer_host/render_process_host.h" | 17 #include "content/browser/renderer_host/render_process_host.h" |
17 #include "content/browser/tab_contents/navigation_controller.h" | 18 #include "content/browser/tab_contents/navigation_controller.h" |
18 #include "content/common/notification_registrar.h" | 19 #include "content/common/notification_registrar.h" |
19 #include "content/common/notification_service.h" | 20 #include "content/common/notification_service.h" |
20 | 21 |
21 #if defined(OS_MACOSX) | 22 #if defined(OS_MACOSX) |
22 #include "chrome/browser/chrome_browser_application_mac.h" | 23 #include "chrome/browser/chrome_browser_application_mac.h" |
23 #endif | 24 #endif |
24 | 25 |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 Browser* BrowserList::FindBrowserWithID(SessionID::id_type desired_id) { | 557 Browser* BrowserList::FindBrowserWithID(SessionID::id_type desired_id) { |
557 for (BrowserList::const_iterator i = BrowserList::begin(); | 558 for (BrowserList::const_iterator i = BrowserList::begin(); |
558 i != BrowserList::end(); ++i) { | 559 i != BrowserList::end(); ++i) { |
559 if ((*i)->session_id().id() == desired_id) | 560 if ((*i)->session_id().id() == desired_id) |
560 return *i; | 561 return *i; |
561 } | 562 } |
562 return NULL; | 563 return NULL; |
563 } | 564 } |
564 | 565 |
565 // static | 566 // static |
| 567 TabRestoreServiceDelegate* TabRestoreServiceDelegate::FindBrowserWithID( |
| 568 SessionID::id_type desired_id) { |
| 569 return BrowserList::FindBrowserWithID(desired_id); |
| 570 } |
| 571 |
| 572 // static |
566 size_t BrowserList::GetBrowserCountForType(Profile* p, Browser::Type type) { | 573 size_t BrowserList::GetBrowserCountForType(Profile* p, Browser::Type type) { |
567 size_t result = 0; | 574 size_t result = 0; |
568 for (BrowserList::const_iterator i = BrowserList::begin(); | 575 for (BrowserList::const_iterator i = BrowserList::begin(); |
569 i != BrowserList::end(); ++i) { | 576 i != BrowserList::end(); ++i) { |
570 if (BrowserMatches(*i, p, type, Browser::FEATURE_NONE, kMatchNothing)) | 577 if (BrowserMatches(*i, p, type, Browser::FEATURE_NONE, kMatchNothing)) |
571 ++result; | 578 ++result; |
572 } | 579 } |
573 return result; | 580 return result; |
574 } | 581 } |
575 | 582 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 } | 640 } |
634 | 641 |
635 TabContents* next_tab = | 642 TabContents* next_tab = |
636 (*browser_iterator_)->GetTabContentsAt(web_view_index_); | 643 (*browser_iterator_)->GetTabContentsAt(web_view_index_); |
637 if (next_tab) { | 644 if (next_tab) { |
638 cur_ = next_tab; | 645 cur_ = next_tab; |
639 return; | 646 return; |
640 } | 647 } |
641 } | 648 } |
642 } | 649 } |
OLD | NEW |