| 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/chrome_canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/gfx/path.h" | 8 #include "app/gfx/path.h" |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "app/win_util.h" | 10 #include "app/win_util.h" |
| 11 #include "base/win_util.h" | 11 #include "base/win_util.h" |
| 12 #include "chrome/browser/browser_window.h" | 12 #include "chrome/browser/browser_window.h" |
| 13 #include "chrome/browser/views/frame/browser_view.h" | 13 #include "chrome/browser/views/frame/browser_view.h" |
| 14 #include "chrome/common/notification_service.h" | 14 #include "chrome/common/notification_service.h" |
| 15 #include "chrome/common/notification_type.h" | 15 #include "chrome/common/notification_type.h" |
| 16 #include "grit/theme_resources.h" | 16 #include "grit/theme_resources.h" |
| 17 #include "views/widget/root_view.h" | 17 #include "views/widget/root_view.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 // Bottom left corner. | 331 // Bottom left corner. |
| 332 mask.lineTo(corner_size, height - arrow_size); | 332 mask.lineTo(corner_size, height - arrow_size); |
| 333 mask.lineTo(0, height - corner_size - arrow_size); | 333 mask.lineTo(0, height - corner_size - arrow_size); |
| 334 } | 334 } |
| 335 | 335 |
| 336 mask.close(); | 336 mask.close(); |
| 337 | 337 |
| 338 return mask.CreateHRGN(); | 338 return mask.CreateHRGN(); |
| 339 } | 339 } |
| 340 | 340 |
| 341 void InfoBubble::ContentView::Paint(ChromeCanvas* canvas) { | 341 void InfoBubble::ContentView::Paint(gfx::Canvas* canvas) { |
| 342 int bubble_x = 0; | 342 int bubble_x = 0; |
| 343 int bubble_y = 0; | 343 int bubble_y = 0; |
| 344 int bubble_w = width(); | 344 int bubble_w = width(); |
| 345 int bubble_h = height() - kArrowSize; | 345 int bubble_h = height() - kArrowSize; |
| 346 | 346 |
| 347 int border_w = bubble_w - 2 * kInfoBubbleCornerWidth; | 347 int border_w = bubble_w - 2 * kInfoBubbleCornerWidth; |
| 348 int border_h = bubble_h - 2 * kInfoBubbleCornerHeight; | 348 int border_h = bubble_h - 2 * kInfoBubbleCornerHeight; |
| 349 | 349 |
| 350 if (IsTop()) | 350 if (IsTop()) |
| 351 bubble_y += kArrowSize; | 351 bubble_y += kArrowSize; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 x -= kArrowXOffset; | 427 x -= kArrowXOffset; |
| 428 else | 428 else |
| 429 x = x + kArrowXOffset - pref.width(); | 429 x = x + kArrowXOffset - pref.width(); |
| 430 if (IsTop()) { | 430 if (IsTop()) { |
| 431 y = position_relative_to.bottom() + kArrowToContentPadding; | 431 y = position_relative_to.bottom() + kArrowToContentPadding; |
| 432 } else { | 432 } else { |
| 433 y = position_relative_to.y() - kArrowToContentPadding - pref.height(); | 433 y = position_relative_to.y() - kArrowToContentPadding - pref.height(); |
| 434 } | 434 } |
| 435 return gfx::Rect(x, y, pref.width(), pref.height()); | 435 return gfx::Rect(x, y, pref.width(), pref.height()); |
| 436 } | 436 } |
| OLD | NEW |