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

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

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 | « no previous file | chrome/browser/ui/browser_list.cc » ('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 #ifndef CHROME_BROWSER_UI_BROWSER_LIST_H_ 5 #ifndef CHROME_BROWSER_UI_BROWSER_LIST_H_
6 #define CHROME_BROWSER_UI_BROWSER_LIST_H_ 6 #define CHROME_BROWSER_UI_BROWSER_LIST_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/observer_list.h" 12 #include "base/observer_list.h"
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "ui/gfx/native_widget_types.h" 14 #include "ui/gfx/native_widget_types.h"
15 15
16 class TabContents;
17
16 // Stores a list of all Browser objects. 18 // Stores a list of all Browser objects.
17 class BrowserList { 19 class BrowserList {
18 public: 20 public:
19 typedef std::vector<Browser*> BrowserVector; 21 typedef std::vector<Browser*> BrowserVector;
20 typedef BrowserVector::iterator iterator; 22 typedef BrowserVector::iterator iterator;
21 typedef BrowserVector::const_iterator const_iterator; 23 typedef BrowserVector::const_iterator const_iterator;
22 typedef BrowserVector::const_reverse_iterator const_reverse_iterator; 24 typedef BrowserVector::const_reverse_iterator const_reverse_iterator;
23 25
24 // It is not allowed to change the global window list (add or remove any 26 // It is not allowed to change the global window list (add or remove any
25 // browser windows while handling observer callbacks. 27 // browser windows while handling observer callbacks.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // returned. Returns NULL if no such browser currently exists. 93 // returned. Returns NULL if no such browser currently exists.
92 static Browser* FindBrowserWithProfile(Profile* profile); 94 static Browser* FindBrowserWithProfile(Profile* profile);
93 95
94 // Find an existing browser with the provided ID. Returns NULL if no such 96 // Find an existing browser with the provided ID. Returns NULL if no such
95 // browser currently exists. 97 // browser currently exists.
96 static Browser* FindBrowserWithID(SessionID::id_type desired_id); 98 static Browser* FindBrowserWithID(SessionID::id_type desired_id);
97 99
98 // Find the browser represented by |window| or NULL if not found. 100 // Find the browser represented by |window| or NULL if not found.
99 static Browser* FindBrowserWithWindow(gfx::NativeWindow window); 101 static Browser* FindBrowserWithWindow(gfx::NativeWindow window);
100 102
103 // Find the browser containing |tab_contents| or NULL if none is found.
104 // |tab_contents| must not be NULL.
105 static Browser* FindBrowserWithTabContents(TabContents* tab_contents);
106
101 // Checks if the browser can be automatically restarted to install upgrades 107 // Checks if the browser can be automatically restarted to install upgrades
102 // The browser can be automatically restarted when: 108 // The browser can be automatically restarted when:
103 // 1. It's in the background mode (no visible windows). 109 // 1. It's in the background mode (no visible windows).
104 // 2. An update exe is present in the install folder. 110 // 2. An update exe is present in the install folder.
105 static bool CanRestartForUpdate(); 111 static bool CanRestartForUpdate();
106 112
107 // Starts a user initiated exit process. Called from Browser::Exit. 113 // Starts a user initiated exit process. Called from Browser::Exit.
108 // On platforms other than ChromeOS, this is equivalent to 114 // On platforms other than ChromeOS, this is equivalent to
109 // CloseAllBrowsersAndExit. On ChromeOS, this tells session manager 115 // CloseAllBrowsersAndExit. On ChromeOS, this tells session manager
110 // that chrome is signing out, which lets session manager send 116 // that chrome is signing out, which lets session manager send
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // iterator over the TabContentsWrappers doing background printing. 291 // iterator over the TabContentsWrappers doing background printing.
286 std::set<TabContentsWrapper*>::const_iterator bg_printing_iterator_; 292 std::set<TabContentsWrapper*>::const_iterator bg_printing_iterator_;
287 293
288 // Current TabContents, or NULL if we're at the end of the list. This can 294 // Current TabContents, or NULL if we're at the end of the list. This can
289 // be extracted given the browser iterator and index, but it's nice to cache 295 // be extracted given the browser iterator and index, but it's nice to cache
290 // this since the caller may access the current host many times. 296 // this since the caller may access the current host many times.
291 TabContentsWrapper* cur_; 297 TabContentsWrapper* cur_;
292 }; 298 };
293 299
294 #endif // CHROME_BROWSER_UI_BROWSER_LIST_H_ 300 #endif // CHROME_BROWSER_UI_BROWSER_LIST_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698