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

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: RenderText fixup 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 // of layout, when that hasn't yet been updated to reflect the current state. 452 // of layout, when that hasn't yet been updated to reflect the current state.
453 // So return what the tabstrip height _ought_ to be right now. 453 // So return what the tabstrip height _ought_ to be right now.
454 return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0; 454 return IsTabStripVisible() ? tabstrip_->GetPreferredSize().height() : 0;
455 } 455 }
456 456
457 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage( 457 gfx::Point BrowserView::OffsetPointForToolbarBackgroundImage(
458 const gfx::Point& point) const { 458 const gfx::Point& point) const {
459 // The background image starts tiling horizontally at the window left edge and 459 // The background image starts tiling horizontally at the window left edge and
460 // vertically at the top edge of the horizontal tab strip (or where it would 460 // vertically at the top edge of the horizontal tab strip (or where it would
461 // be). We expect our parent's origin to be the window origin. 461 // be). We expect our parent's origin to be the window origin.
462 gfx::Point window_point(point.Add(GetMirroredPosition())); 462 gfx::Point window_point(
463 point.Add(GetMirroredPosition().OffsetFromOrigin()));
463 window_point.Offset(frame_->GetThemeBackgroundXInset(), 464 window_point.Offset(frame_->GetThemeBackgroundXInset(),
464 -frame_->GetTabStripInsets(false).top); 465 -frame_->GetTabStripInsets(false).top);
465 return window_point; 466 return window_point;
466 } 467 }
467 468
468 bool BrowserView::IsTabStripVisible() const { 469 bool BrowserView::IsTabStripVisible() const {
469 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); 470 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP);
470 } 471 }
471 472
472 bool BrowserView::IsOffTheRecord() const { 473 bool BrowserView::IsOffTheRecord() const {
(...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after
2566 2567
2567 Browser* modal_browser = 2568 Browser* modal_browser =
2568 browser::FindBrowserWithWebContents(active_dialog->web_contents()); 2569 browser::FindBrowserWithWebContents(active_dialog->web_contents());
2569 if (modal_browser && (browser_ != modal_browser)) { 2570 if (modal_browser && (browser_ != modal_browser)) {
2570 modal_browser->window()->FlashFrame(true); 2571 modal_browser->window()->FlashFrame(true);
2571 modal_browser->window()->Activate(); 2572 modal_browser->window()->Activate();
2572 } 2573 }
2573 2574
2574 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2575 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2575 } 2576 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698