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/views/extensions/extension_installed_bubble.h" | 5 #include "chrome/browser/views/extensions/extension_installed_bubble.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/i18n/rtl.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 const NotificationDetails& details) { | 261 const NotificationDetails& details) { |
262 if (type == NotificationType::EXTENSION_LOADED) { | 262 if (type == NotificationType::EXTENSION_LOADED) { |
263 const Extension* extension = Details<const Extension>(details).ptr(); | 263 const Extension* extension = Details<const Extension>(details).ptr(); |
264 if (extension == extension_) { | 264 if (extension == extension_) { |
265 animation_wait_retries_ = 0; | 265 animation_wait_retries_ = 0; |
266 // PostTask to ourself to allow all EXTENSION_LOADED Observers to run. | 266 // PostTask to ourself to allow all EXTENSION_LOADED Observers to run. |
267 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, | 267 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, |
268 &ExtensionInstalledBubble::ShowInternal)); | 268 &ExtensionInstalledBubble::ShowInternal)); |
269 } | 269 } |
270 } else if (type == NotificationType::EXTENSION_UNLOADED) { | 270 } else if (type == NotificationType::EXTENSION_UNLOADED) { |
271 const Extension* extension = Details<const Extension>(details).ptr(); | 271 const Extension* extension = |
| 272 Details<UnloadedExtensionInfo>(details)->extension; |
272 if (extension == extension_) | 273 if (extension == extension_) |
273 extension_ = NULL; | 274 extension_ = NULL; |
274 } else { | 275 } else { |
275 NOTREACHED() << L"Received unexpected notification"; | 276 NOTREACHED() << L"Received unexpected notification"; |
276 } | 277 } |
277 } | 278 } |
278 | 279 |
279 void ExtensionInstalledBubble::ShowInternal() { | 280 void ExtensionInstalledBubble::ShowInternal() { |
280 BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( | 281 BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( |
281 browser_->window()->GetNativeHandle()); | 282 browser_->window()->GetNativeHandle()); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 if (extension_ && type_ == PAGE_ACTION) { | 349 if (extension_ && type_ == PAGE_ACTION) { |
349 BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( | 350 BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( |
350 browser_->window()->GetNativeHandle()); | 351 browser_->window()->GetNativeHandle()); |
351 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( | 352 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( |
352 extension_->page_action(), | 353 extension_->page_action(), |
353 false); // preview_enabled | 354 false); // preview_enabled |
354 } | 355 } |
355 | 356 |
356 Release(); // Balanced in ctor. | 357 Release(); // Balanced in ctor. |
357 } | 358 } |
OLD | NEW |