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

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

Issue 8227038: Sync Promo: Close browser tab when closing promo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix merge issues Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser_list.h ('k') | chrome/browser/ui/webui/ntp/ntp_login_handler.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) 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/ui/browser_list.h" 5 #include "chrome/browser/ui/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"
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 it != BrowserList::end(); 683 it != BrowserList::end();
684 ++it) { 684 ++it) {
685 Browser* browser = *it; 685 Browser* browser = *it;
686 if (browser->window() && browser->window()->GetNativeHandle() == window) 686 if (browser->window() && browser->window()->GetNativeHandle() == window)
687 return browser; 687 return browser;
688 } 688 }
689 return NULL; 689 return NULL;
690 } 690 }
691 691
692 // static 692 // static
693 Browser* BrowserList::FindBrowserWithTabContents(TabContents* tab_contents) {
694 DCHECK(tab_contents);
695 for (TabContentsIterator it; !it.done(); ++it) {
696 if (it->tab_contents() == tab_contents)
697 return it.browser();
698 }
699 return NULL;
700 }
701
702 // static
693 size_t BrowserList::GetBrowserCountForType(Profile* profile, 703 size_t BrowserList::GetBrowserCountForType(Profile* profile,
694 bool match_tabbed) { 704 bool match_tabbed) {
695 size_t result = 0; 705 size_t result = 0;
696 for (BrowserList::const_iterator i = BrowserList::begin(); 706 for (BrowserList::const_iterator i = BrowserList::begin();
697 i != BrowserList::end(); ++i) { 707 i != BrowserList::end(); ++i) {
698 if (BrowserMatches(*i, profile, Browser::FEATURE_NONE, 708 if (BrowserMatches(*i, profile, Browser::FEATURE_NONE,
699 match_tabbed ? kMatchTabbed : kMatchAny)) 709 match_tabbed ? kMatchTabbed : kMatchAny))
700 ++result; 710 ++result;
701 } 711 }
702 return result; 712 return result;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 // If no more TabContents from Browsers, check the BackgroundPrintingManager. 787 // If no more TabContents from Browsers, check the BackgroundPrintingManager.
778 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { 788 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) {
779 cur_ = *bg_printing_iterator_; 789 cur_ = *bg_printing_iterator_;
780 CHECK(cur_); 790 CHECK(cur_);
781 ++bg_printing_iterator_; 791 ++bg_printing_iterator_;
782 return; 792 return;
783 } 793 }
784 // Reached the end - no more TabContents. 794 // Reached the end - no more TabContents.
785 cur_ = NULL; 795 cur_ = NULL;
786 } 796 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_list.h ('k') | chrome/browser/ui/webui/ntp/ntp_login_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698