OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 // So return what the tabstrip height _ought_ to be right now. | 425 // So return what the tabstrip height _ought_ to be right now. |
426 return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0; | 426 return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0; |
427 } | 427 } |
428 | 428 |
429 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage( | 429 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage( |
430 const gfx::Point& point) const { | 430 const gfx::Point& point) const { |
431 // The background image starts tiling horizontally at the window left edge and | 431 // The background image starts tiling horizontally at the window left edge and |
432 // vertically at the top edge of the horizontal tab strip (or where it would | 432 // vertically at the top edge of the horizontal tab strip (or where it would |
433 // be). We expect our parent's origin to be the window origin. | 433 // be). We expect our parent's origin to be the window origin. |
434 gfx::Point window_point(point.Add(GetMirroredPosition())); | 434 gfx::Point window_point(point.Add(GetMirroredPosition())); |
435 window_point.Offset(0, -frame_->GetTabStripInsets(false).top); | 435 window_point.Offset(frame_->GetThemeBackgroundXInset(), |
| 436 -frame_->GetTabStripInsets(false).top); |
436 return window_point; | 437 return window_point; |
437 } | 438 } |
438 | 439 |
439 bool BrowserView::IsTabStripVisible() const { | 440 bool BrowserView::IsTabStripVisible() const { |
440 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); | 441 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); |
441 } | 442 } |
442 | 443 |
443 bool BrowserView::IsOffTheRecord() const { | 444 bool BrowserView::IsOffTheRecord() const { |
444 return browser_->profile()->IsOffTheRecord(); | 445 return browser_->profile()->IsOffTheRecord(); |
445 } | 446 } |
(...skipping 2156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2602 if (contents && contents->GetContentNativeView() && | 2603 if (contents && contents->GetContentNativeView() && |
2603 contents->GetContentNativeView()->HasFocus()) { | 2604 contents->GetContentNativeView()->HasFocus()) { |
2604 (contents->GetRenderViewHost()->*method)(); | 2605 (contents->GetRenderViewHost()->*method)(); |
2605 return true; | 2606 return true; |
2606 } | 2607 } |
2607 #elif defined(OS_WIN) | 2608 #elif defined(OS_WIN) |
2608 // TODO(yusukes): Support non-Aura Windows. | 2609 // TODO(yusukes): Support non-Aura Windows. |
2609 #endif | 2610 #endif |
2610 return false; | 2611 return false; |
2611 } | 2612 } |
OLD | NEW |