| 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/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 212 |
| 213 void ZoomBubbleGtk::OnDestroy(GtkWidget* widget) { | 213 void ZoomBubbleGtk::OnDestroy(GtkWidget* widget) { |
| 214 // Listen to the destroy signal and delete this instance when it is caught. | 214 // Listen to the destroy signal and delete this instance when it is caught. |
| 215 delete this; | 215 delete this; |
| 216 } | 216 } |
| 217 | 217 |
| 218 void ZoomBubbleGtk::OnSetDefaultLinkClick(GtkWidget* widget) { | 218 void ZoomBubbleGtk::OnSetDefaultLinkClick(GtkWidget* widget) { |
| 219 double default_zoom_level = Profile::FromBrowserContext( | 219 double default_zoom_level = Profile::FromBrowserContext( |
| 220 web_contents_->GetBrowserContext())->GetPrefs()->GetDouble( | 220 web_contents_->GetBrowserContext())->GetPrefs()->GetDouble( |
| 221 prefs::kDefaultZoomLevel); | 221 prefs::kDefaultZoomLevel); |
| 222 web_contents_->GetRenderViewHost()->SetZoomLevel(default_zoom_level); | 222 web_contents_->SetZoomLevel(default_zoom_level); |
| 223 } | 223 } |
| 224 | 224 |
| 225 gboolean ZoomBubbleGtk::OnMouseEnter(GtkWidget* widget, | 225 gboolean ZoomBubbleGtk::OnMouseEnter(GtkWidget* widget, |
| 226 GdkEventCrossing* event) { | 226 GdkEventCrossing* event) { |
| 227 mouse_inside_ = true; | 227 mouse_inside_ = true; |
| 228 StopTimerIfNecessary(); | 228 StopTimerIfNecessary(); |
| 229 return FALSE; | 229 return FALSE; |
| 230 } | 230 } |
| 231 | 231 |
| 232 gboolean ZoomBubbleGtk::OnMouseLeave(GtkWidget* widget, | 232 gboolean ZoomBubbleGtk::OnMouseLeave(GtkWidget* widget, |
| 233 GdkEventCrossing* event) { | 233 GdkEventCrossing* event) { |
| 234 mouse_inside_ = false; | 234 mouse_inside_ = false; |
| 235 StartTimerIfNecessary(); | 235 StartTimerIfNecessary(); |
| 236 return FALSE; | 236 return FALSE; |
| 237 } | 237 } |
| 238 | 238 |
| 239 void ZoomBubbleGtk::Observe(int type, | 239 void ZoomBubbleGtk::Observe(int type, |
| 240 const content::NotificationSource& source, | 240 const content::NotificationSource& source, |
| 241 const content::NotificationDetails& details) { | 241 const content::NotificationDetails& details) { |
| 242 DCHECK_EQ(type, chrome::NOTIFICATION_FULLSCREEN_CHANGED); | 242 DCHECK_EQ(type, chrome::NOTIFICATION_FULLSCREEN_CHANGED); |
| 243 CloseBubble(); | 243 CloseBubble(); |
| 244 } | 244 } |
| OLD | NEW |