| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/info_bubble_gtk.h" | 5 #include "chrome/browser/gtk/info_bubble_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "app/gfx/path.h" |
| 9 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 10 #include "base/gfx/gtk_util.h" | 11 #include "base/gfx/gtk_util.h" |
| 11 #include "base/gfx/rect.h" | 12 #include "base/gfx/rect.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "chrome/common/gfx/path.h" | |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 // The height of the arrow, and the width will be about twice the height. | 17 // The height of the arrow, and the width will be about twice the height. |
| 18 const int kArrowSize = 5; | 18 const int kArrowSize = 5; |
| 19 // Number of pixels to the start of the arrow from the edge of the window. | 19 // Number of pixels to the start of the arrow from the edge of the window. |
| 20 const int kArrowX = 13; | 20 const int kArrowX = 13; |
| 21 // Number of pixels between the tip of the arrow and the region we're | 21 // Number of pixels between the tip of the arrow and the region we're |
| 22 // pointing to. | 22 // pointing to. |
| 23 const int kArrowToContentPadding = -6; | 23 const int kArrowToContentPadding = -6; |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 199 |
| 200 gboolean InfoBubbleGtk::HandleButtonPress(GdkEventButton* event) { | 200 gboolean InfoBubbleGtk::HandleButtonPress(GdkEventButton* event) { |
| 201 // If we got a click in our own window, that's ok. | 201 // If we got a click in our own window, that's ok. |
| 202 if (event->window == window_->window) | 202 if (event->window == window_->window) |
| 203 return FALSE; // Propagate. | 203 return FALSE; // Propagate. |
| 204 | 204 |
| 205 // Otherwise we had a click outside of our window, close ourself. | 205 // Otherwise we had a click outside of our window, close ourself. |
| 206 Close(); | 206 Close(); |
| 207 return TRUE; | 207 return TRUE; |
| 208 } | 208 } |
| OLD | NEW |