diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-09 02:32:42 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-09 02:32:42 +0000 |
commit | 0cde55895ade17764ae100c28e9bd7112458333b (patch) | |
tree | 29964641ee4514a93163b2a804207e5493052578 /chrome | |
parent | d5c409747ee1f24ee1eae50d4869922c38cf5a12 (diff) | |
download | chromium_src-0cde55895ade17764ae100c28e9bd7112458333b.zip chromium_src-0cde55895ade17764ae100c28e9bd7112458333b.tar.gz chromium_src-0cde55895ade17764ae100c28e9bd7112458333b.tar.bz2 |
It turns out I had the sense of the GetLocalBounds bool wrong everywhere, so invert everything.
This fixes the painting bugs in the omnibox and bookmark bar, and probably countless other glitches in rendering.
BUG=none
TEST=omnibox popup should render properly
TBR=sky
Review URL: http://codereview.chromium.org/6462022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
25 files changed, 31 insertions, 31 deletions
diff --git a/chrome/browser/automation/testing_automation_provider_views.cc b/chrome/browser/automation/testing_automation_provider_views.cc index 11ce53c..99b4065 100644 --- a/chrome/browser/automation/testing_automation_provider_views.cc +++ b/chrome/browser/automation/testing_automation_provider_views.cc @@ -131,7 +131,7 @@ void TestingAutomationProvider::WindowGetViewBounds(int handle, views::View::ConvertPointToScreen(view, &point); else views::View::ConvertPointToView(view, root_view, &point); - *bounds = view->GetLocalBounds(); + *bounds = view->GetContentsBounds(); bounds->set_origin(point); } } diff --git a/chrome/browser/chromeos/frame/bubble_frame_view.cc b/chrome/browser/chromeos/frame/bubble_frame_view.cc index 2af3b11..8dc0f7f 100644 --- a/chrome/browser/chromeos/frame/bubble_frame_view.cc +++ b/chrome/browser/chromeos/frame/bubble_frame_view.cc @@ -210,7 +210,7 @@ void BubbleFrameView::Paint(gfx::Canvas* canvas) { paint.setStyle(SkPaint::kFill_Style); paint.setColor(BubbleWindow::kBackgroundColor); gfx::Path path; - gfx::Rect bounds(GetLocalBounds()); + gfx::Rect bounds(GetContentsBounds()); SkRect rect; rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()), SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom())); diff --git a/chrome/browser/chromeos/login/eula_view.cc b/chrome/browser/chromeos/login/eula_view.cc index bdee1a8..31b2ffb 100644 --- a/chrome/browser/chromeos/login/eula_view.cc +++ b/chrome/browser/chromeos/login/eula_view.cc @@ -76,7 +76,7 @@ struct FillLayoutWithBorder : public views::LayoutManager { // Overridden from LayoutManager: virtual void Layout(views::View* host) { DCHECK(host->GetChildViewCount()); - host->GetChildViewAt(0)->SetBoundsRect(host->GetLocalBounds()); + host->GetChildViewAt(0)->SetBoundsRect(host->GetContentsBounds()); } virtual gfx::Size GetPreferredSize(views::View* host) { return gfx::Size(host->width(), host->height()); diff --git a/chrome/browser/chromeos/login/oobe_progress_bar.cc b/chrome/browser/chromeos/login/oobe_progress_bar.cc index 0e30267..1f0c482 100644 --- a/chrome/browser/chromeos/login/oobe_progress_bar.cc +++ b/chrome/browser/chromeos/login/oobe_progress_bar.cc @@ -53,7 +53,7 @@ void OobeProgressBar::InitClass() { } void OobeProgressBar::Paint(gfx::Canvas* canvas) { - gfx::Rect bounds = GetLocalBounds(); + gfx::Rect bounds = GetContentsBounds(); int x = bounds.x(); int y = bounds.y(); diff --git a/chrome/browser/chromeos/login/username_view.cc b/chrome/browser/chromeos/login/username_view.cc index a8f1fb4..fedf340 100644 --- a/chrome/browser/chromeos/login/username_view.cc +++ b/chrome/browser/chromeos/login/username_view.cc @@ -81,7 +81,7 @@ UsernameView::UsernameView(const std::wstring& username, bool use_small_shape) } void UsernameView::Paint(gfx::Canvas* canvas) { - gfx::Rect bounds = GetLocalBounds(); + gfx::Rect bounds = GetContentsBounds(); if (text_image_ == NULL) PaintUsername(bounds); DCHECK(text_image_ != NULL); diff --git a/chrome/browser/chromeos/login/web_page_view.cc b/chrome/browser/chromeos/login/web_page_view.cc index 3e16241..4bd0c0e 100644 --- a/chrome/browser/chromeos/login/web_page_view.cc +++ b/chrome/browser/chromeos/login/web_page_view.cc @@ -175,7 +175,7 @@ void WebPageView::ShowWaitingControls() { // WebPageView, views::View implementation: void WebPageView::Layout() { - dom_view()->SetBoundsRect(GetLocalBounds()); + dom_view()->SetBoundsRect(GetContentsBounds()); int y = height() / 2 - throbber_->GetPreferredSize().height() / 2; throbber_->SetBounds( width() / 2 - throbber_->GetPreferredSize().width() / 2, diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc index 807d050..7a04958 100644 --- a/chrome/browser/ui/views/about_chrome_view.cc +++ b/chrome/browser/ui/views/about_chrome_view.cc @@ -391,7 +391,7 @@ void AboutChromeView::Layout() { // Get the y-coordinate of our parent so we can position the text left of the // buttons at the bottom. - gfx::Rect parent_bounds = GetParent()->GetLocalBounds(); + gfx::Rect parent_bounds = GetParent()->GetContentsBounds(); sz = throbber_->GetPreferredSize(); int throbber_topleft_x = kPanelHorizMargin; diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc index 0934bbd..18a1566 100644 --- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc +++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc @@ -977,7 +977,7 @@ void AutocompletePopupContentsView::Paint(gfx::Canvas* canvas) { shader->unref(); gfx::Path path; - MakeContentsPath(&path, GetLocalBounds()); + MakeContentsPath(&path, GetContentsBounds()); canvas->AsCanvasSkia()->drawPath(path, paint); // Now we paint the border, so it will be alpha-blended atop the contents. @@ -990,7 +990,7 @@ void AutocompletePopupContentsView::Layout() { UpdateBlurRegion(); // Size our children to the available content area. - gfx::Rect contents_rect = GetLocalBounds(); + gfx::Rect contents_rect = GetContentsBounds(); int child_count = GetChildViewCount(); int top = contents_rect.y(); for (int i = 0; i < child_count; ++i) { @@ -1115,7 +1115,7 @@ void AutocompletePopupContentsView::UpdateBlurRegion() { // Translate the contents rect into widget coordinates, since that's what // DwmEnableBlurBehindWindow expects a region in. - gfx::Rect contents_rect = GetLocalBounds(); + gfx::Rect contents_rect = GetContentsBounds(); gfx::Point origin(contents_rect.origin()); views::View::ConvertPointToWidget(this, &origin); contents_rect.set_origin(origin); @@ -1174,7 +1174,7 @@ size_t AutocompletePopupContentsView::GetIndexForPoint( } gfx::Rect AutocompletePopupContentsView::CalculateTargetBounds(int h) { - gfx::Rect location_bar_bounds(location_bar_->GetLocalBounds()); + gfx::Rect location_bar_bounds(location_bar_->GetContentsBounds()); const views::Border* border = location_bar_->border(); if (border) { // Adjust for the border so that the bubble and location bar borders are diff --git a/chrome/browser/ui/views/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmark_editor_view.cc index 2fedf37..ba4c5a9 100644 --- a/chrome/browser/ui/views/bookmark_editor_view.cc +++ b/chrome/browser/ui/views/bookmark_editor_view.cc @@ -139,7 +139,7 @@ void BookmarkEditorView::Layout() { // Manually lay out the New Folder button in the same row as the OK/Cancel // buttons... - gfx::Rect parent_bounds = GetParent()->GetLocalBounds(); + gfx::Rect parent_bounds = GetParent()->GetContentsBounds(); gfx::Size prefsize = new_group_button_->GetPreferredSize(); int button_y = parent_bounds.bottom() - prefsize.height() - views::kButtonVEdgeMargin; diff --git a/chrome/browser/ui/views/bubble_border.cc b/chrome/browser/ui/views/bubble_border.cc index e5d7764..17c5933 100644 --- a/chrome/browser/ui/views/bubble_border.cc +++ b/chrome/browser/ui/views/bubble_border.cc @@ -433,7 +433,7 @@ void BubbleBackground::Paint(gfx::Canvas* canvas, views::View* view) const { paint.setStyle(SkPaint::kFill_Style); paint.setColor(border_->background_color()); gfx::Path path; - gfx::Rect bounds(view->GetLocalBounds()); + gfx::Rect bounds(view->GetContentsBounds()); SkRect rect; rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()), SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom())); diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc index 064b1cd..a998365 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.cc +++ b/chrome/browser/ui/views/create_application_shortcut_view.cc @@ -156,7 +156,7 @@ void AppInfoView::UpdateIcon(const SkBitmap& new_icon) { } void AppInfoView::Paint(gfx::Canvas* canvas) { - gfx::Rect bounds = GetContentsBounds(); + gfx::Rect bounds = GetLocalBounds(); SkRect border_rect = { SkIntToScalar(bounds.x()), diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc index c58e264..5a4405f 100644 --- a/chrome/browser/ui/views/frame/browser_view_layout.cc +++ b/chrome/browser/ui/views/frame/browser_view_layout.cc @@ -248,7 +248,7 @@ void BrowserViewLayout::ViewRemoved(views::View* host, views::View* view) { } void BrowserViewLayout::Layout(views::View* host) { - vertical_layout_rect_ = browser_view_->GetContentsBounds(); + vertical_layout_rect_ = browser_view_->GetLocalBounds(); int top = LayoutTabStrip(); if (browser_view_->IsTabStripVisible() && !browser_view_->UseVerticalTabs()) { tabstrip_->SetBackgroundOffset(gfx::Point( @@ -448,7 +448,7 @@ void BrowserViewLayout::LayoutTabContents(int top, int bottom) { !browser_view_->frame_->GetWindow()->IsFullscreen()) { gfx::Size resize_corner_size = browser_view_->GetResizeCornerSize(); if (!resize_corner_size.IsEmpty()) { - gfx::Rect bounds = browser_view_->GetLocalBounds(); + gfx::Rect bounds = browser_view_->GetContentsBounds(); gfx::Point resize_corner_origin( bounds.right() - resize_corner_size.width(), bounds.bottom() - resize_corner_size.height()); diff --git a/chrome/browser/ui/views/info_bubble.cc b/chrome/browser/ui/views/info_bubble.cc index 1e1bf04..32fe0c1 100644 --- a/chrome/browser/ui/views/info_bubble.cc +++ b/chrome/browser/ui/views/info_bubble.cc @@ -113,7 +113,7 @@ void BorderContents::Paint(gfx::Canvas* canvas) { paint.setStyle(SkPaint::kFill_Style); paint.setColor(InfoBubble::kBackgroundColor); gfx::Path path; - gfx::Rect bounds(GetLocalBounds()); + gfx::Rect bounds(GetContentsBounds()); SkRect rect; rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()), SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom())); diff --git a/chrome/browser/ui/views/list_background.h b/chrome/browser/ui/views/list_background.h index 6f7b1ce..233910d 100644 --- a/chrome/browser/ui/views/list_background.h +++ b/chrome/browser/ui/views/list_background.h @@ -24,7 +24,7 @@ class ListBackground : public views::Background { virtual void Paint(gfx::Canvas* canvas, views::View* view) const { HDC dc = canvas->BeginPlatformPaint(); - RECT native_lb = view->GetContentsBounds().ToRECT(); + RECT native_lb = view->GetLocalBounds().ToRECT(); gfx::NativeTheme::instance()->PaintListBackground(dc, true, &native_lb); canvas->EndPlatformPaint(); } diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index f8f7ca5..9597e22 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc @@ -651,7 +651,7 @@ void LocationBarView::Paint(gfx::Canvas* canvas) { // can draw the border images over the background color instead of the // reverse; this antialiases better (see comments in // AutocompletePopupContentsView::Paint()). - gfx::Rect bounds(GetLocalBounds()); + gfx::Rect bounds(GetContentsBounds()); bounds.Inset(0, kVerticalEdgeThickness); SkColor color(GetColor(ToolbarModel::NONE, BACKGROUND)); if (mode_ == NORMAL) { diff --git a/chrome/browser/ui/views/notifications/balloon_view.cc b/chrome/browser/ui/views/notifications/balloon_view.cc index d3b58ed..69859cb 100644 --- a/chrome/browser/ui/views/notifications/balloon_view.cc +++ b/chrome/browser/ui/views/notifications/balloon_view.cc @@ -476,7 +476,7 @@ void BalloonViewImpl::Paint(gfx::Canvas* canvas) { DCHECK(canvas); // Paint the menu bar area white, with proper rounded corners. gfx::Path path; - gfx::Rect rect = GetLocalBounds(); + gfx::Rect rect = GetContentsBounds(); rect.set_height(GetShelfHeight()); GetFrameMask(rect, &path); diff --git a/chrome/browser/ui/views/options/cookies_view.cc b/chrome/browser/ui/views/options/cookies_view.cc index 8454922..278e964 100644 --- a/chrome/browser/ui/views/options/cookies_view.cc +++ b/chrome/browser/ui/views/options/cookies_view.cc @@ -177,7 +177,7 @@ views::View* CookiesView::GetContentsView() { void CookiesView::Layout() { // Lay out the Remove/Remove All buttons in the parent view. gfx::Size ps = remove_button_->GetPreferredSize(); - gfx::Rect parent_bounds = GetParent()->GetLocalBounds(); + gfx::Rect parent_bounds = GetParent()->GetContentsBounds(); int y_buttons = parent_bounds.bottom() - ps.height() - views::kButtonVEdgeMargin; diff --git a/chrome/browser/ui/views/options/exceptions_view.cc b/chrome/browser/ui/views/options/exceptions_view.cc index e770a3d..54c9770 100644 --- a/chrome/browser/ui/views/options/exceptions_view.cc +++ b/chrome/browser/ui/views/options/exceptions_view.cc @@ -84,7 +84,7 @@ void ExceptionsView::Layout() { // The buttons are placed in the parent, but we need to lay them out. int max_y = - GetParent()->GetLocalBounds().bottom() - views::kButtonVEdgeMargin; + GetParent()->GetContentsBounds().bottom() - views::kButtonVEdgeMargin; int x = kPanelHorizMargin; for (size_t i = 0; i < arraysize(buttons); ++i) { diff --git a/chrome/browser/ui/views/options/simple_content_exceptions_view.cc b/chrome/browser/ui/views/options/simple_content_exceptions_view.cc index 68c0d3f..607bfde 100644 --- a/chrome/browser/ui/views/options/simple_content_exceptions_view.cc +++ b/chrome/browser/ui/views/options/simple_content_exceptions_view.cc @@ -70,7 +70,7 @@ void SimpleContentExceptionsView::Layout() { // The buttons are placed in the parent, but we need to lay them out. int max_y = - GetParent()->GetLocalBounds().bottom() - views::kButtonVEdgeMargin; + GetParent()->GetContentsBounds().bottom() - views::kButtonVEdgeMargin; int x = kPanelHorizMargin; for (size_t i = 0; i < arraysize(buttons); ++i) { diff --git a/chrome/browser/ui/views/status_bubble_views.cc b/chrome/browser/ui/views/status_bubble_views.cc index a0eb68d..022ea11 100644 --- a/chrome/browser/ui/views/status_bubble_views.cc +++ b/chrome/browser/ui/views/status_bubble_views.cc @@ -707,7 +707,7 @@ void StatusBubbleViews::AvoidMouse(const gfx::Point& location) { gfx::Point top_left; views::View::ConvertPointToScreen(base_view_, &top_left); // Border included. - int window_width = base_view_->GetContentsBounds().width(); + int window_width = base_view_->GetLocalBounds().width(); // Get the cursor position relative to the popup. gfx::Point relative_location = location; diff --git a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc index 58f10e1c..4a8f158 100644 --- a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc @@ -1268,7 +1268,7 @@ gfx::Point DraggedTabController::GetCursorScreenPoint() const { gfx::Rect DraggedTabController::GetViewScreenBounds(views::View* view) const { gfx::Point view_topleft; views::View::ConvertPointToScreen(view, &view_topleft); - gfx::Rect view_screen_bounds = view->GetContentsBounds(); + gfx::Rect view_screen_bounds = view->GetLocalBounds(); view_screen_bounds.Offset(view_topleft.x(), view_topleft.y()); return view_screen_bounds; } diff --git a/chrome/browser/ui/views/tabs/side_tab_strip.cc b/chrome/browser/ui/views/tabs/side_tab_strip.cc index b831cba..847d329 100644 --- a/chrome/browser/ui/views/tabs/side_tab_strip.cc +++ b/chrome/browser/ui/views/tabs/side_tab_strip.cc @@ -155,7 +155,7 @@ BaseTab* SideTabStrip::CreateTab() { } void SideTabStrip::GenerateIdealBounds() { - gfx::Rect layout_rect = GetLocalBounds(); + gfx::Rect layout_rect = GetContentsBounds(); layout_rect.Inset(kTabStripInset, kTabStripInset); int y = layout_rect.y(); diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc index 6805bf7..8230b89 100644 --- a/chrome/browser/ui/views/tabs/tab.cc +++ b/chrome/browser/ui/views/tabs/tab.cc @@ -212,7 +212,7 @@ void Tab::Paint(gfx::Canvas* canvas) { } void Tab::Layout() { - gfx::Rect lb = GetLocalBounds(); + gfx::Rect lb = GetContentsBounds(); if (lb.IsEmpty()) return; lb.Inset(kLeftPadding, kTopPadding, kRightPadding, kBottomPadding); diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc index 104dee4..1e2339a 100644 --- a/chrome/browser/ui/views/task_manager_view.cc +++ b/chrome/browser/ui/views/task_manager_view.cc @@ -518,7 +518,7 @@ void TaskManagerView::Layout() { height() - 2 * kPanelVertMargin - prefered_height); // y-coordinate of button top left. - gfx::Rect parent_bounds = GetParent()->GetLocalBounds(); + gfx::Rect parent_bounds = GetParent()->GetContentsBounds(); int y_buttons = parent_bounds.bottom() - prefered_height - views::kButtonVEdgeMargin; diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 6c5f61c..0f32820 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -3931,11 +3931,11 @@ '../google_update/google_update.gyp:google_update', '../third_party/iaccessible2/iaccessible2.gyp:iaccessible2', '../third_party/isimpledom/isimpledom.gyp:isimpledom', - '../views/views.gyp:views', + '../views/views.gyp:*', '../rlz/rlz.gyp:rlz_lib', ], 'export_dependent_settings': [ - '../views/views.gyp:views', + '../views/views.gyp:*', ], 'direct_dependent_settings': { 'link_settings': { @@ -3986,7 +3986,7 @@ 'conditions': [ ['OS=="linux" and toolkit_views==1',{ 'dependencies': [ - '../views/views.gyp:views', + '../views/views.gyp:*', ], 'include_dirs': [ '<(INTERMEDIATE_DIR)', |