| 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 "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/gfx/color_utils.h" |
| 8 #include "app/gfx/path.h" | 9 #include "app/gfx/path.h" |
| 9 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| 10 #include "chrome/browser/browser_window.h" | 11 #include "chrome/browser/browser_window.h" |
| 11 #include "chrome/browser/views/frame/browser_view.h" | 12 #include "chrome/browser/views/frame/browser_view.h" |
| 12 #include "chrome/browser/window_sizer.h" | 13 #include "chrome/browser/window_sizer.h" |
| 13 #include "chrome/common/notification_service.h" | 14 #include "chrome/common/notification_service.h" |
| 14 #include "chrome/common/notification_type.h" | 15 #include "chrome/common/notification_type.h" |
| 15 #include "grit/theme_resources.h" | 16 #include "grit/theme_resources.h" |
| 16 #include "views/widget/root_view.h" | 17 #include "views/widget/root_view.h" |
| 17 #include "views/window/window.h" | 18 #include "views/window/window.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 31 static const int kArrowSize = 5; | 32 static const int kArrowSize = 5; |
| 32 | 33 |
| 33 // Number of pixels to the start of the arrow from the edge of the window. | 34 // Number of pixels to the start of the arrow from the edge of the window. |
| 34 static const int kArrowXOffset = 13; | 35 static const int kArrowXOffset = 13; |
| 35 | 36 |
| 36 // Number of pixels between the tip of the arrow and the region we're | 37 // Number of pixels between the tip of the arrow and the region we're |
| 37 // pointing to. | 38 // pointing to. |
| 38 static const int kArrowToContentPadding = -4; | 39 static const int kArrowToContentPadding = -4; |
| 39 | 40 |
| 40 // Background color of the bubble. | 41 // Background color of the bubble. |
| 42 #if defined(OS_WIN) |
| 43 static const SkColor kBackgroundColor = |
| 44 color_utils::GetSysSkColor(COLOR_WINDOW); |
| 45 #else |
| 46 // TODO(beng): source from theme provider. |
| 41 static const SkColor kBackgroundColor = SK_ColorWHITE; | 47 static const SkColor kBackgroundColor = SK_ColorWHITE; |
| 48 #endif |
| 42 | 49 |
| 43 // Color of the border and arrow. | 50 // Color of the border and arrow. |
| 44 static const SkColor kBorderColor1 = SkColorSetRGB(99, 99, 99); | 51 static const SkColor kBorderColor1 = SkColorSetRGB(99, 99, 99); |
| 45 // Border shadow color. | 52 // Border shadow color. |
| 46 static const SkColor kBorderColor2 = SkColorSetRGB(160, 160, 160); | 53 static const SkColor kBorderColor2 = SkColorSetRGB(160, 160, 160); |
| 47 | 54 |
| 48 // Intended dimensions of the bubble's corner images. If you update these, | 55 // Intended dimensions of the bubble's corner images. If you update these, |
| 49 // make sure that the OnSize code works. | 56 // make sure that the OnSize code works. |
| 50 static const int kInfoBubbleCornerWidth = 3; | 57 static const int kInfoBubbleCornerWidth = 3; |
| 51 static const int kInfoBubbleCornerHeight = 3; | 58 static const int kInfoBubbleCornerHeight = 3; |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 x -= kArrowXOffset; | 473 x -= kArrowXOffset; |
| 467 else | 474 else |
| 468 x = x + kArrowXOffset - pref.width(); | 475 x = x + kArrowXOffset - pref.width(); |
| 469 if (IsTop()) { | 476 if (IsTop()) { |
| 470 y = position_relative_to.bottom() + kArrowToContentPadding; | 477 y = position_relative_to.bottom() + kArrowToContentPadding; |
| 471 } else { | 478 } else { |
| 472 y = position_relative_to.y() - kArrowToContentPadding - pref.height(); | 479 y = position_relative_to.y() - kArrowToContentPadding - pref.height(); |
| 473 } | 480 } |
| 474 return gfx::Rect(x, y, pref.width(), pref.height()); | 481 return gfx::Rect(x, y, pref.width(), pref.height()); |
| 475 } | 482 } |
| OLD | NEW |