| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/gtk/zoom_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/zoom_bubble_gtk.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 10 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // |auto_close|, the bubble can be reused and only the label text needs to | 41 // |auto_close|, the bubble can be reused and only the label text needs to |
| 42 // be updated. | 42 // be updated. |
| 43 if (g_bubble && | 43 if (g_bubble && |
| 44 g_bubble->auto_close_ == auto_close && | 44 g_bubble->auto_close_ == auto_close && |
| 45 g_bubble->bubble_->anchor_widget() == anchor) { | 45 g_bubble->bubble_->anchor_widget() == anchor) { |
| 46 g_bubble->Refresh(); | 46 g_bubble->Refresh(); |
| 47 } else { | 47 } else { |
| 48 // If the bubble is already showing but its |auto_close_| value is not equal | 48 // If the bubble is already showing but its |auto_close_| value is not equal |
| 49 // to |auto_close|, the bubble's focus properties must change, so the | 49 // to |auto_close|, the bubble's focus properties must change, so the |
| 50 // current bubble must be closed and a new one created. | 50 // current bubble must be closed and a new one created. |
| 51 if (g_bubble) | 51 Close(); |
| 52 g_bubble->Close(); | 52 DCHECK(!g_bubble); |
| 53 | 53 |
| 54 g_bubble = new ZoomBubbleGtk(anchor, tab_contents, auto_close); | 54 g_bubble = new ZoomBubbleGtk(anchor, tab_contents, auto_close); |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 // static | 58 // static |
| 59 void ZoomBubbleGtk::Close() { | 59 void ZoomBubbleGtk::Close() { |
| 60 if (g_bubble) | 60 if (g_bubble) |
| 61 g_bubble->CloseBubble(); | 61 g_bubble->CloseBubble(); |
| 62 } | 62 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 StopTimerIfNecessary(); | 198 StopTimerIfNecessary(); |
| 199 return FALSE; | 199 return FALSE; |
| 200 } | 200 } |
| 201 | 201 |
| 202 gboolean ZoomBubbleGtk::OnMouseLeave(GtkWidget* widget, | 202 gboolean ZoomBubbleGtk::OnMouseLeave(GtkWidget* widget, |
| 203 GdkEventCrossing* event) { | 203 GdkEventCrossing* event) { |
| 204 mouse_inside_ = false; | 204 mouse_inside_ = false; |
| 205 StartTimerIfNecessary(); | 205 StartTimerIfNecessary(); |
| 206 return FALSE; | 206 return FALSE; |
| 207 } | 207 } |
| OLD | NEW |