| 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/omnibox/omnibox_popup_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/search_engines/template_url.h" | 23 #include "chrome/browser/search_engines/template_url.h" |
| 24 #include "chrome/browser/search_engines/template_url_service.h" | 24 #include "chrome/browser/search_engines/template_url_service.h" |
| 25 #include "chrome/browser/ui/gtk/gtk_util.h" | 25 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 26 #include "chrome/browser/ui/gtk/theme_service_gtk.h" | 26 #include "chrome/browser/ui/gtk/theme_service_gtk.h" |
| 27 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 27 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 28 #include "chrome/common/chrome_notification_types.h" | 28 #include "chrome/common/chrome_notification_types.h" |
| 29 #include "content/public/browser/notification_source.h" | 29 #include "content/public/browser/notification_source.h" |
| 30 #include "grit/theme_resources.h" | 30 #include "grit/theme_resources.h" |
| 31 #include "ui/base/gtk/gtk_compat.h" | 31 #include "ui/base/gtk/gtk_compat.h" |
| 32 #include "ui/base/gtk/gtk_hig_constants.h" | 32 #include "ui/base/gtk/gtk_hig_constants.h" |
| 33 #include "ui/base/gtk/gtk_screen_util.h" |
| 33 #include "ui/base/gtk/gtk_windowing.h" | 34 #include "ui/base/gtk/gtk_windowing.h" |
| 34 #include "ui/gfx/color_utils.h" | 35 #include "ui/gfx/color_utils.h" |
| 35 #include "ui/gfx/font.h" | 36 #include "ui/gfx/font.h" |
| 36 #include "ui/gfx/gtk_util.h" | 37 #include "ui/gfx/gtk_util.h" |
| 37 #include "ui/gfx/image/cairo_cached_surface.h" | 38 #include "ui/gfx/image/cairo_cached_surface.h" |
| 38 #include "ui/gfx/image/image.h" | 39 #include "ui/gfx/image/image.h" |
| 39 #include "ui/gfx/rect.h" | 40 #include "ui/gfx/rect.h" |
| 40 #include "ui/gfx/skia_utils_gtk.h" | 41 #include "ui/gfx/skia_utils_gtk.h" |
| 41 | 42 |
| 42 namespace { | 43 namespace { |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 } | 366 } |
| 366 | 367 |
| 367 Show(result.size()); | 368 Show(result.size()); |
| 368 gtk_widget_queue_draw(window_); | 369 gtk_widget_queue_draw(window_); |
| 369 } | 370 } |
| 370 | 371 |
| 371 gfx::Rect OmniboxPopupViewGtk::GetTargetBounds() { | 372 gfx::Rect OmniboxPopupViewGtk::GetTargetBounds() { |
| 372 if (!gtk_widget_get_realized(window_)) | 373 if (!gtk_widget_get_realized(window_)) |
| 373 return gfx::Rect(); | 374 return gfx::Rect(); |
| 374 | 375 |
| 375 gfx::Rect retval = gtk_util::GetWidgetScreenBounds(window_); | 376 gfx::Rect retval = ui::GetWidgetScreenBounds(window_); |
| 376 | 377 |
| 377 // The widget bounds don't update synchronously so may be out of sync with | 378 // The widget bounds don't update synchronously so may be out of sync with |
| 378 // our last size request. | 379 // our last size request. |
| 379 GtkRequisition req; | 380 GtkRequisition req; |
| 380 gtk_widget_size_request(window_, &req); | 381 gtk_widget_size_request(window_, &req); |
| 381 retval.set_width(req.width); | 382 retval.set_width(req.width); |
| 382 retval.set_height(req.height); | 383 retval.set_height(req.height); |
| 383 | 384 |
| 384 return retval; | 385 return retval; |
| 385 } | 386 } |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 DrawFullImage(cr, widget, | 735 DrawFullImage(cr, widget, |
| 735 theme_service_->GetImageNamed( | 736 theme_service_->GetImageNamed( |
| 736 is_selected ? IDR_OMNIBOX_TTS_DARK : IDR_OMNIBOX_TTS), | 737 is_selected ? IDR_OMNIBOX_TTS_DARK : IDR_OMNIBOX_TTS), |
| 737 icon_start_x, line_rect.y() + kIconTopPadding); | 738 icon_start_x, line_rect.y() + kIconTopPadding); |
| 738 } | 739 } |
| 739 } | 740 } |
| 740 | 741 |
| 741 cairo_destroy(cr); | 742 cairo_destroy(cr); |
| 742 return TRUE; | 743 return TRUE; |
| 743 } | 744 } |
| OLD | NEW |