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/gtk_util.h" | 9 #include "app/gtk_util.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| 11 #include "base/i18n/rtl.h" |
11 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/gtk/gtk_theme_provider.h" | 13 #include "chrome/browser/gtk/gtk_theme_provider.h" |
13 #include "chrome/browser/options_window.h" | 14 #include "chrome/browser/options_window.h" |
14 #include "chrome/browser/search_engines/template_url_model.h" | 15 #include "chrome/browser/search_engines/template_url_model.h" |
15 #include "chrome/common/notification_service.h" | 16 #include "chrome/common/notification_service.h" |
16 #include "gfx/gtk_util.h" | 17 #include "gfx/gtk_util.h" |
17 #include "grit/chromium_strings.h" | 18 #include "grit/chromium_strings.h" |
18 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
19 #include "grit/locale_settings.h" | 20 #include "grit/locale_settings.h" |
20 | 21 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 gtk_box_pack_start(GTK_BOX(bottom), gtk_label_new(NULL), TRUE, TRUE, 0); | 142 gtk_box_pack_start(GTK_BOX(bottom), gtk_label_new(NULL), TRUE, TRUE, 0); |
142 gtk_box_pack_start(GTK_BOX(bottom), keep_button, FALSE, FALSE, | 143 gtk_box_pack_start(GTK_BOX(bottom), keep_button, FALSE, FALSE, |
143 kButtonPadding); | 144 kButtonPadding); |
144 gtk_box_pack_start(GTK_BOX(bottom), change_button, FALSE, FALSE, 0); | 145 gtk_box_pack_start(GTK_BOX(bottom), change_button, FALSE, FALSE, 0); |
145 | 146 |
146 gtk_box_pack_start(GTK_BOX(content_), bottom, FALSE, FALSE, 0); | 147 gtk_box_pack_start(GTK_BOX(content_), bottom, FALSE, FALSE, 0); |
147 // We want the focus to start on the keep entry, not on the change button. | 148 // We want the focus to start on the keep entry, not on the change button. |
148 gtk_widget_grab_focus(keep_button); | 149 gtk_widget_grab_focus(keep_button); |
149 | 150 |
150 InfoBubbleGtk::ArrowLocationGtk arrow_location = | 151 InfoBubbleGtk::ArrowLocationGtk arrow_location = |
151 (l10n_util::GetTextDirection() == l10n_util::LEFT_TO_RIGHT) ? | 152 !base::i18n::IsRTL() ? |
152 InfoBubbleGtk::ARROW_LOCATION_TOP_LEFT : | 153 InfoBubbleGtk::ARROW_LOCATION_TOP_LEFT : |
153 InfoBubbleGtk::ARROW_LOCATION_TOP_RIGHT; | 154 InfoBubbleGtk::ARROW_LOCATION_TOP_RIGHT; |
154 bubble_ = InfoBubbleGtk::Show(parent_, | 155 bubble_ = InfoBubbleGtk::Show(parent_, |
155 rect, | 156 rect, |
156 content_, | 157 content_, |
157 arrow_location, | 158 arrow_location, |
158 true, | 159 true, |
159 theme_provider_, | 160 theme_provider_, |
160 this); // delegate | 161 this); // delegate |
161 if (!bubble_) { | 162 if (!bubble_) { |
(...skipping 20 matching lines...) Expand all Loading... |
182 } | 183 } |
183 | 184 |
184 void FirstRunBubble::HandleDestroy() { | 185 void FirstRunBubble::HandleDestroy() { |
185 content_ = NULL; | 186 content_ = NULL; |
186 delete this; | 187 delete this; |
187 } | 188 } |
188 | 189 |
189 void FirstRunBubble::HandleKeepButton() { | 190 void FirstRunBubble::HandleKeepButton() { |
190 bubble_->Close(); | 191 bubble_->Close(); |
191 } | 192 } |
OLD | NEW |