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

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: Removed DOMBrowserFrame* classes and added changes in line with oshima's comments 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
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1ec1c4ce48cd0a372a7709d936df0a67622b3763..9fd906d364b675ed382f4d8d01d468a06ea09923 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -201,6 +201,10 @@ gfx::Rect OpaqueBrowserFrameView::GetBoundsForReservedArea() const {
gfx::Rect OpaqueBrowserFrameView::GetBoundsForTabStrip(
views::View* tabstrip) const {
+ if (!tabstrip) {
+ return gfx::Rect();
+ }
+
if (browser_view_->UseVerticalTabs()) {
gfx::Size ps = tabstrip->GetPreferredSize();
return gfx::Rect(NonClientBorderThickness(),
@@ -215,9 +219,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 +393,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);
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698