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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 // of layout, when that hasn't yet been updated to reflect the current state. | 459 // of layout, when that hasn't yet been updated to reflect the current state. |
460 // So return what the tabstrip height _ought_ to be right now. | 460 // So return what the tabstrip height _ought_ to be right now. |
461 return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0; | 461 return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0; |
462 } | 462 } |
463 | 463 |
464 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage( | 464 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage( |
465 const gfx::Point& point) const { | 465 const gfx::Point& point) const { |
466 // The background image starts tiling horizontally at the window left edge and | 466 // The background image starts tiling horizontally at the window left edge and |
467 // vertically at the top edge of the horizontal tab strip (or where it would | 467 // vertically at the top edge of the horizontal tab strip (or where it would |
468 // be). We expect our parent's origin to be the window origin. | 468 // be). We expect our parent's origin to be the window origin. |
469 gfx::Point window_point(point.Add(GetMirroredPosition())); | 469 gfx::Point window_point( |
| 470 point.Add(GetMirroredPosition().OffsetFromOrigin())); |
470 window_point.Offset(frame_->GetThemeBackgroundXInset(), | 471 window_point.Offset(frame_->GetThemeBackgroundXInset(), |
471 -frame_->GetTabStripInsets(false).top); | 472 -frame_->GetTabStripInsets(false).top); |
472 return window_point; | 473 return window_point; |
473 } | 474 } |
474 | 475 |
475 bool BrowserView::IsTabStripVisible() const { | 476 bool BrowserView::IsTabStripVisible() const { |
476 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); | 477 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); |
477 } | 478 } |
478 | 479 |
479 bool BrowserView::IsOffTheRecord() const { | 480 bool BrowserView::IsOffTheRecord() const { |
(...skipping 2160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2640 | 2641 |
2641 Browser* modal_browser = | 2642 Browser* modal_browser = |
2642 browser::FindBrowserWithWebContents(active_dialog->web_contents()); | 2643 browser::FindBrowserWithWebContents(active_dialog->web_contents()); |
2643 if (modal_browser && (browser_ != modal_browser)) { | 2644 if (modal_browser && (browser_ != modal_browser)) { |
2644 modal_browser->window()->FlashFrame(true); | 2645 modal_browser->window()->FlashFrame(true); |
2645 modal_browser->window()->Activate(); | 2646 modal_browser->window()->Activate(); |
2646 } | 2647 } |
2647 | 2648 |
2648 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); | 2649 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); |
2649 } | 2650 } |
OLD | NEW |