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 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 NOTREACHED(); | 1100 NOTREACHED(); |
1101 } | 1101 } |
1102 } | 1102 } |
1103 | 1103 |
1104 gboolean LocationBarViewGtk::HandleExpose(GtkWidget* widget, | 1104 gboolean LocationBarViewGtk::HandleExpose(GtkWidget* widget, |
1105 GdkEventExpose* event) { | 1105 GdkEventExpose* event) { |
1106 // If we're not using GTK theming, draw our own border over the edge pixels | 1106 // If we're not using GTK theming, draw our own border over the edge pixels |
1107 // of the background. | 1107 // of the background. |
1108 if (!GtkThemeService::GetFrom(browser_->profile())->UsingNativeTheme()) { | 1108 if (!GtkThemeService::GetFrom(browser_->profile())->UsingNativeTheme()) { |
1109 if (popup_window_mode_) { | 1109 if (popup_window_mode_) { |
1110 NineBox(IDR_OMNIBOX_POPUP_BORDER_EDGE, | 1110 NineBox(IDR_OMNIBOX_POPUP_BORDER_TOP_LEFT, |
1111 IDR_OMNIBOX_POPUP_BORDER_CENTER, | 1111 IDR_OMNIBOX_POPUP_BORDER_TOP, |
1112 IDR_OMNIBOX_POPUP_BORDER_EDGE, | 1112 IDR_OMNIBOX_POPUP_BORDER_TOP_RIGHT, |
1113 0, 0, 0, 0, 0, 0).RenderToWidget(widget); | 1113 IDR_OMNIBOX_POPUP_BORDER_LEFT, |
| 1114 IDR_OMNIBOX_POPUP_BORDER_MIDDLE, |
| 1115 IDR_OMNIBOX_POPUP_BORDER_RIGHT, |
| 1116 IDR_OMNIBOX_POPUP_BORDER_BOTTOM_LEFT, |
| 1117 IDR_OMNIBOX_POPUP_BORDER_BOTTOM, |
| 1118 IDR_OMNIBOX_POPUP_BORDER_BOTTOM_RIGHT).RenderToWidget(widget); |
1114 } else { | 1119 } else { |
1115 NineBox(IDR_OMNIBOX_BORDER, 5, 5, 4, 4).RenderToWidget(widget); | 1120 NineBox(IDR_OMNIBOX_BORDER_TOP_LEFT, |
| 1121 IDR_OMNIBOX_BORDER_TOP, |
| 1122 IDR_OMNIBOX_BORDER_TOP_RIGHT, |
| 1123 IDR_OMNIBOX_BORDER_LEFT, |
| 1124 IDR_OMNIBOX_BORDER_MIDDLE, |
| 1125 IDR_OMNIBOX_BORDER_RIGHT, |
| 1126 IDR_OMNIBOX_BORDER_BOTTOM_LEFT, |
| 1127 IDR_OMNIBOX_BORDER_BOTTOM, |
| 1128 IDR_OMNIBOX_BORDER_BOTTOM_RIGHT).RenderToWidget(widget); |
1116 } | 1129 } |
1117 } | 1130 } |
1118 | 1131 |
1119 // Draw ExtensionAction backgrounds and borders, if necessary. The borders | 1132 // Draw ExtensionAction backgrounds and borders, if necessary. The borders |
1120 // appear exactly between the elements, so they can't draw the borders | 1133 // appear exactly between the elements, so they can't draw the borders |
1121 // themselves. | 1134 // themselves. |
1122 gfx::CanvasSkiaPaint canvas(event, /*opaque=*/false); | 1135 gfx::CanvasSkiaPaint canvas(event, /*opaque=*/false); |
1123 for (ScopedVector<PageActionViewGtk>::const_iterator | 1136 for (ScopedVector<PageActionViewGtk>::const_iterator |
1124 page_action_view = page_action_views_.begin(); | 1137 page_action_view = page_action_views_.begin(); |
1125 page_action_view != page_action_views_.end(); | 1138 page_action_view != page_action_views_.end(); |
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2095 } | 2108 } |
2096 | 2109 |
2097 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2110 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
2098 ExtensionAction* action) { | 2111 ExtensionAction* action) { |
2099 ExtensionPopupGtk::Show( | 2112 ExtensionPopupGtk::Show( |
2100 action->GetPopupUrl(current_tab_id_), | 2113 action->GetPopupUrl(current_tab_id_), |
2101 owner_->browser_, | 2114 owner_->browser_, |
2102 event_box_.get(), | 2115 event_box_.get(), |
2103 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2116 ExtensionPopupGtk::SHOW_AND_INSPECT); |
2104 } | 2117 } |
OLD | NEW |