| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 const NotificationSource& source, | 88 const NotificationSource& source, |
| 89 const NotificationDetails& details) { | 89 const NotificationDetails& details) { |
| 90 if (type == NotificationType::EXTENSION_LOADED) { | 90 if (type == NotificationType::EXTENSION_LOADED) { |
| 91 const Extension* extension = Details<const Extension>(details).ptr(); | 91 const Extension* extension = Details<const Extension>(details).ptr(); |
| 92 if (extension == extension_) { | 92 if (extension == extension_) { |
| 93 // PostTask to ourself to allow all EXTENSION_LOADED Observers to run. | 93 // PostTask to ourself to allow all EXTENSION_LOADED Observers to run. |
| 94 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, | 94 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, |
| 95 &ExtensionInstalledBubbleGtk::ShowInternal)); | 95 &ExtensionInstalledBubbleGtk::ShowInternal)); |
| 96 } | 96 } |
| 97 } else if (type == NotificationType::EXTENSION_UNLOADED) { | 97 } else if (type == NotificationType::EXTENSION_UNLOADED) { |
| 98 const Extension* extension = Details<const Extension>(details).ptr(); | 98 const Extension* extension = |
| 99 Details<UnloadedExtensionInfo>(details)->extension; |
| 99 if (extension == extension_) | 100 if (extension == extension_) |
| 100 extension_ = NULL; | 101 extension_ = NULL; |
| 101 } else { | 102 } else { |
| 102 NOTREACHED() << L"Received unexpected notification"; | 103 NOTREACHED() << L"Received unexpected notification"; |
| 103 } | 104 } |
| 104 } | 105 } |
| 105 | 106 |
| 106 void ExtensionInstalledBubbleGtk::ShowInternal() { | 107 void ExtensionInstalledBubbleGtk::ShowInternal() { |
| 107 BrowserWindowGtk* browser_window = | 108 BrowserWindowGtk* browser_window = |
| 108 BrowserWindowGtk::GetBrowserWindowForNativeWindow( | 109 BrowserWindowGtk::GetBrowserWindowForNativeWindow( |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 // the window before we call Release() because close_button_ depends | 305 // the window before we call Release() because close_button_ depends |
| 305 // on all references being cleared before it is destroyed. | 306 // on all references being cleared before it is destroyed. |
| 306 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, | 307 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, |
| 307 &ExtensionInstalledBubbleGtk::Close)); | 308 &ExtensionInstalledBubbleGtk::Close)); |
| 308 } | 309 } |
| 309 | 310 |
| 310 void ExtensionInstalledBubbleGtk::Close() { | 311 void ExtensionInstalledBubbleGtk::Close() { |
| 311 Release(); // Balanced in ctor. | 312 Release(); // Balanced in ctor. |
| 312 info_bubble_ = NULL; | 313 info_bubble_ = NULL; |
| 313 } | 314 } |
| OLD | NEW |