OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 DetachableToolbarView::CalculateContentArea(current_state, h_padding, | 213 DetachableToolbarView::CalculateContentArea(current_state, h_padding, |
214 v_padding, &rect, &roundness, host_view_); | 214 v_padding, &rect, &roundness, host_view_); |
215 DetachableToolbarView::PaintContentAreaBackground(canvas, tp, rect, | 215 DetachableToolbarView::PaintContentAreaBackground(canvas, tp, rect, |
216 roundness); | 216 roundness); |
217 DetachableToolbarView::PaintContentAreaBorder(canvas, tp, rect, roundness); | 217 DetachableToolbarView::PaintContentAreaBorder(canvas, tp, rect, roundness); |
218 if (!toolbar_overlap) | 218 if (!toolbar_overlap) |
219 DetachableToolbarView::PaintHorizontalBorder(canvas, host_view_); | 219 DetachableToolbarView::PaintHorizontalBorder(canvas, host_view_); |
220 } else { | 220 } else { |
221 DetachableToolbarView::PaintBackgroundAttachedMode(canvas, host_view_, | 221 DetachableToolbarView::PaintBackgroundAttachedMode(canvas, host_view_, |
222 browser_view_->OffsetPointForToolbarBackgroundImage( | 222 browser_view_->OffsetPointForToolbarBackgroundImage( |
223 gfx::Point(host_view_->MirroredX(), host_view_->y()))); | 223 gfx::Point(host_view_->GetMirroredX(), host_view_->y()))); |
224 if (host_view_->height() >= toolbar_overlap) | 224 if (host_view_->height() >= toolbar_overlap) |
225 DetachableToolbarView::PaintHorizontalBorder(canvas, host_view_); | 225 DetachableToolbarView::PaintHorizontalBorder(canvas, host_view_); |
226 } | 226 } |
227 } | 227 } |
228 | 228 |
229 /////////////////////////////////////////////////////////////////////////////// | 229 /////////////////////////////////////////////////////////////////////////////// |
230 // ResizeCorner, private: | 230 // ResizeCorner, private: |
231 | 231 |
232 class ResizeCorner : public views::View { | 232 class ResizeCorner : public views::View { |
233 public: | 233 public: |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 // of layout, when that hasn't yet been updated to reflect the current state. | 575 // of layout, when that hasn't yet been updated to reflect the current state. |
576 // So return what the tabstrip height _ought_ to be right now. | 576 // So return what the tabstrip height _ought_ to be right now. |
577 return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0; | 577 return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0; |
578 } | 578 } |
579 | 579 |
580 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage( | 580 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage( |
581 const gfx::Point& point) const { | 581 const gfx::Point& point) const { |
582 // The background image starts tiling horizontally at the window left edge and | 582 // The background image starts tiling horizontally at the window left edge and |
583 // vertically at the top edge of the horizontal tab strip (or where it would | 583 // vertically at the top edge of the horizontal tab strip (or where it would |
584 // be). We expect our parent's origin to be the window origin. | 584 // be). We expect our parent's origin to be the window origin. |
585 gfx::Point window_point(point.Add(gfx::Point(MirroredX(), y()))); | 585 gfx::Point window_point(point.Add(GetMirroredPosition())); |
586 window_point.Offset(0, -frame_->GetHorizontalTabStripVerticalOffset(false)); | 586 window_point.Offset(0, -frame_->GetHorizontalTabStripVerticalOffset(false)); |
587 return window_point; | 587 return window_point; |
588 } | 588 } |
589 | 589 |
590 int BrowserView::GetSidebarWidth() const { | 590 int BrowserView::GetSidebarWidth() const { |
591 if (!sidebar_container_ || !sidebar_container_->IsVisible()) | 591 if (!sidebar_container_ || !sidebar_container_->IsVisible()) |
592 return 0; | 592 return 0; |
593 return sidebar_split_->divider_offset(); | 593 return sidebar_split_->divider_offset(); |
594 } | 594 } |
595 | 595 |
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2561 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 2561 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
2562 | 2562 |
2563 return view; | 2563 return view; |
2564 } | 2564 } |
2565 #endif | 2565 #endif |
2566 | 2566 |
2567 // static | 2567 // static |
2568 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { | 2568 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { |
2569 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); | 2569 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); |
2570 } | 2570 } |
OLD | NEW |