| 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/password_generation_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/password_generation_bubble_gtk.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_list.h" | 9 #include "chrome/browser/ui/browser_list.h" |
| 10 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" | 10 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" |
| 11 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 11 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" |
| 12 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 12 #include "chrome/browser/ui/gtk/gtk_util.h" | 13 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 13 #include "chrome/browser/ui/gtk/theme_service_gtk.h" | |
| 14 #include "chrome/common/autofill_messages.h" | 14 #include "chrome/common/autofill_messages.h" |
| 15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
| 16 #include "content/public/browser/render_view_host.h" | 16 #include "content/public/browser/render_view_host.h" |
| 17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 18 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
| 19 #include "ui/base/gtk/gtk_hig_constants.h" | 19 #include "ui/base/gtk/gtk_hig_constants.h" |
| 20 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 21 | 21 |
| 22 const int kContentBorder = 4; | 22 const int kContentBorder = 4; |
| 23 const int kHorizontalSpacing = 4; | 23 const int kHorizontalSpacing = 4; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 gtk_container_set_border_width(GTK_CONTAINER(content), kContentBorder); | 56 gtk_container_set_border_width(GTK_CONTAINER(content), kContentBorder); |
| 57 gtk_box_pack_start(GTK_BOX(content), title_line, TRUE, TRUE, 0); | 57 gtk_box_pack_start(GTK_BOX(content), title_line, TRUE, TRUE, 0); |
| 58 gtk_box_pack_start(GTK_BOX(content), password_line, TRUE, TRUE, 0); | 58 gtk_box_pack_start(GTK_BOX(content), password_line, TRUE, TRUE, 0); |
| 59 | 59 |
| 60 bubble_ = BubbleGtk::Show(anchor_widget, | 60 bubble_ = BubbleGtk::Show(anchor_widget, |
| 61 &anchor_rect, | 61 &anchor_rect, |
| 62 content, | 62 content, |
| 63 BubbleGtk::ARROW_LOCATION_TOP_LEFT, | 63 BubbleGtk::ARROW_LOCATION_TOP_LEFT, |
| 64 true, // match_system_theme | 64 true, // match_system_theme |
| 65 true, // grab_input | 65 true, // grab_input |
| 66 ThemeServiceGtk::GetFrom(profile_), | 66 GtkThemeService::GetFrom(profile_), |
| 67 NULL); // delegate | 67 NULL); // delegate |
| 68 | 68 |
| 69 g_signal_connect(content, "destroy", | 69 g_signal_connect(content, "destroy", |
| 70 G_CALLBACK(&OnDestroyThunk), this); | 70 G_CALLBACK(&OnDestroyThunk), this); |
| 71 g_signal_connect(accept_button, "clicked", | 71 g_signal_connect(accept_button, "clicked", |
| 72 G_CALLBACK(&OnAcceptClickedThunk), this); | 72 G_CALLBACK(&OnAcceptClickedThunk), this); |
| 73 g_signal_connect(learn_more_link, "clicked", | 73 g_signal_connect(learn_more_link, "clicked", |
| 74 G_CALLBACK(OnLearnMoreLinkClickedThunk), this); | 74 G_CALLBACK(OnLearnMoreLinkClickedThunk), this); |
| 75 } | 75 } |
| 76 | 76 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 90 } | 90 } |
| 91 | 91 |
| 92 void PasswordGenerationBubbleGtk::OnLearnMoreLinkClicked(GtkButton* button) { | 92 void PasswordGenerationBubbleGtk::OnLearnMoreLinkClicked(GtkButton* button) { |
| 93 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); | 93 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); |
| 94 content::OpenURLParams params( | 94 content::OpenURLParams params( |
| 95 GURL(chrome::kAutoPasswordGenerationLearnMoreURL), content::Referrer(), | 95 GURL(chrome::kAutoPasswordGenerationLearnMoreURL), content::Referrer(), |
| 96 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false); | 96 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false); |
| 97 browser->OpenURL(params); | 97 browser->OpenURL(params); |
| 98 bubble_->Close(); | 98 bubble_->Close(); |
| 99 } | 99 } |
| OLD | NEW |