| 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/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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 #include "chrome/browser/ui/gtk/rounded_window.h" | 60 #include "chrome/browser/ui/gtk/rounded_window.h" |
| 61 #include "chrome/browser/ui/gtk/view_id_util.h" | 61 #include "chrome/browser/ui/gtk/view_id_util.h" |
| 62 #include "chrome/browser/ui/gtk/zoom_bubble_gtk.h" | 62 #include "chrome/browser/ui/gtk/zoom_bubble_gtk.h" |
| 63 #include "chrome/browser/ui/omnibox/location_bar_util.h" | 63 #include "chrome/browser/ui/omnibox/location_bar_util.h" |
| 64 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" | 64 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
| 65 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" | 65 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
| 66 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 66 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 67 #include "chrome/browser/ui/webui/extensions/extension_info_ui.h" | 67 #include "chrome/browser/ui/webui/extensions/extension_info_ui.h" |
| 68 #include "chrome/browser/ui/zoom/zoom_controller.h" | 68 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| 69 #include "chrome/common/chrome_notification_types.h" | 69 #include "chrome/common/chrome_notification_types.h" |
| 70 #include "chrome/common/chrome_switches.h" |
| 70 #include "chrome/common/extensions/extension.h" | 71 #include "chrome/common/extensions/extension.h" |
| 71 #include "chrome/common/extensions/extension_action.h" | 72 #include "chrome/common/extensions/extension_action.h" |
| 72 #include "chrome/common/extensions/extension_manifest_constants.h" | 73 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 73 #include "chrome/common/extensions/extension_resource.h" | 74 #include "chrome/common/extensions/extension_resource.h" |
| 74 #include "chrome/common/extensions/extension_switch_utils.h" | 75 #include "chrome/common/extensions/extension_switch_utils.h" |
| 75 #include "chrome/common/pref_names.h" | 76 #include "chrome/common/pref_names.h" |
| 76 #include "content/public/browser/navigation_entry.h" | 77 #include "content/public/browser/navigation_entry.h" |
| 77 #include "content/public/browser/notification_service.h" | 78 #include "content/public/browser/notification_service.h" |
| 78 #include "content/public/browser/web_contents.h" | 79 #include "content/public/browser/web_contents.h" |
| 79 #include "grit/generated_resources.h" | 80 #include "grit/generated_resources.h" |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 gtk_box_pack_start(GTK_BOX(tab_to_search_hint_), | 465 gtk_box_pack_start(GTK_BOX(tab_to_search_hint_), |
| 465 tab_to_search_hint_trailing_label_, | 466 tab_to_search_hint_trailing_label_, |
| 466 FALSE, FALSE, 0); | 467 FALSE, FALSE, 0); |
| 467 // Show all children widgets of |tab_to_search_hint_| initially. | 468 // Show all children widgets of |tab_to_search_hint_| initially. |
| 468 gtk_widget_show_all(tab_to_search_hint_); | 469 gtk_widget_show_all(tab_to_search_hint_); |
| 469 gtk_widget_hide(tab_to_search_hint_); | 470 gtk_widget_hide(tab_to_search_hint_); |
| 470 // tab_to_search_hint_ gets hidden initially in OnChanged. Hiding it here | 471 // tab_to_search_hint_ gets hidden initially in OnChanged. Hiding it here |
| 471 // doesn't work, someone is probably calling show_all on our parent box. | 472 // doesn't work, someone is probably calling show_all on our parent box. |
| 472 gtk_box_pack_end(GTK_BOX(entry_box_), tab_to_search_hint_, FALSE, FALSE, 0); | 473 gtk_box_pack_end(GTK_BOX(entry_box_), tab_to_search_hint_, FALSE, FALSE, 0); |
| 473 | 474 |
| 474 if (extensions::switch_utils::IsActionBoxEnabled()) { | 475 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableActionBox)) { |
| 475 // TODO(mpcomplete): should we hide this if ShouldOnlyShowLocation()==true? | 476 // TODO(mpcomplete): should we hide this if ShouldOnlyShowLocation()==true? |
| 476 action_box_button_.reset(new ActionBoxButtonGtk(browser_)); | 477 action_box_button_.reset(new ActionBoxButtonGtk(browser_)); |
| 477 | 478 |
| 478 // TODO(mpcomplete): Figure out why CustomDrawButton is offset 3 pixels. | 479 // TODO(mpcomplete): Figure out why CustomDrawButton is offset 3 pixels. |
| 479 // This offset corrects the strange offset of CustomDrawButton. | 480 // This offset corrects the strange offset of CustomDrawButton. |
| 480 const int kMagicActionBoxYOffset = 3; | 481 const int kMagicActionBoxYOffset = 3; |
| 481 GtkWidget* alignment = gtk_alignment_new(0, 0, 1, 1); | 482 GtkWidget* alignment = gtk_alignment_new(0, 0, 1, 1); |
| 482 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), | 483 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), |
| 483 0, kMagicActionBoxYOffset, | 484 0, kMagicActionBoxYOffset, |
| 484 0, kInnerPadding); | 485 0, kInnerPadding); |
| (...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2051 } | 2052 } |
| 2052 | 2053 |
| 2053 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2054 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
| 2054 ExtensionAction* action) { | 2055 ExtensionAction* action) { |
| 2055 ExtensionPopupGtk::Show( | 2056 ExtensionPopupGtk::Show( |
| 2056 action->GetPopupUrl(current_tab_id_), | 2057 action->GetPopupUrl(current_tab_id_), |
| 2057 owner_->browser_, | 2058 owner_->browser_, |
| 2058 event_box_.get(), | 2059 event_box_.get(), |
| 2059 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2060 ExtensionPopupGtk::SHOW_AND_INSPECT); |
| 2060 } | 2061 } |
| OLD | NEW |