| 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/extensions/extension_popup_gtk.h" | 5 #include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
| 15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 16 #include "chrome/browser/debugger/devtools_window.h" | 16 #include "chrome/browser/debugger/devtools_window.h" |
| 17 #include "chrome/browser/extensions/extension_host.h" | 17 #include "chrome/browser/extensions/extension_host.h" |
| 18 #include "chrome/browser/extensions/extension_process_manager.h" | 18 #include "chrome/browser/extensions/extension_process_manager.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
| 21 #include "chrome/browser/ui/browser_window.h" | 21 #include "chrome/browser/ui/browser_window.h" |
| 22 #include "chrome/browser/ui/gtk/theme_service_gtk.h" | 22 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 23 #include "chrome/common/chrome_notification_types.h" | 23 #include "chrome/common/chrome_notification_types.h" |
| 24 #include "content/public/browser/notification_details.h" | 24 #include "content/public/browser/notification_details.h" |
| 25 #include "content/public/browser/notification_source.h" | 25 #include "content/public/browser/notification_source.h" |
| 26 #include "content/public/browser/render_view_host.h" | 26 #include "content/public/browser/render_view_host.h" |
| 27 #include "content/public/browser/render_widget_host_view.h" | 27 #include "content/public/browser/render_widget_host_view.h" |
| 28 #include "googleurl/src/gurl.h" | 28 #include "googleurl/src/gurl.h" |
| 29 | 29 |
| 30 using content::RenderViewHost; | 30 using content::RenderViewHost; |
| 31 | 31 |
| 32 ExtensionPopupGtk* ExtensionPopupGtk::current_extension_popup_ = NULL; | 32 ExtensionPopupGtk* ExtensionPopupGtk::current_extension_popup_ = NULL; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 BubbleGtk::ArrowLocationGtk arrow_location = | 175 BubbleGtk::ArrowLocationGtk arrow_location = |
| 176 !base::i18n::IsRTL() ? | 176 !base::i18n::IsRTL() ? |
| 177 BubbleGtk::ARROW_LOCATION_TOP_RIGHT : | 177 BubbleGtk::ARROW_LOCATION_TOP_RIGHT : |
| 178 BubbleGtk::ARROW_LOCATION_TOP_LEFT; | 178 BubbleGtk::ARROW_LOCATION_TOP_LEFT; |
| 179 bubble_ = BubbleGtk::Show(anchor_, | 179 bubble_ = BubbleGtk::Show(anchor_, |
| 180 NULL, | 180 NULL, |
| 181 host_->view()->native_view(), | 181 host_->view()->native_view(), |
| 182 arrow_location, | 182 arrow_location, |
| 183 false, // match_system_theme | 183 false, // match_system_theme |
| 184 true, // grab_input | 184 true, // grab_input |
| 185 ThemeServiceGtk::GetFrom(browser_->profile()), | 185 GtkThemeService::GetFrom(browser_->profile()), |
| 186 this); | 186 this); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void ExtensionPopupGtk::DestroyPopupWithoutResult() { | 189 void ExtensionPopupGtk::DestroyPopupWithoutResult() { |
| 190 DestroyPopup(); | 190 DestroyPopup(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 gfx::Rect ExtensionPopupGtk::GetViewBounds() { | 193 gfx::Rect ExtensionPopupGtk::GetViewBounds() { |
| 194 GtkAllocation allocation; | 194 GtkAllocation allocation; |
| 195 gtk_widget_get_allocation(host_->view()->native_view(), &allocation); | 195 gtk_widget_get_allocation(host_->view()->native_view(), &allocation); |
| 196 return gfx::Rect(allocation); | 196 return gfx::Rect(allocation); |
| 197 } | 197 } |
| OLD | NEW |