| 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/extension_installed_bubble_gtk.h" | 5 #include "chrome/browser/gtk/extension_installed_bubble_gtk.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/i18n/rtl.h" |
| 9 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 10 #include "chrome/browser/browser.h" | 11 #include "chrome/browser/browser.h" |
| 11 #include "chrome/browser/gtk/browser_actions_toolbar_gtk.h" | 12 #include "chrome/browser/gtk/browser_actions_toolbar_gtk.h" |
| 12 #include "chrome/browser/gtk/browser_toolbar_gtk.h" | 13 #include "chrome/browser/gtk/browser_toolbar_gtk.h" |
| 13 #include "chrome/browser/gtk/browser_window_gtk.h" | 14 #include "chrome/browser/gtk/browser_window_gtk.h" |
| 14 #include "chrome/browser/gtk/gtk_theme_provider.h" | 15 #include "chrome/browser/gtk/gtk_theme_provider.h" |
| 15 #include "chrome/browser/gtk/gtk_util.h" | 16 #include "chrome/browser/gtk/gtk_util.h" |
| 16 #include "chrome/browser/gtk/location_bar_view_gtk.h" | 17 #include "chrome/browser/gtk/location_bar_view_gtk.h" |
| 17 #include "chrome/common/extensions/extension.h" | 18 #include "chrome/common/extensions/extension.h" |
| 18 #include "chrome/common/notification_service.h" | 19 #include "chrome/common/notification_service.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 G_CALLBACK(OnButtonClick), this); | 196 G_CALLBACK(OnButtonClick), this); |
| 196 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 197 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 197 close_button_->SetBackground( | 198 close_button_->SetBackground( |
| 198 theme_provider->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT), | 199 theme_provider->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT), |
| 199 rb.GetBitmapNamed(IDR_CLOSE_BAR), | 200 rb.GetBitmapNamed(IDR_CLOSE_BAR), |
| 200 rb.GetBitmapNamed(IDR_CLOSE_BAR_MASK)); | 201 rb.GetBitmapNamed(IDR_CLOSE_BAR_MASK)); |
| 201 gtk_box_pack_start(GTK_BOX(close_column), close_button_->widget(), | 202 gtk_box_pack_start(GTK_BOX(close_column), close_button_->widget(), |
| 202 FALSE, FALSE, 0); | 203 FALSE, FALSE, 0); |
| 203 | 204 |
| 204 InfoBubbleGtk::ArrowLocationGtk arrow_location = | 205 InfoBubbleGtk::ArrowLocationGtk arrow_location = |
| 205 (l10n_util::GetTextDirection() == l10n_util::LEFT_TO_RIGHT) ? | 206 !base::i18n::IsRTL() ? |
| 206 InfoBubbleGtk::ARROW_LOCATION_TOP_RIGHT : | 207 InfoBubbleGtk::ARROW_LOCATION_TOP_RIGHT : |
| 207 InfoBubbleGtk::ARROW_LOCATION_TOP_LEFT; | 208 InfoBubbleGtk::ARROW_LOCATION_TOP_LEFT; |
| 208 info_bubble_ = InfoBubbleGtk::Show(browser_window->window(), | 209 info_bubble_ = InfoBubbleGtk::Show(browser_window->window(), |
| 209 bounds, | 210 bounds, |
| 210 bubble_content, | 211 bubble_content, |
| 211 arrow_location, | 212 arrow_location, |
| 212 true, | 213 true, |
| 213 theme_provider, | 214 theme_provider, |
| 214 this); | 215 this); |
| 215 } | 216 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 241 // the window before we call Release() because close_button_ depends | 242 // the window before we call Release() because close_button_ depends |
| 242 // on all references being cleared before it is destroyed. | 243 // on all references being cleared before it is destroyed. |
| 243 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, | 244 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, |
| 244 &ExtensionInstalledBubbleGtk::Close)); | 245 &ExtensionInstalledBubbleGtk::Close)); |
| 245 } | 246 } |
| 246 | 247 |
| 247 void ExtensionInstalledBubbleGtk::Close() { | 248 void ExtensionInstalledBubbleGtk::Close() { |
| 248 Release(); // Balanced in ctor. | 249 Release(); // Balanced in ctor. |
| 249 info_bubble_ = NULL; | 250 info_bubble_ = NULL; |
| 250 } | 251 } |
| OLD | NEW |