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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 // of layout, when that hasn't yet been updated to reflect the current state. | 454 // of layout, when that hasn't yet been updated to reflect the current state. |
455 // So return what the tabstrip height _ought_ to be right now. | 455 // So return what the tabstrip height _ought_ to be right now. |
456 return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0; | 456 return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0; |
457 } | 457 } |
458 | 458 |
459 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage( | 459 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage( |
460 const gfx::Point& point) const { | 460 const gfx::Point& point) const { |
461 // The background image starts tiling horizontally at the window left edge and | 461 // The background image starts tiling horizontally at the window left edge and |
462 // vertically at the top edge of the horizontal tab strip (or where it would | 462 // vertically at the top edge of the horizontal tab strip (or where it would |
463 // be). We expect our parent's origin to be the window origin. | 463 // be). We expect our parent's origin to be the window origin. |
464 gfx::Point window_point(point.Add(GetMirroredPosition())); | 464 gfx::Point window_point( |
| 465 point.Add(GetMirroredPosition().DistanceFromOrigin())); |
465 window_point.Offset(frame_->GetThemeBackgroundXInset(), | 466 window_point.Offset(frame_->GetThemeBackgroundXInset(), |
466 -frame_->GetTabStripInsets(false).top); | 467 -frame_->GetTabStripInsets(false).top); |
467 return window_point; | 468 return window_point; |
468 } | 469 } |
469 | 470 |
470 bool BrowserView::IsTabStripVisible() const { | 471 bool BrowserView::IsTabStripVisible() const { |
471 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); | 472 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); |
472 } | 473 } |
473 | 474 |
474 bool BrowserView::IsOffTheRecord() const { | 475 bool BrowserView::IsOffTheRecord() const { |
(...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2630 | 2631 |
2631 Browser* modal_browser = | 2632 Browser* modal_browser = |
2632 browser::FindBrowserWithWebContents(active_dialog->web_contents()); | 2633 browser::FindBrowserWithWebContents(active_dialog->web_contents()); |
2633 if (modal_browser && (browser_ != modal_browser)) { | 2634 if (modal_browser && (browser_ != modal_browser)) { |
2634 modal_browser->window()->FlashFrame(true); | 2635 modal_browser->window()->FlashFrame(true); |
2635 modal_browser->window()->Activate(); | 2636 modal_browser->window()->Activate(); |
2636 } | 2637 } |
2637 | 2638 |
2638 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); | 2639 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); |
2639 } | 2640 } |
OLD | NEW |