OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 BrowserActionsContainer* container = | 414 BrowserActionsContainer* container = |
415 browser_view->GetToolbarView()->browser_actions(); | 415 browser_view->GetToolbarView()->browser_actions(); |
416 if (container->animating() && | 416 if (container->animating() && |
417 animation_wait_retries_++ < kAnimationWaitMaxRetry) { | 417 animation_wait_retries_++ < kAnimationWaitMaxRetry) { |
418 // We don't know where the view will be until the container has stopped | 418 // We don't know where the view will be until the container has stopped |
419 // animating, so check back in a little while. | 419 // animating, so check back in a little while. |
420 MessageLoopForUI::current()->PostDelayedTask( | 420 MessageLoopForUI::current()->PostDelayedTask( |
421 FROM_HERE, | 421 FROM_HERE, |
422 base::Bind(&ExtensionInstalledBubble::ShowInternal, | 422 base::Bind(&ExtensionInstalledBubble::ShowInternal, |
423 base::Unretained(this)), | 423 base::Unretained(this)), |
424 kAnimationWaitTime); | 424 base::TimeDelta::FromMilliseconds(kAnimationWaitTime)); |
425 return; | 425 return; |
426 } | 426 } |
427 reference_view = container->GetBrowserActionView( | 427 reference_view = container->GetBrowserActionView( |
428 extension_->browser_action()); | 428 extension_->browser_action()); |
429 // If the view is not visible then it is in the chevron, so point the | 429 // If the view is not visible then it is in the chevron, so point the |
430 // install bubble to the chevron instead. If this is an incognito window, | 430 // install bubble to the chevron instead. If this is an incognito window, |
431 // both could be invisible. | 431 // both could be invisible. |
432 if (!reference_view || !reference_view->visible()) { | 432 if (!reference_view || !reference_view->visible()) { |
433 reference_view = container->chevron(); | 433 reference_view = container->chevron(); |
434 if (!reference_view || !reference_view->visible()) | 434 if (!reference_view || !reference_view->visible()) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 } | 474 } |
475 | 475 |
476 void ExtensionInstalledBubble::WindowClosing() { | 476 void ExtensionInstalledBubble::WindowClosing() { |
477 if (extension_ && type_ == PAGE_ACTION) { | 477 if (extension_ && type_ == PAGE_ACTION) { |
478 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); | 478 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); |
479 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( | 479 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( |
480 extension_->page_action(), | 480 extension_->page_action(), |
481 false); // preview_enabled | 481 false); // preview_enabled |
482 } | 482 } |
483 } | 483 } |
OLD | NEW |