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

Unified Diff: chrome/browser/chromeos/frame/bubble_frame_view.cc

Issue 4396001: Merge 64807 & 64824 - Cloud Print Dialog work (Closed) Base URL: svn://svn.chromium.org/chrome/branches/552/src/
Patch Set: Created 10 years, 1 month 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/chrome_plugin_host.cc ('k') | chrome/browser/chromeos/login/login_html_dialog.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/frame/bubble_frame_view.cc
===================================================================
--- chrome/browser/chromeos/frame/bubble_frame_view.cc (revision 64933)
+++ chrome/browser/chromeos/frame/bubble_frame_view.cc (working copy)
@@ -38,10 +38,12 @@
close_button_(NULL) {
set_border(new BubbleBorder(BubbleBorder::NONE));
- title_ = new views::Label(frame_->GetDelegate()->GetWindowTitle());
- title_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
- title_->SetFont(title_->font().DeriveFont(1, gfx::Font::BOLD));
- AddChildView(title_);
+ if (frame_->GetDelegate()->ShouldShowWindowTitle()) {
+ title_ = new views::Label(frame_->GetDelegate()->GetWindowTitle());
+ title_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
+ title_->SetFont(title_->font().DeriveFont(1, gfx::Font::BOLD));
+ AddChildView(title_);
+ }
if (style_ & BubbleWindow::STYLE_XBAR) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
@@ -66,16 +68,20 @@
gfx::Rect BubbleFrameView::GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const {
gfx::Insets insets = GetInsets();
- gfx::Size title_size = title_->GetPreferredSize();
+ gfx::Size title_size;
+ if (title_) {
+ title_size = title_->GetPreferredSize();
+ }
gfx::Size close_button_size = gfx::Size();
if (close_button_) {
close_button_size = close_button_->GetPreferredSize();
}
- int top_height = insets.top() +
- std::max(title_size.height(), close_button_size.height()) +
- kTitleContentPadding;
+ int top_height = insets.top();
+ if (title_size.height() > 0 || close_button_size.height() > 0)
+ top_height += std::max(title_size.height(), close_button_size.height()) +
+ kTitleContentPadding;
return gfx::Rect(std::max(0, client_bounds.x() - insets.left()),
std::max(0, client_bounds.y() - top_height),
client_bounds.width() + insets.width(),
@@ -118,27 +124,33 @@
void BubbleFrameView::Layout() {
gfx::Insets insets = GetInsets();
- gfx::Size title_size = title_->GetPreferredSize();
+ gfx::Size title_size;
+ if (title_) {
+ title_size = title_->GetPreferredSize();
+ }
gfx::Size close_button_size = gfx::Size();
if (close_button_) {
close_button_size = close_button_->GetPreferredSize();
}
- title_->SetBounds(
- insets.left(), insets.top(),
- std::max(0, width() - insets.width() - close_button_size.width()),
- title_size.height());
+ if (title_) {
+ title_->SetBounds(
+ insets.left(), insets.top(),
+ std::max(0, width() - insets.width() - close_button_size.width()),
+ title_size.height());
+ }
if (close_button_) {
close_button_->SetBounds(
- width() - insets.right() - close_button_size.width(), insets.top(),
+ width() - insets.right() - close_button_size.width(), insets.top(),
close_button_size.width(), close_button_size.height());
}
- int top_height = insets.top() +
- std::max(title_size.height(), close_button_size.height()) +
- kTitleContentPadding;
+ int top_height = insets.top();
+ if (title_size.height() > 0 || close_button_size.height() > 0)
+ top_height += std::max(title_size.height(), close_button_size.height()) +
+ kTitleContentPadding;
client_view_bounds_.SetRect(insets.left(), top_height,
std::max(0, width() - insets.width()),
std::max(0, height() - top_height - insets.bottom()));
« no previous file with comments | « chrome/browser/chrome_plugin_host.cc ('k') | chrome/browser/chromeos/login/login_html_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698