| 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/bundle_installed_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/extensions/bundle_installed_bubble_gtk.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/i18n/rtl.h" |
| 11 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 12 #include "base/i18n/rtl.h" | |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" | 15 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" |
| 16 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 16 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 17 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | |
| 18 #include "chrome/browser/ui/gtk/gtk_util.h" | 17 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 18 #include "chrome/browser/ui/gtk/theme_service_gtk.h" |
| 19 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 20 #include "grit/theme_resources.h" | 20 #include "grit/theme_resources.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 22 #include "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
| 23 #include "ui/gfx/gtk_util.h" | 23 #include "ui/gfx/gtk_util.h" |
| 24 | 24 |
| 25 using extensions::BundleInstaller; | 25 using extensions::BundleInstaller; |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 57 ShowInternal(bundle); | 57 ShowInternal(bundle); |
| 58 } | 58 } |
| 59 | 59 |
| 60 BundleInstalledBubbleGtk::~BundleInstalledBubbleGtk() {} | 60 BundleInstalledBubbleGtk::~BundleInstalledBubbleGtk() {} |
| 61 | 61 |
| 62 void BundleInstalledBubbleGtk::ShowInternal(const BundleInstaller* bundle) { | 62 void BundleInstalledBubbleGtk::ShowInternal(const BundleInstaller* bundle) { |
| 63 BrowserWindowGtk* browser_window = | 63 BrowserWindowGtk* browser_window = |
| 64 BrowserWindowGtk::GetBrowserWindowForNativeWindow( | 64 BrowserWindowGtk::GetBrowserWindowForNativeWindow( |
| 65 browser_->window()->GetNativeHandle()); | 65 browser_->window()->GetNativeHandle()); |
| 66 | 66 |
| 67 GtkThemeService* theme_provider = GtkThemeService::GetFrom( | 67 ThemeServiceGtk* theme_provider = ThemeServiceGtk::GetFrom( |
| 68 browser_->profile()); | 68 browser_->profile()); |
| 69 | 69 |
| 70 // Anchor the bubble to the wrench menu. | 70 // Anchor the bubble to the wrench menu. |
| 71 GtkWidget* reference_widget = | 71 GtkWidget* reference_widget = |
| 72 browser_window->GetToolbar()->GetAppMenuButton(); | 72 browser_window->GetToolbar()->GetAppMenuButton(); |
| 73 | 73 |
| 74 GtkWidget* bubble_content = gtk_hbox_new(FALSE, kHorizontalColumnSpacing); | 74 GtkWidget* bubble_content = gtk_hbox_new(FALSE, kHorizontalColumnSpacing); |
| 75 gtk_container_set_border_width( | 75 gtk_container_set_border_width( |
| 76 GTK_CONTAINER(bubble_content), kContentPadding); | 76 GTK_CONTAINER(bubble_content), kContentPadding); |
| 77 | 77 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 Release(); // Balanced in BundleInstalledBubbleGtk(). | 148 Release(); // Balanced in BundleInstalledBubbleGtk(). |
| 149 } | 149 } |
| 150 | 150 |
| 151 void BundleInstalledBubbleGtk::OnButtonClick(GtkWidget* button, | 151 void BundleInstalledBubbleGtk::OnButtonClick(GtkWidget* button, |
| 152 BundleInstalledBubbleGtk* bubble) { | 152 BundleInstalledBubbleGtk* bubble) { |
| 153 if (button == bubble->close_button_->widget()) | 153 if (button == bubble->close_button_->widget()) |
| 154 bubble->bubble_->Close(); | 154 bubble->bubble_->Close(); |
| 155 else | 155 else |
| 156 NOTREACHED(); | 156 NOTREACHED(); |
| 157 } | 157 } |
| OLD | NEW |