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

Unified Diff: chrome/browser/views/frame/browser_view.cc

Issue 160276: mole expand/collapse API (Closed)
Patch Set: fixed a couple of crashers Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/extensions/extension_shelf.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/browser_view.cc
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index c9a31553e73d4f4019c1695520d5308ab5c2a781..580ee771eea0ce2ea3e89b52f2f32e9b20a1bda2 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -599,9 +599,13 @@ void BrowserView::SetBounds(const gfx::Rect& bounds) {
}
void BrowserView::Close() {
- BubbleSet::iterator bubble = browser_bubbles_.begin();
- for (; bubble != browser_bubbles_.end(); ++bubble)
+ // BrowserWindowClosing will usually cause the bubble to remove itself from
+ // the set, so we need to iterate in a way that's safe against deletion.
+ for (BubbleSet::iterator i = browser_bubbles_.begin();
+ i != browser_bubbles_.end();) {
+ BubbleSet::iterator bubble = i++;
(*bubble)->BrowserWindowClosing();
+ }
frame_->GetWindow()->Close();
}
@@ -1490,10 +1494,12 @@ void BrowserView::Init() {
status_bubble_.reset(new StatusBubbleViews(GetWidget()));
- extension_shelf_ = new ExtensionShelf(browser_.get());
- extension_shelf_->
- SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_EXTENSIONS));
- AddChildView(extension_shelf_);
+ if (browser_->SupportsWindowFeature(Browser::FEATURE_EXTENSIONSHELF)) {
+ extension_shelf_ = new ExtensionShelf(browser_.get());
+ extension_shelf_->
+ SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_EXTENSIONS));
+ AddChildView(extension_shelf_);
+ }
#if defined(OS_WIN)
InitSystemMenu();
« no previous file with comments | « chrome/browser/views/extensions/extension_shelf.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698