Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: chrome/browser/gtk/location_bar_view_gtk.cc

Issue 316006: GTK: Try to position info bubbles onscreen. (Closed)
Patch Set: merge Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/gtk/info_bubble_gtk.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "app/gfx/canvas_paint.h" 9 #include "app/gfx/canvas_paint.h"
10 #include "app/gfx/gtk_util.h" 10 #include "app/gfx/gtk_util.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 profile_, 144 profile_,
145 command_updater_, 145 command_updater_,
146 popup_window_mode_, 146 popup_window_mode_,
147 bubble_positioner_)); 147 bubble_positioner_));
148 location_entry_->Init(); 148 location_entry_->Init();
149 149
150 hbox_.Own(gtk_hbox_new(FALSE, kInnerPadding)); 150 hbox_.Own(gtk_hbox_new(FALSE, kInnerPadding));
151 gtk_container_set_border_width(GTK_CONTAINER(hbox_.get()), kHboxBorder); 151 gtk_container_set_border_width(GTK_CONTAINER(hbox_.get()), kHboxBorder);
152 // We will paint for the alignment, to paint the background and border. 152 // We will paint for the alignment, to paint the background and border.
153 gtk_widget_set_app_paintable(hbox_.get(), TRUE); 153 gtk_widget_set_app_paintable(hbox_.get(), TRUE);
154 // Have GTK double buffer around the expose signal.
155 gtk_widget_set_double_buffered(hbox_.get(), TRUE);
156 // Redraw the whole location bar when it changes size (e.g., when toggling 154 // Redraw the whole location bar when it changes size (e.g., when toggling
157 // the home button on/off. 155 // the home button on/off.
158 gtk_widget_set_redraw_on_allocate(hbox_.get(), TRUE); 156 gtk_widget_set_redraw_on_allocate(hbox_.get(), TRUE);
159 157
160 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 158 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
161 security_lock_icon_image_ = gtk_image_new_from_pixbuf( 159 security_lock_icon_image_ = gtk_image_new_from_pixbuf(
162 rb.GetPixbufNamed(IDR_LOCK)); 160 rb.GetPixbufNamed(IDR_LOCK));
163 gtk_widget_set_name(security_lock_icon_image_, "chrome-security-lock-icon"); 161 gtk_widget_set_name(security_lock_icon_image_, "chrome-security-lock-icon");
164 gtk_widget_hide(GTK_WIDGET(security_lock_icon_image_)); 162 gtk_widget_hide(GTK_WIDGET(security_lock_icon_image_));
165 security_warning_icon_image_ = gtk_image_new_from_pixbuf( 163 security_warning_icon_image_ = gtk_image_new_from_pixbuf(
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 const ExtensionActionState* state = 821 const ExtensionActionState* state =
824 contents->GetPageActionState(view->page_action_); 822 contents->GetPageActionState(view->page_action_);
825 if (!state || state->badge_text().empty()) 823 if (!state || state->badge_text().empty())
826 return FALSE; 824 return FALSE;
827 825
828 gfx::CanvasPaint canvas(event, false); 826 gfx::CanvasPaint canvas(event, false);
829 gfx::Rect bounding_rect(widget->allocation); 827 gfx::Rect bounding_rect(widget->allocation);
830 state->PaintBadge(&canvas, bounding_rect); 828 state->PaintBadge(&canvas, bounding_rect);
831 return FALSE; 829 return FALSE;
832 } 830 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/info_bubble_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698