| 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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 AccessibilityTextBoxInfo info(profile(), | 628 AccessibilityTextBoxInfo info(profile(), |
| 629 l10n_util::GetStringUTF8(IDS_ACCNAME_LOCATION), | 629 l10n_util::GetStringUTF8(IDS_ACCNAME_LOCATION), |
| 630 std::string(), false); | 630 std::string(), false); |
| 631 ExtensionAccessibilityEventRouter::GetInstance()->HandleControlEvent( | 631 ExtensionAccessibilityEventRouter::GetInstance()->HandleControlEvent( |
| 632 ui::AX_EVENT_FOCUS, &info); | 632 ui::AX_EVENT_FOCUS, &info); |
| 633 | 633 |
| 634 // Update the keyword and search hint states. | 634 // Update the keyword and search hint states. |
| 635 OnChanged(); | 635 OnChanged(); |
| 636 } | 636 } |
| 637 | 637 |
| 638 void LocationBarViewGtk::ShowURL() { |
| 639 omnibox_view_->ShowURL(); |
| 640 } |
| 641 |
| 638 InstantController* LocationBarViewGtk::GetInstant() { | 642 InstantController* LocationBarViewGtk::GetInstant() { |
| 639 return browser_->instant_controller() ? | 643 return browser_->instant_controller() ? |
| 640 browser_->instant_controller()->instant() : NULL; | 644 browser_->instant_controller()->instant() : NULL; |
| 641 } | 645 } |
| 642 | 646 |
| 643 WebContents* LocationBarViewGtk::GetWebContents() { | 647 WebContents* LocationBarViewGtk::GetWebContents() { |
| 644 return browser_->tab_strip_model()->GetActiveWebContents(); | 648 return browser_->tab_strip_model()->GetActiveWebContents(); |
| 645 } | 649 } |
| 646 | 650 |
| 647 ToolbarModel* LocationBarViewGtk::GetToolbarModel() { | 651 ToolbarModel* LocationBarViewGtk::GetToolbarModel() { |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1564 starred_ ? IDS_TOOLTIP_STARRED : IDS_TOOLTIP_STAR).c_str()); | 1568 starred_ ? IDS_TOOLTIP_STARRED : IDS_TOOLTIP_STAR).c_str()); |
| 1565 } else { | 1569 } else { |
| 1566 gtk_widget_hide_all(star_.get()); | 1570 gtk_widget_hide_all(star_.get()); |
| 1567 } | 1571 } |
| 1568 } | 1572 } |
| 1569 | 1573 |
| 1570 bool LocationBarViewGtk::ShouldOnlyShowLocation() { | 1574 bool LocationBarViewGtk::ShouldOnlyShowLocation() { |
| 1571 return !browser_->is_type_tabbed(); | 1575 return !browser_->is_type_tabbed(); |
| 1572 } | 1576 } |
| 1573 | 1577 |
| 1578 void LocationBarViewGtk::HideURL() { |
| 1579 omnibox_view_->HideURL(); |
| 1580 } |
| 1581 |
| 1574 //////////////////////////////////////////////////////////////////////////////// | 1582 //////////////////////////////////////////////////////////////////////////////// |
| 1575 // LocationBarViewGtk::PageToolViewGtk | 1583 // LocationBarViewGtk::PageToolViewGtk |
| 1576 | 1584 |
| 1577 LocationBarViewGtk::PageToolViewGtk::PageToolViewGtk() | 1585 LocationBarViewGtk::PageToolViewGtk::PageToolViewGtk() |
| 1578 : alignment_(gtk_alignment_new(0, 0, 1, 1)), | 1586 : alignment_(gtk_alignment_new(0, 0, 1, 1)), |
| 1579 event_box_(gtk_event_box_new()), | 1587 event_box_(gtk_event_box_new()), |
| 1580 hbox_(gtk_hbox_new(FALSE, kInnerPadding)), | 1588 hbox_(gtk_hbox_new(FALSE, kInnerPadding)), |
| 1581 image_(gtk_image_new()), | 1589 image_(gtk_image_new()), |
| 1582 label_(gtk_label_new(NULL)), | 1590 label_(gtk_label_new(NULL)), |
| 1583 animation_(this), | 1591 animation_(this), |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1963 void* user_data) { | 1971 void* user_data) { |
| 1964 PageActionViewGtk* view = static_cast<PageActionViewGtk*>(user_data); | 1972 PageActionViewGtk* view = static_cast<PageActionViewGtk*>(user_data); |
| 1965 if (!gtk_widget_get_visible(view->widget())) | 1973 if (!gtk_widget_get_visible(view->widget())) |
| 1966 return FALSE; | 1974 return FALSE; |
| 1967 | 1975 |
| 1968 GdkEventButton event = {}; | 1976 GdkEventButton event = {}; |
| 1969 event.type = GDK_BUTTON_PRESS; | 1977 event.type = GDK_BUTTON_PRESS; |
| 1970 event.button = 1; | 1978 event.button = 1; |
| 1971 return view->OnButtonPressed(view->widget(), &event); | 1979 return view->OnButtonPressed(view->widget(), &event); |
| 1972 } | 1980 } |
| OLD | NEW |