Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: chrome/browser/ui/panels/panel_browsertest.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 params.body = ASCIIToUTF16("Text"); 1627 params.body = ASCIIToUTF16("Text");
1628 params.direction = WebKit::WebTextDirectionDefault; 1628 params.direction = WebKit::WebTextDirectionDefault;
1629 return params; 1629 return params;
1630 } 1630 }
1631 1631
1632 int GetBalloonBottomPosition(Balloon* balloon) const { 1632 int GetBalloonBottomPosition(Balloon* balloon) const {
1633 #if defined(OS_MACOSX) 1633 #if defined(OS_MACOSX)
1634 // The position returned by the notification balloon is based on Mac's 1634 // The position returned by the notification balloon is based on Mac's
1635 // vertically inverted orientation. We need to flip it so that it can 1635 // vertically inverted orientation. We need to flip it so that it can
1636 // be compared against the position returned by the panel. 1636 // be compared against the position returned by the panel.
1637 gfx::Size screen_size = gfx::Screen::GetPrimaryMonitorSize(); 1637 gfx::Size screen_size = gfx::Screen::GetPrimaryMonitor().size();
1638 return screen_size.height() - balloon->GetPosition().y(); 1638 return screen_size.height() - balloon->GetPosition().y();
1639 #else 1639 #else
1640 return balloon->GetPosition().y() + balloon->GetViewSize().height(); 1640 return balloon->GetPosition().y() + balloon->GetViewSize().height();
1641 #endif 1641 #endif
1642 } 1642 }
1643 1643
1644 DesktopNotificationService* service() const { return service_.get(); } 1644 DesktopNotificationService* service() const { return service_.get(); }
1645 const BalloonCollection::Balloons& balloons() const { 1645 const BalloonCollection::Balloons& balloons() const {
1646 return balloons_->GetActiveBalloons(); 1646 return balloons_->GetActiveBalloons();
1647 } 1647 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 // position when tall panel brings up its titlebar. 1743 // position when tall panel brings up its titlebar.
1744 CloseWindowAndWait(panel1->browser()); 1744 CloseWindowAndWait(panel1->browser());
1745 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up, 1745 EXPECT_EQ(balloon_bottom_after_tall_panel_titlebar_up,
1746 GetBalloonBottomPosition(balloon)); 1746 GetBalloonBottomPosition(balloon));
1747 1747
1748 // Closing the remaining tall panel should move the notification balloon back 1748 // Closing the remaining tall panel should move the notification balloon back
1749 // to its original position. 1749 // to its original position.
1750 CloseWindowAndWait(panel2->browser()); 1750 CloseWindowAndWait(panel2->browser());
1751 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon)); 1751 EXPECT_EQ(original_balloon_bottom, GetBalloonBottomPosition(balloon));
1752 } 1752 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/display_settings_provider.cc ('k') | chrome/browser/ui/pdf/pdf_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698