| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_installed_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 137 } |
| 138 | 138 |
| 139 reference_widget = toolbar->GetBrowserActionWidget(extension_); | 139 reference_widget = toolbar->GetBrowserActionWidget(extension_); |
| 140 // glib delays recalculating layout, but we need reference_widget to know | 140 // glib delays recalculating layout, but we need reference_widget to know |
| 141 // its coordinates, so we force a check_resize here. | 141 // its coordinates, so we force a check_resize here. |
| 142 gtk_container_check_resize(GTK_CONTAINER( | 142 gtk_container_check_resize(GTK_CONTAINER( |
| 143 browser_window->GetToolbar()->widget())); | 143 browser_window->GetToolbar()->widget())); |
| 144 // If the widget is not visible then browser_window could be incognito | 144 // If the widget is not visible then browser_window could be incognito |
| 145 // with this extension disabled. Try showing it on the chevron. | 145 // with this extension disabled. Try showing it on the chevron. |
| 146 // If that fails, fall back to default position. | 146 // If that fails, fall back to default position. |
| 147 if (reference_widget && !gtk_widget_get_visible(reference_widget)) { | 147 if (reference_widget && !GTK_WIDGET_VISIBLE(reference_widget)) { |
| 148 reference_widget = gtk_widget_get_visible(toolbar->chevron()) ? | 148 reference_widget = GTK_WIDGET_VISIBLE(toolbar->chevron()) ? |
| 149 toolbar->chevron() : NULL; | 149 toolbar->chevron() : NULL; |
| 150 } | 150 } |
| 151 } else if (type_ == PAGE_ACTION) { | 151 } else if (type_ == PAGE_ACTION) { |
| 152 LocationBarViewGtk* location_bar_view = | 152 LocationBarViewGtk* location_bar_view = |
| 153 browser_window->GetToolbar()->GetLocationBarView(); | 153 browser_window->GetToolbar()->GetLocationBarView(); |
| 154 location_bar_view->SetPreviewEnabledPageAction(extension_->page_action(), | 154 location_bar_view->SetPreviewEnabledPageAction(extension_->page_action(), |
| 155 true); // preview_enabled | 155 true); // preview_enabled |
| 156 reference_widget = location_bar_view->GetPageActionWidget( | 156 reference_widget = location_bar_view->GetPageActionWidget( |
| 157 extension_->page_action()); | 157 extension_->page_action()); |
| 158 // glib delays recalculating layout, but we need reference_widget to know | 158 // glib delays recalculating layout, but we need reference_widget to know |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 // the window before we call Release() because close_button_ depends | 313 // the window before we call Release() because close_button_ depends |
| 314 // on all references being cleared before it is destroyed. | 314 // on all references being cleared before it is destroyed. |
| 315 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, | 315 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, |
| 316 &ExtensionInstalledBubbleGtk::Close)); | 316 &ExtensionInstalledBubbleGtk::Close)); |
| 317 } | 317 } |
| 318 | 318 |
| 319 void ExtensionInstalledBubbleGtk::Close() { | 319 void ExtensionInstalledBubbleGtk::Close() { |
| 320 Release(); // Balanced in ctor. | 320 Release(); // Balanced in ctor. |
| 321 bubble_ = NULL; | 321 bubble_ = NULL; |
| 322 } | 322 } |
| OLD | NEW |