| 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 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 } | 334 } |
| 335 | 335 |
| 336 void ExtensionInstalledBubble::ShowInternal() { | 336 void ExtensionInstalledBubble::ShowInternal() { |
| 337 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); | 337 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); |
| 338 | 338 |
| 339 views::View* reference_view = NULL; | 339 views::View* reference_view = NULL; |
| 340 if (type_ == APP) { | 340 if (type_ == APP) { |
| 341 if (browser_view->IsTabStripVisible()) { | 341 if (browser_view->IsTabStripVisible()) { |
| 342 AbstractTabStripView* tabstrip = browser_view->tabstrip(); | 342 AbstractTabStripView* tabstrip = browser_view->tabstrip(); |
| 343 views::View* ntp_button = tabstrip->GetNewTabButton(); | 343 views::View* ntp_button = tabstrip->GetNewTabButton(); |
| 344 if (ntp_button && ntp_button->IsVisibleInRootView()) { | 344 if (ntp_button && ntp_button->IsDrawn()) { |
| 345 reference_view = ntp_button; | 345 reference_view = ntp_button; |
| 346 } else { | 346 } else { |
| 347 // Just have the bubble point at the tab strip. | 347 // Just have the bubble point at the tab strip. |
| 348 reference_view = tabstrip; | 348 reference_view = tabstrip; |
| 349 } | 349 } |
| 350 } | 350 } |
| 351 } else if (type_ == BROWSER_ACTION) { | 351 } else if (type_ == BROWSER_ACTION) { |
| 352 BrowserActionsContainer* container = | 352 BrowserActionsContainer* container = |
| 353 browser_view->GetToolbarView()->browser_actions(); | 353 browser_view->GetToolbarView()->browser_actions(); |
| 354 if (container->animating() && | 354 if (container->animating() && |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 } | 417 } |
| 418 | 418 |
| 419 void ExtensionInstalledBubble::WindowClosing() { | 419 void ExtensionInstalledBubble::WindowClosing() { |
| 420 if (extension_ && type_ == PAGE_ACTION) { | 420 if (extension_ && type_ == PAGE_ACTION) { |
| 421 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); | 421 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); |
| 422 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( | 422 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( |
| 423 extension_->page_action(), | 423 extension_->page_action(), |
| 424 false); // preview_enabled | 424 false); // preview_enabled |
| 425 } | 425 } |
| 426 } | 426 } |
| OLD | NEW |