OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/location_bar_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #include "chrome/browser/ui/gtk/manage_passwords_bubble_gtk.h" | 59 #include "chrome/browser/ui/gtk/manage_passwords_bubble_gtk.h" |
60 #include "chrome/browser/ui/gtk/nine_box.h" | 60 #include "chrome/browser/ui/gtk/nine_box.h" |
61 #include "chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h" | 61 #include "chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h" |
62 #include "chrome/browser/ui/gtk/rounded_window.h" | 62 #include "chrome/browser/ui/gtk/rounded_window.h" |
63 #include "chrome/browser/ui/gtk/script_bubble_gtk.h" | 63 #include "chrome/browser/ui/gtk/script_bubble_gtk.h" |
64 #include "chrome/browser/ui/gtk/view_id_util.h" | 64 #include "chrome/browser/ui/gtk/view_id_util.h" |
65 #include "chrome/browser/ui/gtk/zoom_bubble_gtk.h" | 65 #include "chrome/browser/ui/gtk/zoom_bubble_gtk.h" |
66 #include "chrome/browser/ui/omnibox/location_bar_util.h" | 66 #include "chrome/browser/ui/omnibox/location_bar_util.h" |
67 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" | 67 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
68 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" | 68 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
69 #include "chrome/browser/ui/passwords/manage_passwords_icon_controller.h" | 69 #include "chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h" |
70 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 70 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
71 #include "chrome/browser/ui/webui/extensions/extension_info_ui.h" | 71 #include "chrome/browser/ui/webui/extensions/extension_info_ui.h" |
72 #include "chrome/browser/ui/zoom/zoom_controller.h" | 72 #include "chrome/browser/ui/zoom/zoom_controller.h" |
73 #include "chrome/common/badge_util.h" | 73 #include "chrome/common/badge_util.h" |
74 #include "chrome/common/chrome_switches.h" | 74 #include "chrome/common/chrome_switches.h" |
75 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" | 75 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" |
76 #include "chrome/common/pref_names.h" | 76 #include "chrome/common/pref_names.h" |
77 #include "content/public/browser/navigation_entry.h" | 77 #include "content/public/browser/navigation_entry.h" |
78 #include "content/public/browser/notification_service.h" | 78 #include "content/public/browser/notification_service.h" |
79 #include "content/public/browser/web_contents.h" | 79 #include "content/public/browser/web_contents.h" |
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1608 gtk_widget_set_tooltip_text(zoom_.get(), UTF16ToUTF8(tooltip).c_str()); | 1608 gtk_widget_set_tooltip_text(zoom_.get(), UTF16ToUTF8(tooltip).c_str()); |
1609 | 1609 |
1610 gtk_widget_show(zoom_.get()); | 1610 gtk_widget_show(zoom_.get()); |
1611 } | 1611 } |
1612 | 1612 |
1613 void LocationBarViewGtk::UpdateManagePasswordsIcon() { | 1613 void LocationBarViewGtk::UpdateManagePasswordsIcon() { |
1614 WebContents* web_contents = GetWebContents(); | 1614 WebContents* web_contents = GetWebContents(); |
1615 if (!manage_passwords_icon_.get() || !web_contents) | 1615 if (!manage_passwords_icon_.get() || !web_contents) |
1616 return; | 1616 return; |
1617 | 1617 |
1618 ManagePasswordsIconController* manage_passwords_icon_controller = | 1618 ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller = |
1619 ManagePasswordsIconController::FromWebContents(web_contents); | 1619 ManagePasswordsBubbleUIController::FromWebContents(web_contents); |
1620 if (!manage_passwords_icon_controller || | 1620 if (!manage_passwords_bubble_ui_controller || |
1621 !manage_passwords_icon_controller->password_to_be_saved() || | 1621 !manage_passwords_bubble_ui_controller->password_to_be_saved() || |
1622 GetToolbarModel()->input_in_progress()) { | 1622 GetToolbarModel()->input_in_progress()) { |
1623 gtk_widget_hide(manage_passwords_icon_.get()); | 1623 gtk_widget_hide(manage_passwords_icon_.get()); |
1624 ManagePasswordsBubbleGtk::CloseBubble(); | 1624 ManagePasswordsBubbleGtk::CloseBubble(); |
1625 return; | 1625 return; |
1626 } | 1626 } |
1627 | 1627 |
1628 gtk_image_set_from_pixbuf( | 1628 gtk_image_set_from_pixbuf( |
1629 GTK_IMAGE(manage_passwords_icon_image_), | 1629 GTK_IMAGE(manage_passwords_icon_image_), |
1630 theme_service_->GetImageNamed(IDR_SAVE_PASSWORD).ToGdkPixbuf()); | 1630 theme_service_->GetImageNamed(IDR_SAVE_PASSWORD).ToGdkPixbuf()); |
1631 | 1631 |
1632 string16 tooltip = | 1632 string16 tooltip = |
1633 l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_TOOLTIP_SAVE); | 1633 l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_TOOLTIP_SAVE); |
1634 gtk_widget_set_tooltip_text(manage_passwords_icon_.get(), | 1634 gtk_widget_set_tooltip_text(manage_passwords_icon_.get(), |
1635 UTF16ToUTF8(tooltip).c_str()); | 1635 UTF16ToUTF8(tooltip).c_str()); |
1636 | 1636 |
1637 gtk_widget_show(manage_passwords_icon_.get()); | 1637 gtk_widget_show(manage_passwords_icon_.get()); |
1638 if (manage_passwords_icon_controller-> | 1638 if (manage_passwords_bubble_ui_controller-> |
1639 manage_passwords_bubble_needs_showing()) { | 1639 manage_passwords_bubble_needs_showing()) { |
1640 ShowManagePasswordsBubble(); | 1640 ShowManagePasswordsBubble(); |
1641 manage_passwords_icon_controller->OnBubbleShown(); | 1641 manage_passwords_bubble_ui_controller->OnBubbleShown(); |
1642 } | 1642 } |
1643 } | 1643 } |
1644 | 1644 |
1645 void LocationBarViewGtk::UpdateScriptBubbleIcon() { | 1645 void LocationBarViewGtk::UpdateScriptBubbleIcon() { |
1646 num_running_scripts_ = 0; | 1646 num_running_scripts_ = 0; |
1647 if (GetWebContents()) { | 1647 if (GetWebContents()) { |
1648 extensions::TabHelper* tab_helper = | 1648 extensions::TabHelper* tab_helper = |
1649 extensions::TabHelper::FromWebContents(GetWebContents()); | 1649 extensions::TabHelper::FromWebContents(GetWebContents()); |
1650 if (tab_helper && tab_helper->script_bubble_controller()) { | 1650 if (tab_helper && tab_helper->script_bubble_controller()) { |
1651 num_running_scripts_ = tab_helper->script_bubble_controller()-> | 1651 num_running_scripts_ = tab_helper->script_bubble_controller()-> |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2123 | 2123 |
2124 GdkEventButton event = {}; | 2124 GdkEventButton event = {}; |
2125 event.type = GDK_BUTTON_PRESS; | 2125 event.type = GDK_BUTTON_PRESS; |
2126 event.button = 1; | 2126 event.button = 1; |
2127 return view->OnButtonPressed(view->widget(), &event); | 2127 return view->OnButtonPressed(view->widget(), &event); |
2128 } | 2128 } |
2129 | 2129 |
2130 void LocationBarViewGtk::PageActionViewGtk::OnIconChanged() { | 2130 void LocationBarViewGtk::PageActionViewGtk::OnIconChanged() { |
2131 UpdateVisibility(owner_->GetWebContents(), current_url_); | 2131 UpdateVisibility(owner_->GetWebContents(), current_url_); |
2132 } | 2132 } |
OLD | NEW |