summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-17 19:47:37 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-17 19:47:37 +0000
commitd621991f46b6d75e23347624ac4648df239d5282 (patch)
treedcc8c875beecb47179e3871ed4c1ba84ca7eed6f /chrome/browser/tab_contents
parent28a4aae3b3134867687584eb6ea5d2f131b74f15 (diff)
downloadchromium_src-d621991f46b6d75e23347624ac4648df239d5282.zip
chromium_src-d621991f46b6d75e23347624ac4648df239d5282.tar.gz
chromium_src-d621991f46b6d75e23347624ac4648df239d5282.tar.bz2
Misc. cleanup factored out of http://codereview.chromium.org/4767001/ . Already got r+ from Ben on that issue.
BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66500 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc29
1 files changed, 13 insertions, 16 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 9b117ce..26b77ce 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -1177,9 +1177,8 @@ bool TabContents::ShouldShowBookmarkBar() {
// is so the bookmarks bar disappears at the same time the page does.
if (controller_.GetLastCommittedEntry()) {
// Not the first load, always use the committed DOM UI.
- if (render_manager_.dom_ui())
- return render_manager_.dom_ui()->force_bookmark_bar_visible();
- return false; // Default.
+ return (render_manager_.dom_ui() == NULL) ?
+ false : render_manager_.dom_ui()->force_bookmark_bar_visible();
}
// When it's the first load, we know either the pending one or the committed
@@ -1187,9 +1186,8 @@ bool TabContents::ShouldShowBookmarkBar() {
// of them will be valid, so we can just check both.
if (render_manager_.pending_dom_ui())
return render_manager_.pending_dom_ui()->force_bookmark_bar_visible();
- if (render_manager_.dom_ui())
- return render_manager_.dom_ui()->force_bookmark_bar_visible();
- return false; // Default.
+ return (render_manager_.dom_ui() == NULL) ?
+ false : render_manager_.dom_ui()->force_bookmark_bar_visible();
}
void TabContents::ToolbarSizeChanged(bool is_animating) {
@@ -1216,18 +1214,17 @@ void TabContents::OnStartDownload(DownloadItem* download) {
}
void TabContents::WillClose(ConstrainedWindow* window) {
- ConstrainedWindowList::iterator it =
- find(child_windows_.begin(), child_windows_.end(), window);
- bool removed_topmost_window = it == child_windows_.begin();
- if (it != child_windows_.end())
- child_windows_.erase(it);
- if (child_windows_.size() > 0) {
- if (removed_topmost_window) {
+ ConstrainedWindowList::iterator i(
+ std::find(child_windows_.begin(), child_windows_.end(), window));
+ bool removed_topmost_window = i == child_windows_.begin();
+ if (i != child_windows_.end())
+ child_windows_.erase(i);
+ if (child_windows_.empty()) {
+ BlockTabContent(false);
+ } else {
+ if (removed_topmost_window)
child_windows_[0]->ShowConstrainedWindow();
- }
BlockTabContent(true);
- } else {
- BlockTabContent(false);
}
}