Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/info_bubble.h" | 5 #include "chrome/browser/views/info_bubble.h" |
| 6 | 6 |
| 7 #include "base/win_util.h" | 7 #include "base/win_util.h" |
| 8 #include "chrome/browser/browser_window.h" | 8 #include "chrome/browser/browser_window.h" |
| 9 #include "chrome/browser/views/frame/browser_view.h" | 9 #include "chrome/browser/views/frame/browser_view.h" |
| 10 #include "chrome/common/gfx/chrome_canvas.h" | 10 #include "chrome/common/gfx/chrome_canvas.h" |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 353 kInfoBubbleCornerWidth, bubble_y, | 353 kInfoBubbleCornerWidth, bubble_y, |
| 354 border_w, bubble_h); | 354 border_w, bubble_h); |
| 355 // Right Column. | 355 // Right Column. |
| 356 canvas->FillRectInt(kBackgroundColor, | 356 canvas->FillRectInt(kBackgroundColor, |
| 357 bubble_w - kInfoBubbleCornerWidth, | 357 bubble_w - kInfoBubbleCornerWidth, |
| 358 bubble_y + kInfoBubbleCornerHeight, | 358 bubble_y + kInfoBubbleCornerHeight, |
| 359 kInfoBubbleCornerWidth, border_h); | 359 kInfoBubbleCornerWidth, border_h); |
| 360 | 360 |
| 361 // Draw the border. | 361 // Draw the border. |
| 362 // Top border. | 362 // Top border. |
| 363 canvas->DrawRectInt(kBorderColor1, | 363 canvas->DrawLineInt(kBorderColor1, |
| 364 kInfoBubbleCornerWidth, bubble_y, | 364 kInfoBubbleCornerWidth, bubble_y, |
| 365 border_w, | 365 kInfoBubbleCornerWidth + border_w, bubble_y); |
| 366 0); | |
| 367 // Bottom border. | 366 // Bottom border. |
| 368 canvas->DrawRectInt(kBorderColor1, | 367 canvas->DrawLineInt(kBorderColor1, |
| 369 kInfoBubbleCornerWidth, bubble_y + bubble_h - 1, | 368 kInfoBubbleCornerWidth, bubble_y + bubble_h - 1, |
| 370 border_w, 0); | 369 kInfoBubbleCornerWidth + border_w, |
| 370 bubble_y + bubble_h - 1); | |
| 371 // Left border. | 371 // Left border. |
| 372 canvas->DrawRectInt(kBorderColor1, | 372 canvas->DrawLineInt(kBorderColor1, |
| 373 bubble_x, bubble_y + kInfoBubbleCornerHeight, | 373 bubble_x, bubble_y + kInfoBubbleCornerHeight, |
| 374 0, border_h); | 374 bubble_x, bubble_y + kInfoBubbleCornerHeight + border_h); |
| 375 | 375 |
| 376 // Right border. | 376 // Right border. |
| 377 canvas->DrawRectInt(kBorderColor1, | 377 canvas->DrawLineInt(kBorderColor1, |
| 378 width() - 1, bubble_y + kInfoBubbleCornerHeight, | 378 width() - 1, bubble_y + kInfoBubbleCornerHeight, |
| 379 0, border_h); | 379 width() - 1, |
|
Dean McNamee
2009/04/15 08:33:51
couldn't you have just changed all of these 0s to
sky
2009/04/15 14:44:22
That resulted in at least a two pixel line. To me
| |
| 380 bubble_y + kInfoBubbleCornerHeight + border_h); | |
| 380 | 381 |
| 381 // Draw the corners. | 382 // Draw the corners. |
| 382 canvas->DrawBitmapInt(*kInfoBubbleCornerTopLeft, 0, bubble_y); | 383 canvas->DrawBitmapInt(*kInfoBubbleCornerTopLeft, 0, bubble_y); |
| 383 canvas->DrawBitmapInt(*kInfoBubbleCornerTopRight, | 384 canvas->DrawBitmapInt(*kInfoBubbleCornerTopRight, |
| 384 bubble_w - kInfoBubbleCornerWidth, bubble_y); | 385 bubble_w - kInfoBubbleCornerWidth, bubble_y); |
| 385 canvas->DrawBitmapInt(*kInfoBubbleCornerBottomLeft, 0, | 386 canvas->DrawBitmapInt(*kInfoBubbleCornerBottomLeft, 0, |
| 386 bubble_y + bubble_h - kInfoBubbleCornerHeight); | 387 bubble_y + bubble_h - kInfoBubbleCornerHeight); |
| 387 canvas->DrawBitmapInt(*kInfoBubbleCornerBottomRight, | 388 canvas->DrawBitmapInt(*kInfoBubbleCornerBottomRight, |
| 388 bubble_w - kInfoBubbleCornerWidth, | 389 bubble_w - kInfoBubbleCornerWidth, |
| 389 bubble_y + bubble_h - kInfoBubbleCornerHeight); | 390 bubble_y + bubble_h - kInfoBubbleCornerHeight); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 419 x -= kArrowXOffset; | 420 x -= kArrowXOffset; |
| 420 else | 421 else |
| 421 x = x + kArrowXOffset - pref.width(); | 422 x = x + kArrowXOffset - pref.width(); |
| 422 if (IsTop()) { | 423 if (IsTop()) { |
| 423 y = position_relative_to.bottom() + kArrowToContentPadding; | 424 y = position_relative_to.bottom() + kArrowToContentPadding; |
| 424 } else { | 425 } else { |
| 425 y = position_relative_to.y() - kArrowToContentPadding - pref.height(); | 426 y = position_relative_to.y() - kArrowToContentPadding - pref.height(); |
| 426 } | 427 } |
| 427 return gfx::Rect(x, y, pref.width(), pref.height()); | 428 return gfx::Rect(x, y, pref.width(), pref.height()); |
| 428 } | 429 } |
| OLD | NEW |