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

Side by Side Diff: chrome/browser/chromeos/frame/bubble_frame_view.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/chromeos/frame/bubble_frame_view.h" 5 #include "chrome/browser/chromeos/frame/bubble_frame_view.h"
6 6
7 #include "chrome/browser/chromeos/frame/bubble_window.h" 7 #include "chrome/browser/chromeos/frame/bubble_window.h"
8 #include "chrome/browser/chromeos/login/helper.h" 8 #include "chrome/browser/chromeos/login/helper.h"
9 #include "chrome/browser/ui/views/bubble_border.h" 9 #include "chrome/browser/ui/views/bubble_border.h"
10 #include "grit/theme_resources.h" 10 #include "grit/theme_resources.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 203 }
204 204
205 void BubbleFrameView::Paint(gfx::Canvas* canvas) { 205 void BubbleFrameView::Paint(gfx::Canvas* canvas) {
206 // The border of this view creates an anti-aliased round-rect region for the 206 // The border of this view creates an anti-aliased round-rect region for the
207 // contents, which we need to fill with the background color. 207 // contents, which we need to fill with the background color.
208 SkPaint paint; 208 SkPaint paint;
209 paint.setAntiAlias(true); 209 paint.setAntiAlias(true);
210 paint.setStyle(SkPaint::kFill_Style); 210 paint.setStyle(SkPaint::kFill_Style);
211 paint.setColor(BubbleWindow::kBackgroundColor); 211 paint.setColor(BubbleWindow::kBackgroundColor);
212 gfx::Path path; 212 gfx::Path path;
213 gfx::Rect bounds(GetLocalBounds()); 213 gfx::Rect bounds(GetContentsBounds());
214 SkRect rect; 214 SkRect rect;
215 rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()), 215 rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()),
216 SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom())); 216 SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom()));
217 SkScalar radius = SkIntToScalar(BubbleBorder::GetCornerRadius()); 217 SkScalar radius = SkIntToScalar(BubbleBorder::GetCornerRadius());
218 path.addRoundRect(rect, radius, radius); 218 path.addRoundRect(rect, radius, radius);
219 canvas->AsCanvasSkia()->drawPath(path, paint); 219 canvas->AsCanvasSkia()->drawPath(path, paint);
220 220
221 PaintBorder(canvas); 221 PaintBorder(canvas);
222 } 222 }
223 223
224 void BubbleFrameView::ButtonPressed(views::Button* sender, 224 void BubbleFrameView::ButtonPressed(views::Button* sender,
225 const views::Event& event) { 225 const views::Event& event) {
226 if (close_button_ != NULL && sender == close_button_) 226 if (close_button_ != NULL && sender == close_button_)
227 frame_->Close(); 227 frame_->Close();
228 } 228 }
229 229
230 } // namespace chromeos 230 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698