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/views/extensions/extension_installed_bubble.h" | 5 #include "chrome/browser/ui/views/extensions/extension_installed_bubble.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // to wait on showing the Bubble until not only the EXTENSION_LOADED gets | 263 // to wait on showing the Bubble until not only the EXTENSION_LOADED gets |
264 // fired, but all of the EXTENSION_LOADED Observers have run. Only then can we | 264 // fired, but all of the EXTENSION_LOADED Observers have run. Only then can we |
265 // be sure that a BrowserAction or PageAction has had views created which we | 265 // be sure that a BrowserAction or PageAction has had views created which we |
266 // can inspect for the purpose of previewing of pointing to them. | 266 // can inspect for the purpose of previewing of pointing to them. |
267 registrar_.Add(this, NotificationType::EXTENSION_LOADED, | 267 registrar_.Add(this, NotificationType::EXTENSION_LOADED, |
268 Source<Profile>(browser->profile())); | 268 Source<Profile>(browser->profile())); |
269 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, | 269 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, |
270 Source<Profile>(browser->profile())); | 270 Source<Profile>(browser->profile())); |
271 } | 271 } |
272 | 272 |
| 273 ExtensionInstalledBubble::~ExtensionInstalledBubble() {} |
| 274 |
273 void ExtensionInstalledBubble::Observe(NotificationType type, | 275 void ExtensionInstalledBubble::Observe(NotificationType type, |
274 const NotificationSource& source, | 276 const NotificationSource& source, |
275 const NotificationDetails& details) { | 277 const NotificationDetails& details) { |
276 if (type == NotificationType::EXTENSION_LOADED) { | 278 if (type == NotificationType::EXTENSION_LOADED) { |
277 const Extension* extension = Details<const Extension>(details).ptr(); | 279 const Extension* extension = Details<const Extension>(details).ptr(); |
278 if (extension == extension_) { | 280 if (extension == extension_) { |
279 animation_wait_retries_ = 0; | 281 animation_wait_retries_ = 0; |
280 // PostTask to ourself to allow all EXTENSION_LOADED Observers to run. | 282 // PostTask to ourself to allow all EXTENSION_LOADED Observers to run. |
281 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, | 283 MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, |
282 &ExtensionInstalledBubble::ShowInternal)); | 284 &ExtensionInstalledBubble::ShowInternal)); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 if (extension_ && type_ == PAGE_ACTION) { | 365 if (extension_ && type_ == PAGE_ACTION) { |
364 BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( | 366 BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( |
365 browser_->window()->GetNativeHandle()); | 367 browser_->window()->GetNativeHandle()); |
366 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( | 368 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( |
367 extension_->page_action(), | 369 extension_->page_action(), |
368 false); // preview_enabled | 370 false); // preview_enabled |
369 } | 371 } |
370 | 372 |
371 Release(); // Balanced in ctor. | 373 Release(); // Balanced in ctor. |
372 } | 374 } |
| 375 |
| 376 bool ExtensionInstalledBubble::CloseOnEscape() { |
| 377 return true; |
| 378 } |
| 379 |
| 380 bool ExtensionInstalledBubble::FadeInOnShow() { |
| 381 return true; |
| 382 } |
OLD | NEW |