| 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 "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 7 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" |
| 8 #include "chrome/browser/ui/gtk/gtk_util.h" | 8 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 9 #include "chrome/browser/ui/gtk/rounded_window.h" | 9 #include "chrome/browser/ui/gtk/rounded_window.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| 11 #include "grit/ui_strings.h" | 11 #include "grit/ui_strings.h" |
| 12 #include "ui/base/gtk/gtk_floating_container.h" | 12 #include "ui/base/gtk/gtk_floating_container.h" |
| 13 #include "ui/base/gtk/gtk_hig_constants.h" | |
| 14 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
| 15 | 14 |
| 16 FullscreenExitBubbleGtk::FullscreenExitBubbleGtk( | 15 FullscreenExitBubbleGtk::FullscreenExitBubbleGtk( |
| 17 GtkFloatingContainer* container, | 16 GtkFloatingContainer* container, |
| 18 CommandUpdater::CommandUpdaterDelegate* delegate) | 17 CommandUpdater::CommandUpdaterDelegate* delegate) |
| 19 : FullscreenExitBubble(delegate), | 18 : FullscreenExitBubble(delegate), |
| 20 container_(container) { | 19 container_(container) { |
| 21 InitWidgets(); | 20 InitWidgets(); |
| 22 StartWatchingMouse(); | 21 StartWatchingMouse(); |
| 23 } | 22 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 37 exit_text_utf8.append(l10n_util::GetStringFUTF8( | 36 exit_text_utf8.append(l10n_util::GetStringFUTF8( |
| 38 IDS_EXIT_FULLSCREEN_MODE, l10n_util::GetStringUTF16(IDS_APP_F11_KEY))); | 37 IDS_EXIT_FULLSCREEN_MODE, l10n_util::GetStringUTF16(IDS_APP_F11_KEY))); |
| 39 exit_text_utf8.append("</span>"); | 38 exit_text_utf8.append("</span>"); |
| 40 GtkWidget* link = gtk_chrome_link_button_new_with_markup( | 39 GtkWidget* link = gtk_chrome_link_button_new_with_markup( |
| 41 exit_text_utf8.c_str()); | 40 exit_text_utf8.c_str()); |
| 42 gtk_chrome_link_button_set_use_gtk_theme(GTK_CHROME_LINK_BUTTON(link), | 41 gtk_chrome_link_button_set_use_gtk_theme(GTK_CHROME_LINK_BUTTON(link), |
| 43 FALSE); | 42 FALSE); |
| 44 signals_.Connect(link, "clicked", G_CALLBACK(OnLinkClickedThunk), this); | 43 signals_.Connect(link, "clicked", G_CALLBACK(OnLinkClickedThunk), this); |
| 45 | 44 |
| 46 link_container_.Own(gtk_util::CreateGtkBorderBin( | 45 link_container_.Own(gtk_util::CreateGtkBorderBin( |
| 47 link, &ui::kGdkBlack, | 46 link, >k_util::kGdkBlack, |
| 48 kPaddingPx, kPaddingPx, kPaddingPx, kPaddingPx)); | 47 kPaddingPx, kPaddingPx, kPaddingPx, kPaddingPx)); |
| 49 gtk_util::ActAsRoundedWindow(link_container_.get(), ui::kGdkGreen, | 48 gtk_util::ActAsRoundedWindow(link_container_.get(), gtk_util::kGdkGreen, |
| 50 kPaddingPx, | 49 kPaddingPx, |
| 51 gtk_util::ROUNDED_BOTTOM_LEFT | gtk_util::ROUNDED_BOTTOM_RIGHT, | 50 gtk_util::ROUNDED_BOTTOM_LEFT | gtk_util::ROUNDED_BOTTOM_RIGHT, |
| 52 gtk_util::BORDER_NONE); | 51 gtk_util::BORDER_NONE); |
| 53 | 52 |
| 54 slide_widget_.reset(new SlideAnimatorGtk(link_container_.get(), | 53 slide_widget_.reset(new SlideAnimatorGtk(link_container_.get(), |
| 55 SlideAnimatorGtk::DOWN, kSlideOutDurationMs, false, false, NULL)); | 54 SlideAnimatorGtk::DOWN, kSlideOutDurationMs, false, false, NULL)); |
| 56 gtk_widget_set_name(widget(), "exit-fullscreen-bubble"); | 55 gtk_widget_set_name(widget(), "exit-fullscreen-bubble"); |
| 57 gtk_widget_show_all(link_container_.get()); | 56 gtk_widget_show_all(link_container_.get()); |
| 58 gtk_widget_show(widget()); | 57 gtk_widget_show(widget()); |
| 59 slide_widget_->OpenWithoutAnimation(); | 58 slide_widget_->OpenWithoutAnimation(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 130 |
| 132 g_value_set_int(&value, 0); | 131 g_value_set_int(&value, 0); |
| 133 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 132 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
| 134 widget(), "y", &value); | 133 widget(), "y", &value); |
| 135 g_value_unset(&value); | 134 g_value_unset(&value); |
| 136 } | 135 } |
| 137 | 136 |
| 138 void FullscreenExitBubbleGtk::OnLinkClicked(GtkWidget* link) { | 137 void FullscreenExitBubbleGtk::OnLinkClicked(GtkWidget* link) { |
| 139 ToggleFullscreen(); | 138 ToggleFullscreen(); |
| 140 } | 139 } |
| OLD | NEW |