| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/fullscreen_exit_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 9 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" |
| 10 #include "chrome/browser/ui/gtk/gtk_util.h" | 10 #include "chrome/browser/ui/gtk/gtk_util.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 bool FullscreenExitBubbleGtk::WindowContainsPoint(gfx::Point pos) { | 183 bool FullscreenExitBubbleGtk::WindowContainsPoint(gfx::Point pos) { |
| 184 GtkWindow* window = GTK_WINDOW( | 184 GtkWindow* window = GTK_WINDOW( |
| 185 gtk_widget_get_ancestor(widget(), GTK_TYPE_WINDOW)); | 185 gtk_widget_get_ancestor(widget(), GTK_TYPE_WINDOW)); |
| 186 int width, height, x, y; | 186 int width, height, x, y; |
| 187 gtk_window_get_size(window, &width, &height); | 187 gtk_window_get_size(window, &width, &height); |
| 188 gtk_window_get_position(window, &x, &y); | 188 gtk_window_get_position(window, &x, &y); |
| 189 return gfx::Rect(x, y, width, height).Contains(pos); | 189 return gfx::Rect(x, y, width, height).Contains(pos); |
| 190 } | 190 } |
| 191 | 191 |
| 192 bool FullscreenExitBubbleGtk::IsWindowActive() { | 192 bool FullscreenExitBubbleGtk::IsWindowActive() { |
| 193 if (!widget()->parent) | 193 if (!gtk_widget_get_parent(widget())) |
| 194 return false; | 194 return false; |
| 195 GtkWindow* window = GTK_WINDOW( | 195 GtkWindow* window = GTK_WINDOW( |
| 196 gtk_widget_get_ancestor(widget(), GTK_TYPE_WINDOW)); | 196 gtk_widget_get_ancestor(widget(), GTK_TYPE_WINDOW)); |
| 197 return gtk_window_is_active(window); | 197 return gtk_window_is_active(window); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void FullscreenExitBubbleGtk::Hide() { | 200 void FullscreenExitBubbleGtk::Hide() { |
| 201 slide_widget_->Close(); | 201 slide_widget_->Close(); |
| 202 } | 202 } |
| 203 | 203 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 ToggleFullscreen(); | 237 ToggleFullscreen(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void FullscreenExitBubbleGtk::OnAllowClicked(GtkWidget* button) { | 240 void FullscreenExitBubbleGtk::OnAllowClicked(GtkWidget* button) { |
| 241 Accept(); | 241 Accept(); |
| 242 UpdateContent(url_, bubble_type_); | 242 UpdateContent(url_, bubble_type_); |
| 243 } | 243 } |
| 244 void FullscreenExitBubbleGtk::OnDenyClicked(GtkWidget* button) { | 244 void FullscreenExitBubbleGtk::OnDenyClicked(GtkWidget* button) { |
| 245 Cancel(); | 245 Cancel(); |
| 246 } | 246 } |
| OLD | NEW |