OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/first_run_bubble.h" | 5 #include "chrome/browser/gtk/first_run_bubble.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "app/gfx/gtk_util.h" | 9 #include "app/gfx/gtk_util.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // all of the extra space on the left. | 136 // all of the extra space on the left. |
137 gtk_box_pack_start(GTK_BOX(bottom), gtk_label_new(NULL), TRUE, TRUE, 0); | 137 gtk_box_pack_start(GTK_BOX(bottom), gtk_label_new(NULL), TRUE, TRUE, 0); |
138 gtk_box_pack_start(GTK_BOX(bottom), keep_button, FALSE, FALSE, | 138 gtk_box_pack_start(GTK_BOX(bottom), keep_button, FALSE, FALSE, |
139 kButtonPadding); | 139 kButtonPadding); |
140 gtk_box_pack_start(GTK_BOX(bottom), change_button, FALSE, FALSE, 0); | 140 gtk_box_pack_start(GTK_BOX(bottom), change_button, FALSE, FALSE, 0); |
141 | 141 |
142 gtk_box_pack_start(GTK_BOX(content_), bottom, FALSE, FALSE, 0); | 142 gtk_box_pack_start(GTK_BOX(content_), bottom, FALSE, FALSE, 0); |
143 // We want the focus to start on the keep entry, not on the change button. | 143 // We want the focus to start on the keep entry, not on the change button. |
144 gtk_widget_grab_focus(keep_button); | 144 gtk_widget_grab_focus(keep_button); |
145 | 145 |
| 146 InfoBubbleGtk::ArrowLocationGtk arrow_location = |
| 147 (l10n_util::GetTextDirection() == l10n_util::LEFT_TO_RIGHT) ? |
| 148 InfoBubbleGtk::ARROW_LOCATION_TOP_LEFT : |
| 149 InfoBubbleGtk::ARROW_LOCATION_TOP_RIGHT; |
146 bubble_ = InfoBubbleGtk::Show(parent_, | 150 bubble_ = InfoBubbleGtk::Show(parent_, |
147 rect, | 151 rect, |
148 content_, | 152 content_, |
| 153 arrow_location, |
149 theme_provider_, | 154 theme_provider_, |
150 this); // delegate | 155 this); // delegate |
151 if (!bubble_) { | 156 if (!bubble_) { |
152 NOTREACHED(); | 157 NOTREACHED(); |
153 return; | 158 return; |
154 } | 159 } |
155 | 160 |
156 g_signal_connect(content_, "destroy", | 161 g_signal_connect(content_, "destroy", |
157 G_CALLBACK(&HandleDestroyThunk), this); | 162 G_CALLBACK(&HandleDestroyThunk), this); |
158 g_signal_connect(keep_button, "clicked", | 163 g_signal_connect(keep_button, "clicked", |
(...skipping 13 matching lines...) Expand all Loading... |
172 } | 177 } |
173 | 178 |
174 void FirstRunBubble::HandleDestroy() { | 179 void FirstRunBubble::HandleDestroy() { |
175 content_ = NULL; | 180 content_ = NULL; |
176 delete this; | 181 delete this; |
177 } | 182 } |
178 | 183 |
179 void FirstRunBubble::HandleKeepButton() { | 184 void FirstRunBubble::HandleKeepButton() { |
180 bubble_->Close(); | 185 bubble_->Close(); |
181 } | 186 } |
OLD | NEW |