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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more vector use fixes Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 // of layout, when that hasn't yet been updated to reflect the current state. 457 // of layout, when that hasn't yet been updated to reflect the current state.
458 // So return what the tabstrip height _ought_ to be right now. 458 // So return what the tabstrip height _ought_ to be right now.
459 return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0; 459 return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0;
460 } 460 }
461 461
462 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage( 462 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage(
463 const gfx::Point& point) const { 463 const gfx::Point& point) const {
464 // The background image starts tiling horizontally at the window left edge and 464 // The background image starts tiling horizontally at the window left edge and
465 // vertically at the top edge of the horizontal tab strip (or where it would 465 // vertically at the top edge of the horizontal tab strip (or where it would
466 // be). We expect our parent's origin to be the window origin. 466 // be). We expect our parent's origin to be the window origin.
467 gfx::Point window_point(point.Add(GetMirroredPosition())); 467 gfx::Point window_point(
468 point.Add(GetMirroredPosition().OffsetFromOrigin()));
468 window_point.Offset(frame_->GetThemeBackgroundXInset(), 469 window_point.Offset(frame_->GetThemeBackgroundXInset(),
469 -frame_->GetTabStripInsets(false).top); 470 -frame_->GetTabStripInsets(false).top);
470 return window_point; 471 return window_point;
471 } 472 }
472 473
473 bool BrowserView::IsTabStripVisible() const { 474 bool BrowserView::IsTabStripVisible() const {
474 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); 475 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP);
475 } 476 }
476 477
477 bool BrowserView::IsOffTheRecord() const { 478 bool BrowserView::IsOffTheRecord() const {
(...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after
2618 2619
2619 Browser* modal_browser = 2620 Browser* modal_browser =
2620 browser::FindBrowserWithWebContents(active_dialog->web_contents()); 2621 browser::FindBrowserWithWebContents(active_dialog->web_contents());
2621 if (modal_browser && (browser_ != modal_browser)) { 2622 if (modal_browser && (browser_ != modal_browser)) {
2622 modal_browser->window()->FlashFrame(true); 2623 modal_browser->window()->FlashFrame(true);
2623 modal_browser->window()->Activate(); 2624 modal_browser->window()->Activate();
2624 } 2625 }
2625 2626
2626 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2627 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2627 } 2628 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698