OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/location_bar_view_gtk.h" | 5 #include "chrome/browser/gtk/location_bar_view_gtk.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/gfx/gtk_util.h" | 10 #include "base/gfx/gtk_util.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 alignment_.Own(gtk_alignment_new(0.0, 0.0, 1.0, 1.0)); | 69 alignment_.Own(gtk_alignment_new(0.0, 0.0, 1.0, 1.0)); |
70 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment_.get()), | 70 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment_.get()), |
71 kTopMargin + kBorderThickness, | 71 kTopMargin + kBorderThickness, |
72 kBottomMargin + kBorderThickness, | 72 kBottomMargin + kBorderThickness, |
73 kEditLeftRightPadding, kEditLeftRightPadding); | 73 kEditLeftRightPadding, kEditLeftRightPadding); |
74 // We will paint for the alignment, to paint the background and border. | 74 // We will paint for the alignment, to paint the background and border. |
75 gtk_widget_set_app_paintable(alignment_.get(), TRUE); | 75 gtk_widget_set_app_paintable(alignment_.get(), TRUE); |
76 // Have GTK double buffer around the expose signal. | 76 // Have GTK double buffer around the expose signal. |
77 gtk_widget_set_double_buffered(alignment_.get(), TRUE); | 77 gtk_widget_set_double_buffered(alignment_.get(), TRUE); |
78 g_signal_connect(alignment_.get(), "expose-event", | 78 g_signal_connect(alignment_.get(), "expose-event", |
79 G_CALLBACK(&HandleExposeThunk), this); | 79 G_CALLBACK(&HandleExposeThunk), this); |
80 | 80 |
81 gtk_container_add(GTK_CONTAINER(alignment_.get()), | 81 gtk_container_add(GTK_CONTAINER(alignment_.get()), |
82 location_entry_->widget()); | 82 location_entry_->widget()); |
83 } | 83 } |
84 | 84 |
85 void LocationBarViewGtk::SetProfile(Profile* profile) { | 85 void LocationBarViewGtk::SetProfile(Profile* profile) { |
86 profile_ = profile; | 86 profile_ = profile; |
87 } | 87 } |
88 | 88 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // even on Windows yet. | 186 // even on Windows yet. |
187 FeedList* feeds = toolbar_model_->GetFeedList().get(); | 187 FeedList* feeds = toolbar_model_->GetFeedList().get(); |
188 if (feeds && feeds->list().size() > 0) | 188 if (feeds && feeds->list().size() > 0) |
189 NOTIMPLEMENTED(); | 189 NOTIMPLEMENTED(); |
190 } | 190 } |
191 | 191 |
192 void LocationBarViewGtk::SaveStateToContents(TabContents* contents) { | 192 void LocationBarViewGtk::SaveStateToContents(TabContents* contents) { |
193 NOTIMPLEMENTED(); | 193 NOTIMPLEMENTED(); |
194 } | 194 } |
195 | 195 |
| 196 void LocationBarViewGtk::Revert() { |
| 197 NOTIMPLEMENTED(); |
| 198 } |
| 199 |
196 gboolean LocationBarViewGtk::HandleExpose(GtkWidget* widget, | 200 gboolean LocationBarViewGtk::HandleExpose(GtkWidget* widget, |
197 GdkEventExpose* event) { | 201 GdkEventExpose* event) { |
198 GdkDrawable* drawable = GDK_DRAWABLE(event->window); | 202 GdkDrawable* drawable = GDK_DRAWABLE(event->window); |
199 GdkGC* gc = gdk_gc_new(drawable); | 203 GdkGC* gc = gdk_gc_new(drawable); |
200 | 204 |
201 GdkRectangle* alloc_rect = &alignment_.get()->allocation; | 205 GdkRectangle* alloc_rect = &alignment_.get()->allocation; |
202 | 206 |
203 // The area outside of our margin, which includes the border. | 207 // The area outside of our margin, which includes the border. |
204 GdkRectangle inner_rect = { | 208 GdkRectangle inner_rect = { |
205 alloc_rect->x, | 209 alloc_rect->x, |
(...skipping 21 matching lines...) Expand all Loading... |
227 gdk_draw_rectangle(drawable, gc, TRUE, | 231 gdk_draw_rectangle(drawable, gc, TRUE, |
228 inner_rect.x, | 232 inner_rect.x, |
229 inner_rect.y + kBorderThickness, | 233 inner_rect.y + kBorderThickness, |
230 inner_rect.width, | 234 inner_rect.width, |
231 inner_rect.height - (kBorderThickness * 2)); | 235 inner_rect.height - (kBorderThickness * 2)); |
232 | 236 |
233 g_object_unref(gc); | 237 g_object_unref(gc); |
234 | 238 |
235 return FALSE; // Continue propagating the expose. | 239 return FALSE; // Continue propagating the expose. |
236 } | 240 } |
OLD | NEW |