Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser_actions_container.h" | 5 #include "chrome/browser/views/browser_actions_container.h" |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 RemoveBrowserAction(Details<Extension>(details).ptr()); | 413 RemoveBrowserAction(Details<Extension>(details).ptr()); |
| 414 OnBrowserActionVisibilityChanged(); | 414 OnBrowserActionVisibilityChanged(); |
| 415 break; | 415 break; |
| 416 | 416 |
| 417 case NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE: | 417 case NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE: |
| 418 // If we aren't the host of the popup, then disregard the notification. | 418 // If we aren't the host of the popup, then disregard the notification. |
| 419 if (!popup_ || Details<ExtensionHost>(popup_->host()) != details) | 419 if (!popup_ || Details<ExtensionHost>(popup_->host()) != details) |
| 420 return; | 420 return; |
| 421 | 421 |
| 422 HidePopup(); | 422 HidePopup(); |
| 423 break; | |
| 423 | 424 |
| 424 default: | 425 default: |
| 425 NOTREACHED() << L"Unexpected notification"; | 426 NOTREACHED() << L"Unexpected notification"; |
|
Evan Stade
2009/11/03 20:11:53
while you're here, could you remove this unsightly
| |
| 426 } | 427 } |
| 427 } | 428 } |
| 428 | 429 |
| 429 void BrowserActionsContainer::BubbleBrowserWindowMoved(BrowserBubble* bubble) { | 430 void BrowserActionsContainer::BubbleBrowserWindowMoved(BrowserBubble* bubble) { |
| 430 } | 431 } |
| 431 | 432 |
| 432 void BrowserActionsContainer::BubbleBrowserWindowClosing( | 433 void BrowserActionsContainer::BubbleBrowserWindowClosing( |
| 433 BrowserBubble* bubble) { | 434 BrowserBubble* bubble) { |
| 434 HidePopup(); | 435 HidePopup(); |
| 435 } | 436 } |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 458 std::min(static_cast<int>(browser_action_views_.size()), | 459 std::min(static_cast<int>(browser_action_views_.size()), |
| 459 kMinimumNumberOfVisibleBrowserActions) * kButtonSize; | 460 kMinimumNumberOfVisibleBrowserActions) * kButtonSize; |
| 460 | 461 |
| 461 // Even if available_width is <= 0, we still return at least the |min_width|. | 462 // Even if available_width is <= 0, we still return at least the |min_width|. |
| 462 if (available_width <= 0) | 463 if (available_width <= 0) |
| 463 return min_width; | 464 return min_width; |
| 464 | 465 |
| 465 return std::max(min_width, available_width - available_width % kButtonSize + | 466 return std::max(min_width, available_width - available_width % kButtonSize + |
| 466 kHorizontalPadding * 2); | 467 kHorizontalPadding * 2); |
| 467 } | 468 } |
| OLD | NEW |