| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/download/download_service.h" | 8 #include "chrome/browser/download/download_service.h" |
| 9 #include "chrome/browser/download/download_service_factory.h" | 9 #include "chrome/browser/download/download_service_factory.h" |
| 10 #include "chrome/browser/net/url_request_mock_util.h" | 10 #include "chrome/browser/net/url_request_mock_util.h" |
| (...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1635 params.body = ASCIIToUTF16("Text"); | 1635 params.body = ASCIIToUTF16("Text"); |
| 1636 params.direction = WebKit::WebTextDirectionDefault; | 1636 params.direction = WebKit::WebTextDirectionDefault; |
| 1637 return params; | 1637 return params; |
| 1638 } | 1638 } |
| 1639 | 1639 |
| 1640 int GetBalloonBottomPosition(Balloon* balloon) const { | 1640 int GetBalloonBottomPosition(Balloon* balloon) const { |
| 1641 #if defined(OS_MACOSX) | 1641 #if defined(OS_MACOSX) |
| 1642 // The position returned by the notification balloon is based on Mac's | 1642 // The position returned by the notification balloon is based on Mac's |
| 1643 // vertically inverted orientation. We need to flip it so that it can | 1643 // vertically inverted orientation. We need to flip it so that it can |
| 1644 // be compared against the position returned by the panel. | 1644 // be compared against the position returned by the panel. |
| 1645 gfx::Size screen_size = gfx::Screen::GetPrimaryMonitorSize(); | 1645 gfx::Size screen_size = gfx::Screen::GetPrimaryMonitorBounds().size(); |
| 1646 return screen_size.height() - balloon->GetPosition().y(); | 1646 return screen_size.height() - balloon->GetPosition().y(); |
| 1647 #else | 1647 #else |
| 1648 return balloon->GetPosition().y() + balloon->GetViewSize().height(); | 1648 return balloon->GetPosition().y() + balloon->GetViewSize().height(); |
| 1649 #endif | 1649 #endif |
| 1650 } | 1650 } |
| 1651 | 1651 |
| 1652 DesktopNotificationService* service() const { return service_.get(); } | 1652 DesktopNotificationService* service() const { return service_.get(); } |
| 1653 const BalloonCollection::Balloons& balloons() const { | 1653 const BalloonCollection::Balloons& balloons() const { |
| 1654 return balloons_->GetActiveBalloons(); | 1654 return balloons_->GetActiveBalloons(); |
| 1655 } | 1655 } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1751 // position when tall panel brings up its titlebar. | 1751 // position when tall panel brings up its titlebar. |
| 1752 CloseWindowAndWait(panel1->browser()); | 1752 CloseWindowAndWait(panel1->browser()); |
| 1753 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up, | 1753 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up, |
| 1754 GetBalloonBottomPosition(balloon)); | 1754 GetBalloonBottomPosition(balloon)); |
| 1755 | 1755 |
| 1756 // Closing the remaining tall panel should move the notification balloon back | 1756 // Closing the remaining tall panel should move the notification balloon back |
| 1757 // to its original position. | 1757 // to its original position. |
| 1758 CloseWindowAndWait(panel2->browser()); | 1758 CloseWindowAndWait(panel2->browser()); |
| 1759 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon)); | 1759 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon)); |
| 1760 } | 1760 } |
| OLD | NEW |