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

Unified Diff: chrome/browser/ui/views/global_error_bubble_view.cc

Issue 10830366: Avoid overriding Bubble's GetAnchorRect() where possible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove a redundant DCHECK. Created 8 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/global_error_bubble_view.cc
diff --git a/chrome/browser/ui/views/global_error_bubble_view.cc b/chrome/browser/ui/views/global_error_bubble_view.cc
index 9316b41d0dce78c8169e2b1c6a59443928fa6f34..a226628ed0a76125c42345db00a81aa1a6aa7d45 100644
--- a/chrome/browser/ui/views/global_error_bubble_view.cc
+++ b/chrome/browser/ui/views/global_error_bubble_view.cc
@@ -65,7 +65,10 @@ GlobalErrorBubbleView::GlobalErrorBubbleView(
: BubbleDelegateView(anchor_view, location),
browser_(browser),
error_(error) {
- DCHECK(error_);
+ // Compensate for built-in vertical padding in the anchor view's image.
+ set_anchor_insets(
+ gfx::Insets(kAnchorVerticalInset, 0, kAnchorVerticalInset, 0));
+
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
int resource_id = error_->GetBubbleViewIconResourceID();
scoped_ptr<views::ImageView> image_view(new views::ImageView());
@@ -145,12 +148,6 @@ GlobalErrorBubbleView::GlobalErrorBubbleView(
GlobalErrorBubbleView::~GlobalErrorBubbleView() {
}
-gfx::Rect GlobalErrorBubbleView::GetAnchorRect() {
- gfx::Rect rect(views::BubbleDelegateView::GetAnchorRect());
- rect.Inset(0, anchor_view() ? kAnchorVerticalInset : 0);
- return rect;
-}
-
void GlobalErrorBubbleView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
if (error_) {
« no previous file with comments | « chrome/browser/ui/views/global_error_bubble_view.h ('k') | chrome/browser/ui/views/location_bar/zoom_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698