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

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

Issue 8461015: UI polish for certificate viewer. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Nit Created 9 years 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 | « no previous file | chrome/browser/resources/certificate_viewer.css » ('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
diff --git a/chrome/browser/chromeos/frame/bubble_frame_view.cc b/chrome/browser/chromeos/frame/bubble_frame_view.cc
index dc35fdab2dd817cbc652791b1a4bc6d3fd92e0d7..9aaad387c24a941731ec8c7bab7843f29970d689 100644
--- a/chrome/browser/chromeos/frame/bubble_frame_view.cc
+++ b/chrome/browser/chromeos/frame/bubble_frame_view.cc
@@ -140,7 +140,7 @@ void BubbleFrameView::UpdateWindowIcon() {
}
gfx::Insets BubbleFrameView::GetInsets() const {
- return (style_ & STYLE_FLUSH) ?
+ return (style_ & STYLE_FLUSH || style_ & STYLE_FLUSH_CONTENT) ?
gfx::Insets() :
gfx::Insets(kTitleTopPadding,
kHorizontalPadding,
@@ -168,27 +168,49 @@ void BubbleFrameView::Layout() {
if (throbber_)
throbber_size = throbber_->GetPreferredSize();
+ // Need to center elements which are shorter.
+ int max_height = std::max(title_size.height(),
+ std::max(close_button_size.height(),
+ throbber_size.height()));
+
+ gfx::Insets title_insets = gfx::Insets();
+ // Need to insert title padding for STYLE_FLUSH_CONTENT.
+ if (style_ & STYLE_FLUSH_CONTENT)
+ title_insets = gfx::Insets(kTitleTopPadding,
+ kHorizontalPadding,
+ 0,
+ kHorizontalPadding);
+
if (title_) {
title_->SetBounds(
- insets.left(), insets.top(),
- std::max(0, width() - insets.width() - close_button_size.width()),
+ insets.left() + title_insets.left(),
+ insets.top() + title_insets.top() +
+ (max_height - title_size.height())/2, // Center.
+ std::max(0, width() - insets.width() - title_insets.width() -
+ close_button_size.width()),
title_size.height());
}
if (close_button_) {
close_button_->SetBounds(
- width() - insets.right() - close_button_size.width(), insets.top(),
- close_button_size.width(), close_button_size.height());
+ width() - insets.right() - title_insets.right() -
+ close_button_size.width(),
+ insets.top() + title_insets.top() +
+ (max_height - close_button_size.height())/2,
+ close_button_size.width(),
+ close_button_size.height());
}
if (throbber_) {
throbber_->SetBounds(
- insets.left(), insets.top(),
+ insets.left() + title_insets.left(),
+ insets.top() + title_insets.top() +
+ (max_height - throbber_size.height())/2,
std::min(throbber_size.width(), width()),
throbber_size.height());
}
- int top_height = insets.top();
+ int top_height = insets.top() + title_insets.top();
if (title_size.height() > 0 ||
close_button_size.height() > 0 ||
throbber_size.height() > 0) {
« no previous file with comments | « no previous file | chrome/browser/resources/certificate_viewer.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698