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

Side by Side Diff: chrome/browser/ui/views/info_bubble.cc

Issue 6462022: It turns out I had the sense of the GetLocalBounds bool wrong everywhere, so ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/info_bubble.h" 5 #include "chrome/browser/ui/views/info_bubble.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "chrome/browser/ui/window_sizer.h" 9 #include "chrome/browser/ui/window_sizer.h"
10 #include "chrome/common/notification_service.h" 10 #include "chrome/common/notification_service.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 void BorderContents::Paint(gfx::Canvas* canvas) { 106 void BorderContents::Paint(gfx::Canvas* canvas) {
107 // The border of this view creates an anti-aliased round-rect region for the 107 // The border of this view creates an anti-aliased round-rect region for the
108 // contents, which we need to fill with the background color. 108 // contents, which we need to fill with the background color.
109 // NOTE: This doesn't handle an arrow location of "NONE", which has square top 109 // NOTE: This doesn't handle an arrow location of "NONE", which has square top
110 // corners. 110 // corners.
111 SkPaint paint; 111 SkPaint paint;
112 paint.setAntiAlias(true); 112 paint.setAntiAlias(true);
113 paint.setStyle(SkPaint::kFill_Style); 113 paint.setStyle(SkPaint::kFill_Style);
114 paint.setColor(InfoBubble::kBackgroundColor); 114 paint.setColor(InfoBubble::kBackgroundColor);
115 gfx::Path path; 115 gfx::Path path;
116 gfx::Rect bounds(GetLocalBounds()); 116 gfx::Rect bounds(GetContentsBounds());
117 SkRect rect; 117 SkRect rect;
118 rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()), 118 rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()),
119 SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom())); 119 SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom()));
120 SkScalar radius = SkIntToScalar(BubbleBorder::GetCornerRadius()); 120 SkScalar radius = SkIntToScalar(BubbleBorder::GetCornerRadius());
121 path.addRoundRect(rect, radius, radius); 121 path.addRoundRect(rect, radius, radius);
122 canvas->AsCanvasSkia()->drawPath(path, paint); 122 canvas->AsCanvasSkia()->drawPath(path, paint);
123 123
124 // Now we paint the border, so it will be alpha-blended atop the contents. 124 // Now we paint the border, so it will be alpha-blended atop the contents.
125 // This looks slightly better in the corners than drawing the contents atop 125 // This looks slightly better in the corners than drawing the contents atop
126 // the border. 126 // the border.
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 animation_->Hide(); 558 animation_->Hide();
559 } 559 }
560 560
561 bool InfoBubble::AcceleratorPressed(const views::Accelerator& accelerator) { 561 bool InfoBubble::AcceleratorPressed(const views::Accelerator& accelerator) {
562 if (!delegate_ || delegate_->CloseOnEscape()) { 562 if (!delegate_ || delegate_->CloseOnEscape()) {
563 DoClose(true); 563 DoClose(true);
564 return true; 564 return true;
565 } 565 }
566 return false; 566 return false;
567 } 567 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698