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

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

Issue 3056003: Attemp 2 at: (Closed)
Patch Set: Fix chromeos breakage Created 10 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
Index: chrome/browser/views/frame/browser_view_layout.cc
diff --git a/chrome/browser/views/frame/browser_view_layout.cc b/chrome/browser/views/frame/browser_view_layout.cc
index a332bebc17225fcf0ad2faeac03cae670a62e9b9..e7d807bbc73f068af4fa7012ffb6aa6399047751 100644
--- a/chrome/browser/views/frame/browser_view_layout.cc
+++ b/chrome/browser/views/frame/browser_view_layout.cc
@@ -32,8 +32,6 @@ const int kToolbarTabStripVerticalOverlap = 3;
// An offset distance between certain toolbars and the toolbar that preceded
// them in layout.
const int kSeparationLineHeight = 1;
-// Spacing between extension app icon and title.
-const int kExtensionAppIconTitleSpacing = 4;
} // namespace
@@ -41,9 +39,7 @@ const int kExtensionAppIconTitleSpacing = 4;
// BrowserViewLayout, public:
BrowserViewLayout::BrowserViewLayout()
- : extension_app_icon_(NULL),
- extension_app_title_(NULL),
- tabstrip_(NULL),
+ : tabstrip_(NULL),
toolbar_(NULL),
contents_split_(NULL),
contents_container_(NULL),
@@ -206,8 +202,6 @@ void BrowserViewLayout::Installed(views::View* host) {
extension_shelf_ = NULL;
active_bookmark_bar_ = NULL;
tabstrip_ = NULL;
- extension_app_icon_ = NULL;
- extension_app_title_ = NULL;
browser_view_ = static_cast<BrowserView*>(host);
}
@@ -237,12 +231,6 @@ void BrowserViewLayout::ViewAdded(views::View* host, views::View* view) {
case VIEW_ID_TAB_STRIP:
tabstrip_ = static_cast<BaseTabStrip*>(view);
break;
- case VIEW_ID_EXTENSION_APP_ICON:
- extension_app_icon_ = static_cast<views::ImageView*>(view);
- break;
- case VIEW_ID_EXTENSION_APP_TITLE:
- extension_app_title_ = static_cast<views::Label*>(view);
- break;
}
}
@@ -256,7 +244,6 @@ void BrowserViewLayout::ViewRemoved(views::View* host, views::View* view) {
void BrowserViewLayout::Layout(views::View* host) {
vertical_layout_rect_ = browser_view_->GetLocalBounds(true);
- LayoutExtensionAppIconAndTitle();
int top = LayoutTabStrip();
top = LayoutToolbar(top);
top = LayoutBookmarkAndInfoBars(top);
@@ -285,26 +272,6 @@ gfx::Size BrowserViewLayout::GetPreferredSize(views::View* host) {
//////////////////////////////////////////////////////////////////////////////
// BrowserViewLayout, private:
-void BrowserViewLayout::LayoutExtensionAppIconAndTitle() {
- if (browser_view_->browser()->type() != Browser::TYPE_EXTENSION_APP)
- return;
-
- extension_app_icon_->SetVisible(true);
- extension_app_icon_->SetBounds(0, 0, Extension::EXTENSION_ICON_SMALL,
- Extension::EXTENSION_ICON_SMALL);
-
- extension_app_title_->SetVisible(true);
-
- // Position the title vertically centered with the icon and slightly to its
- // right.
- extension_app_title_->SetX(
- extension_app_icon_->x() + extension_app_icon_->width() +
- kExtensionAppIconTitleSpacing);
- extension_app_title_->SetY(
- extension_app_icon_->y() +
- ((extension_app_icon_->height() - extension_app_title_->height()) / 2));
-}
-
int BrowserViewLayout::LayoutTabStrip() {
if (!browser_view_->IsTabStripVisible()) {
tabstrip_->SetVisible(false);
@@ -343,15 +310,8 @@ int BrowserViewLayout::LayoutToolbar(int top) {
y -= ((visible && browser_view_->IsTabStripVisible()) ?
kToolbarTabStripVerticalOverlap : 0);
}
-
- int height = 0;
- if (visible) {
- height = toolbar_->GetPreferredSize().height();
- toolbar_->SetVisible(true);
- } else {
- toolbar_->SetVisible(false);
- }
-
+ int height = visible ? toolbar_->GetPreferredSize().height() : 0;
+ toolbar_->SetVisible(visible);
toolbar_->SetBounds(vertical_layout_rect_.x(), y, browser_view_width, height);
return y + height;
}
« no previous file with comments | « chrome/browser/views/frame/browser_view_layout.h ('k') | chrome/browser/views/frame/opaque_browser_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698