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