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

Side by Side Diff: chrome/browser/chromeos/ui/setting_level_bubble.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
« no previous file with comments | « chrome/browser/chromeos/media/media_player.cc ('k') | chrome/browser/metrics/metrics_log.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/chromeos/ui/setting_level_bubble.h" 5 #include "chrome/browser/chromeos/ui/setting_level_bubble.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "chrome/browser/chromeos/login/base_login_display_host.h" 10 #include "chrome/browser/chromeos/login/base_login_display_host.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 SettingLevelBubbleView* view_; 75 SettingLevelBubbleView* view_;
76 76
77 DISALLOW_COPY_AND_ASSIGN(SettingLevelBubbleDelegateView); 77 DISALLOW_COPY_AND_ASSIGN(SettingLevelBubbleDelegateView);
78 }; 78 };
79 79
80 gfx::Rect SettingLevelBubbleDelegateView::GetAnchorRect() { 80 gfx::Rect SettingLevelBubbleDelegateView::GetAnchorRect() {
81 gfx::Size view_size = GetPreferredSize(); 81 gfx::Size view_size = GetPreferredSize();
82 // Calculate the position in screen coordinates that the bubble should 82 // Calculate the position in screen coordinates that the bubble should
83 // "point" at (since we use BubbleBorder::FLOAT, this position actually 83 // "point" at (since we use BubbleBorder::FLOAT, this position actually
84 // specifies the center of the bubble). 84 // specifies the center of the bubble).
85 gfx::Rect monitor_area = gfx::Screen::GetMonitorAreaNearestWindow(NULL); 85 gfx::Rect monitor_area = gfx::Screen::GetPrimaryMonitor().bounds();
86 return (gfx::Rect( 86 return (gfx::Rect(
87 monitor_area.x() + kBubbleXRatio * monitor_area.width(), 87 monitor_area.x() + kBubbleXRatio * monitor_area.width(),
88 monitor_area.bottom() - view_size.height() / 2 - kBubbleBottomGap, 0, 0)); 88 monitor_area.bottom() - view_size.height() / 2 - kBubbleBottomGap, 0, 0));
89 } 89 }
90 90
91 SettingLevelBubbleDelegateView::SettingLevelBubbleDelegateView() 91 SettingLevelBubbleDelegateView::SettingLevelBubbleDelegateView()
92 : BubbleDelegateView(NULL, views::BubbleBorder::FLOAT), 92 : BubbleDelegateView(NULL, views::BubbleBorder::FLOAT),
93 view_(NULL) { 93 view_(NULL) {
94 set_close_on_esc(false); 94 set_close_on_esc(false);
95 set_use_focusless(true); 95 set_use_focusless(true);
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 259
260 last_target_update_time_ = now; 260 last_target_update_time_ = now;
261 } 261 }
262 262
263 void SettingLevelBubble::StopAnimation() { 263 void SettingLevelBubble::StopAnimation() {
264 animation_timer_.Stop(); 264 animation_timer_.Stop();
265 is_animating_ = false; 265 is_animating_ = false;
266 } 266 }
267 267
268 } // namespace chromeos 268 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/media/media_player.cc ('k') | chrome/browser/metrics/metrics_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698