OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/manage_passwords_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/manage_passwords_bubble_gtk.h" |
6 | 6 |
7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | |
9 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
12 #include "chrome/browser/ui/browser_window.h" | 11 #include "chrome/browser/ui/browser_window.h" |
13 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 12 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
14 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" | 13 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" |
15 #include "chrome/browser/ui/passwords/manage_passwords_icon_controller.h" | 14 #include "chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h" |
16 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
17 #include "ui/base/gtk/gtk_hig_constants.h" | 16 #include "ui/base/gtk/gtk_hig_constants.h" |
18 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
19 | 18 |
20 namespace { | 19 namespace { |
21 | 20 |
22 // Pointer to singleton object (NULL if no bubble is open). | 21 // Pointer to singleton object (NULL if no bubble is open). |
23 ManagePasswordsBubbleGtk* g_bubble = NULL; | 22 ManagePasswordsBubbleGtk* g_bubble = NULL; |
24 | 23 |
25 // Need to manually set anchor width and height to ensure that the bubble shows | 24 // Need to manually set anchor width and height to ensure that the bubble shows |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 DCHECK(bubble_); | 114 DCHECK(bubble_); |
116 bubble_->Close(); | 115 bubble_->Close(); |
117 } | 116 } |
118 | 117 |
119 void ManagePasswordsBubbleGtk::OnDestroy(GtkWidget* widget) { | 118 void ManagePasswordsBubbleGtk::OnDestroy(GtkWidget* widget) { |
120 // Listen to the destroy signal and delete this instance when it is caught. | 119 // Listen to the destroy signal and delete this instance when it is caught. |
121 delete this; | 120 delete this; |
122 } | 121 } |
123 | 122 |
124 void ManagePasswordsBubbleGtk::OnSaveButtonClicked(GtkWidget* button) { | 123 void ManagePasswordsBubbleGtk::OnSaveButtonClicked(GtkWidget* button) { |
125 TabSpecificContentSettings* content_settings = | 124 ManagePasswordsBubbleUIController::FromWebContents(web_contents_)-> |
126 TabSpecificContentSettings::FromWebContents(web_contents_); | 125 SavePassword(); |
127 content_settings->SavePassword(); | |
128 Close(); | 126 Close(); |
129 } | 127 } |
130 | 128 |
131 void ManagePasswordsBubbleGtk::OnNotNowButtonClicked(GtkWidget* button) { | 129 void ManagePasswordsBubbleGtk::OnNotNowButtonClicked(GtkWidget* button) { |
132 Close(); | 130 Close(); |
133 } | 131 } |
OLD | NEW |