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

Unified Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc

Issue 6692001: Add in DOMBrowserView and Frame related classes (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated CL in response to comments by oshima and rjkroege Created 9 years, 9 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/ui/views/frame/opaque_browser_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
index b89ce632c211dc851969df1299b4e207fabfb750..5a92bb73be1a077b3500ae624347d171d5d18444 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -215,9 +215,11 @@ gfx::Rect OpaqueBrowserFrameView::GetBoundsForTabStrip(
int tabstrip_width = minimize_button_->x() - tabstrip_x -
(frame_->GetWindow()->IsMaximized() ?
kNewTabCaptionMaximizedSpacing : kNewTabCaptionRestoredSpacing);
+ int tabstrip_height = 0;
+ if (tabstrip)
+ tabstrip_height = tabstrip->GetPreferredSize().height();
return gfx::Rect(tabstrip_x, GetHorizontalTabStripVerticalOffset(false),
- std::max(0, tabstrip_width),
- tabstrip->GetPreferredSize().height());
+ std::max(0, tabstrip_width), tabstrip_height);
}
int OpaqueBrowserFrameView::GetHorizontalTabStripVerticalOffset(
@@ -387,7 +389,7 @@ bool OpaqueBrowserFrameView::HitTest(const gfx::Point& l) const {
// Otherwise claim it only if it's in a non-tab portion of the tabstrip.
bool vertical_tabs = browser_view_->UseVerticalTabs();
- gfx::Rect tabstrip_bounds = browser_view_->tabstrip()->bounds();
+ gfx::Rect tabstrip_bounds = GetBoundsForTabStrip(browser_view_->tabstrip());
gfx::Point tabstrip_origin(tabstrip_bounds.origin());
View::ConvertPointToView(frame_->GetWindow()->client_view(),
this, &tabstrip_origin);
@@ -447,6 +449,28 @@ SkBitmap OpaqueBrowserFrameView::GetFavIconForTabIconView() {
}
///////////////////////////////////////////////////////////////////////////////
+// OpaqueBrowserFrameView, protected:
+
+void OpaqueBrowserFrameView::LayoutOTRAvatar() {
+ SkBitmap otr_avatar_icon = browser_view_->GetOTRAvatarIcon();
+ int otr_bottom, otr_restored_y;
+ if (browser_view_->UseVerticalTabs()) {
+ otr_bottom = NonClientTopBorderHeight(false, false) - kOTRBottomSpacing;
+ otr_restored_y = kFrameShadowThickness;
+ } else {
+ otr_bottom = GetHorizontalTabStripVerticalOffset(false) +
+ browser_view_->GetTabStripHeight() - kOTRBottomSpacing;
+ otr_restored_y = otr_bottom - otr_avatar_icon.height();
+ }
+ int otr_y = frame_->GetWindow()->IsMaximized() ?
+ (NonClientTopBorderHeight(false, true) + kTabstripTopShadowThickness) :
+ otr_restored_y;
+ otr_avatar_bounds_.SetRect(NonClientBorderThickness() + kOTRSideSpacing,
+ otr_y, otr_avatar_icon.width(),
+ browser_view_->ShouldShowOffTheRecordAvatar() ? (otr_bottom - otr_y) : 0);
+}
+
+///////////////////////////////////////////////////////////////////////////////
// OpaqueBrowserFrameView, private:
int OpaqueBrowserFrameView::FrameBorderThickness(bool restored) const {
@@ -1046,25 +1070,6 @@ void OpaqueBrowserFrameView::LayoutTitleBar() {
}
}
-void OpaqueBrowserFrameView::LayoutOTRAvatar() {
- SkBitmap otr_avatar_icon = browser_view_->GetOTRAvatarIcon();
- int otr_bottom, otr_restored_y;
- if (browser_view_->UseVerticalTabs()) {
- otr_bottom = NonClientTopBorderHeight(false, false) - kOTRBottomSpacing;
- otr_restored_y = kFrameShadowThickness;
- } else {
- otr_bottom = GetHorizontalTabStripVerticalOffset(false) +
- browser_view_->GetTabStripHeight() - kOTRBottomSpacing;
- otr_restored_y = otr_bottom - otr_avatar_icon.height();
- }
- int otr_y = frame_->GetWindow()->IsMaximized() ?
- (NonClientTopBorderHeight(false, true) + kTabstripTopShadowThickness) :
- otr_restored_y;
- otr_avatar_bounds_.SetRect(NonClientBorderThickness() + kOTRSideSpacing,
- otr_y, otr_avatar_icon.width(),
- browser_view_->ShouldShowOffTheRecordAvatar() ? (otr_bottom - otr_y) : 0);
-}
-
gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width,
int height) const {
int top_height = NonClientTopBorderHeight(false, false);

Powered by Google App Engine
This is Rietveld 408576698