Lines Matching refs:browser

5 #include "chrome/browser/chromeos/tab_closeable_state_watcher.h"
8 #include "chrome/browser/browser_shutdown.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/tabs/tab_strip_model.h"
11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
14 #include "content/browser/tab_contents/tab_contents.h"
15 #include "content/browser/tab_contents/tab_contents_view.h"
24 TabCloseableStateWatcher* main_watcher, const Browser* browser)
26 browser_(browser) {
83 bool TabCloseableStateWatcher::CanCloseTab(const Browser* browser) const {
84 return browser->type() != Browser::TYPE_NORMAL ? true :
88 bool TabCloseableStateWatcher::CanCloseBrowser(Browser* browser) {
90 bool can_close = CanCloseBrowserImpl(browser, &action_type);
92 browser->NewWindow();
96 browser->CloseAllTabs();
101 void TabCloseableStateWatcher::OnWindowCloseCanceled(Browser* browser) {
106 CheckAndUpdateState(browser);
113 void TabCloseableStateWatcher::OnBrowserAdded(const Browser* browser) {
117 if (browser->type() != Browser::TYPE_NORMAL)
120 // Create TabStripWatcher to observe tabstrip of new browser.
121 tabstrip_watchers_.push_back(new TabStripWatcher(this, browser));
123 // When a normal browser is just added, there's no tabs yet, so we wait till
127 void TabCloseableStateWatcher::OnBrowserRemoved(const Browser* browser) {
129 if (browser->type() != Browser::TYPE_NORMAL)
132 // Remove TabStripWatcher for browser that is being removed.
135 if ((*it)->browser() == browser) {
161 void TabCloseableStateWatcher::OnTabStripChanged(const Browser* browser,
167 CheckAndUpdateState(browser);
173 CanCloseBrowserImpl(browser, &action_type);
175 Browser* mutable_browser = const_cast<Browser*>(browser);
193 } else { // There's only 1 normal browser.
195 browser_to_check = tabstrip_watchers_[0]->browser();
227 const Browser* browser,
231 // If we're waiting for a new browser allow the close.
240 if (browser->type() != Browser::TYPE_NORMAL)
243 // If this is not the last normal browser, it's always closeable.
247 // If last normal browser is incognito, open a non-incognito window, and allow
249 // for the new browser before doing any other actions as the new browser may
251 if (browser->profile()->IsOffTheRecord() && !guest_session_) {
257 // If tab is not closeable, browser is not closeable.
261 // Otherwise, close existing tabs, and deny closing of browser.