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

Unified Diff: chrome/browser/ui/views/exclusive_access_bubble_views.cc

Issue 1579813002: PoC: Using the toolkit-views fullscreen access bubble on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refine Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/exclusive_access_bubble_views.cc
diff --git a/chrome/browser/ui/views/exclusive_access_bubble_views.cc b/chrome/browser/ui/views/exclusive_access_bubble_views.cc
index 502849025c2369703cbfad0126685971602f632d..160ae8c6a0c6e38d3938d82865879c52148da229 100644
--- a/chrome/browser/ui/views/exclusive_access_bubble_views.cc
+++ b/chrome/browser/ui/views/exclusive_access_bubble_views.cc
@@ -399,8 +399,7 @@ ExclusiveAccessBubbleViews::ExclusiveAccessBubbleViews(
// Create the contents view.
ui::Accelerator accelerator(ui::VKEY_UNKNOWN, ui::EF_NONE);
bool got_accelerator =
- bubble_view_context_->GetBubbleAssociatedWidget()->GetAccelerator(
- IDC_FULLSCREEN, &accelerator);
+ bubble_view_context_->GetAccelerator2(IDC_FULLSCREEN, &accelerator);
DCHECK(got_accelerator);
view_ = new ExclusiveAccessView(this, accelerator.GetShortcutText(), url,
bubble_type_);
@@ -413,8 +412,7 @@ ExclusiveAccessBubbleViews::ExclusiveAccessBubbleViews(
views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
- params.parent =
- bubble_view_context_->GetBubbleAssociatedWidget()->GetNativeView();
+ params.parent = bubble_view_context_->GetNativeView();
// The simplified UI just shows a notice; clicks should go through to the
// underlying window.
params.accept_events =
@@ -543,10 +541,6 @@ void ExclusiveAccessBubbleViews::UpdateBounds() {
}
}
-views::View* ExclusiveAccessBubbleViews::GetBrowserRootView() const {
- return bubble_view_context_->GetBubbleAssociatedWidget()->GetRootView();
-}
-
void ExclusiveAccessBubbleViews::AnimationProgressed(
const gfx::Animation* animation) {
if (animated_attribute_ == ANIMATED_ATTRIBUTE_OPACITY) {
@@ -575,8 +569,7 @@ void ExclusiveAccessBubbleViews::AnimationEnded(
gfx::Rect ExclusiveAccessBubbleViews::GetPopupRect(
bool ignore_animation_state) const {
gfx::Size size(view_->GetPreferredSize());
- gfx::Rect widget_bounds = bubble_view_context_->GetBubbleAssociatedWidget()
- ->GetClientAreaBoundsInScreen();
+ gfx::Rect widget_bounds = bubble_view_context_->GetClientAreaBoundsInScreen();
int x = widget_bounds.x() + (widget_bounds.width() - size.width()) / 2;
int top_container_bottom = widget_bounds.y();
@@ -612,20 +605,15 @@ gfx::Rect ExclusiveAccessBubbleViews::GetPopupRect(
}
gfx::Point ExclusiveAccessBubbleViews::GetCursorScreenPoint() {
- gfx::Point cursor_pos =
- gfx::Screen::GetScreenFor(
- bubble_view_context_->GetBubbleAssociatedWidget()->GetNativeView())
- ->GetCursorScreenPoint();
- views::View::ConvertPointFromScreen(GetBrowserRootView(), &cursor_pos);
- return cursor_pos;
+ return bubble_view_context_->GetCursorScreenPoint();
}
bool ExclusiveAccessBubbleViews::WindowContainsPoint(gfx::Point pos) {
- return GetBrowserRootView()->HitTestPoint(pos);
+ return bubble_view_context_->HitTestPoint(pos);
}
bool ExclusiveAccessBubbleViews::IsWindowActive() {
- return bubble_view_context_->GetBubbleAssociatedWidget()->IsActive();
+ return bubble_view_context_->IsParentActive();
}
void ExclusiveAccessBubbleViews::Hide() {

Powered by Google App Engine
This is Rietveld 408576698