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 "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" | 5 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/chrome_page_zoom.h" | 10 #include "chrome/browser/chrome_page_zoom.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // If the zoom change was initiated by an extension, capture the relevent | 86 // If the zoom change was initiated by an extension, capture the relevent |
87 // information from it. | 87 // information from it. |
88 if (client) { | 88 if (client) { |
89 zoom_bubble_->SetExtensionInfo( | 89 zoom_bubble_->SetExtensionInfo( |
90 static_cast<const extensions::ExtensionZoomRequestClient*>(client) | 90 static_cast<const extensions::ExtensionZoomRequestClient*>(client) |
91 ->extension()); | 91 ->extension()); |
92 } | 92 } |
93 | 93 |
94 // If we do not have an anchor view, parent the bubble to the content area. | 94 // If we do not have an anchor view, parent the bubble to the content area. |
95 if (!anchor_to_view) | 95 if (!anchor_to_view) |
96 zoom_bubble_->set_parent_window(web_contents->GetTopLevelNativeWindow()); | 96 zoom_bubble_->set_parent_window(web_contents->GetNativeView()); |
97 | 97 |
98 views::BubbleDelegateView::CreateBubble(zoom_bubble_); | 98 views::BubbleDelegateView::CreateBubble(zoom_bubble_); |
99 | 99 |
100 // Adjust for fullscreen after creation as it relies on the content size. | 100 // Adjust for fullscreen after creation as it relies on the content size. |
101 if (is_fullscreen) | 101 if (is_fullscreen) |
102 zoom_bubble_->AdjustForFullscreen(browser_view->GetBoundsInScreen()); | 102 zoom_bubble_->AdjustForFullscreen(browser_view->GetBoundsInScreen()); |
103 | 103 |
104 if (auto_close) | 104 if (auto_close) |
105 zoom_bubble_->GetWidget()->ShowInactive(); | 105 zoom_bubble_->GetWidget()->ShowInactive(); |
106 else | 106 else |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 void ZoomBubbleView::WindowClosing() { | 360 void ZoomBubbleView::WindowClosing() { |
361 // |zoom_bubble_| can be a new bubble by this point (as Close(); doesn't | 361 // |zoom_bubble_| can be a new bubble by this point (as Close(); doesn't |
362 // call this right away). Only set to NULL when it's this bubble. | 362 // call this right away). Only set to NULL when it's this bubble. |
363 if (zoom_bubble_ == this) | 363 if (zoom_bubble_ == this) |
364 zoom_bubble_ = NULL; | 364 zoom_bubble_ = NULL; |
365 } | 365 } |
366 | 366 |
367 ZoomBubbleView::ZoomBubbleExtensionInfo::ZoomBubbleExtensionInfo() {} | 367 ZoomBubbleView::ZoomBubbleExtensionInfo::ZoomBubbleExtensionInfo() {} |
368 | 368 |
369 ZoomBubbleView::ZoomBubbleExtensionInfo::~ZoomBubbleExtensionInfo() {} | 369 ZoomBubbleView::ZoomBubbleExtensionInfo::~ZoomBubbleExtensionInfo() {} |
OLD | NEW |