OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/one_click_signin_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/one_click_signin_bubble_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 BubbleGtk* bubble, bool closed_by_escape) { | 54 BubbleGtk* bubble, bool closed_by_escape) { |
55 if (is_sync_dialog_ && !start_sync_callback_.is_null()) { | 55 if (is_sync_dialog_ && !start_sync_callback_.is_null()) { |
56 base::ResetAndReturn(&start_sync_callback_).Run( | 56 base::ResetAndReturn(&start_sync_callback_).Run( |
57 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); | 57 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); |
58 } | 58 } |
59 | 59 |
60 // The bubble needs to close and remove the widgets from the window before | 60 // The bubble needs to close and remove the widgets from the window before |
61 // |close_button_| (which is a CustomDrawButton) can be destroyed, because it | 61 // |close_button_| (which is a CustomDrawButton) can be destroyed, because it |
62 // depends on all references being cleared for the GtkWidget before it is | 62 // depends on all references being cleared for the GtkWidget before it is |
63 // destroyed. | 63 // destroyed. |
64 MessageLoopForUI::current()->DeleteSoon(FROM_HERE, close_button_.release()); | 64 base::MessageLoopForUI::current()->DeleteSoon(FROM_HERE, |
| 65 close_button_.release()); |
65 | 66 |
66 delete this; | 67 delete this; |
67 } | 68 } |
68 | 69 |
69 void OneClickSigninBubbleGtk::OnClickAdvancedLink(GtkWidget* link) { | 70 void OneClickSigninBubbleGtk::OnClickAdvancedLink(GtkWidget* link) { |
70 if (is_sync_dialog_) { | 71 if (is_sync_dialog_) { |
71 OneClickSigninHelper::LogConfirmHistogramValue( | 72 OneClickSigninHelper::LogConfirmHistogramValue( |
72 clicked_learn_more_ ? | 73 clicked_learn_more_ ? |
73 one_click_signin::HISTOGRAM_CONFIRM_LEARN_MORE_ADVANCED : | 74 one_click_signin::HISTOGRAM_CONFIRM_LEARN_MORE_ADVANCED : |
74 one_click_signin::HISTOGRAM_CONFIRM_ADVANCED); | 75 one_click_signin::HISTOGRAM_CONFIRM_ADVANCED); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 292 |
292 gtk_window_set_transient_for(bubble_->GetNativeWindow(), | 293 gtk_window_set_transient_for(bubble_->GetNativeWindow(), |
293 browser_window_gtk->GetNativeWindow()); | 294 browser_window_gtk->GetNativeWindow()); |
294 if (is_sync_dialog_) { | 295 if (is_sync_dialog_) { |
295 gtk_window_set_modal(bubble_->GetNativeWindow(), true); | 296 gtk_window_set_modal(bubble_->GetNativeWindow(), true); |
296 gtk_window_set_focus(bubble_->GetNativeWindow(), ok_button_); | 297 gtk_window_set_focus(bubble_->GetNativeWindow(), ok_button_); |
297 } else { | 298 } else { |
298 gtk_widget_grab_focus(ok_button_); | 299 gtk_widget_grab_focus(ok_button_); |
299 } | 300 } |
300 } | 301 } |
OLD | NEW |