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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 } | 105 } |
106 | 106 |
107 // static | 107 // static |
108 void ZoomBubbleView::CloseBubble() { | 108 void ZoomBubbleView::CloseBubble() { |
109 if (zoom_bubble_) | 109 if (zoom_bubble_) |
110 zoom_bubble_->Close(); | 110 zoom_bubble_->Close(); |
111 } | 111 } |
112 | 112 |
113 // static | 113 // static |
114 bool ZoomBubbleView::IsShowing() { | 114 bool ZoomBubbleView::IsShowing() { |
115 // The bubble may be in the process of closing. | 115 // The bubble is considered showing while closing. |
116 return zoom_bubble_ != NULL && zoom_bubble_->GetWidget()->IsVisible(); | 116 return zoom_bubble_ != NULL && (zoom_bubble_->GetWidget()->IsVisible() || |
| 117 zoom_bubble_->GetWidget()->IsClosed()); |
117 } | 118 } |
118 | 119 |
119 // static | 120 // static |
120 const ZoomBubbleView* ZoomBubbleView::GetZoomBubbleForTest() { | 121 const ZoomBubbleView* ZoomBubbleView::GetZoomBubbleForTest() { |
121 return zoom_bubble_; | 122 return zoom_bubble_; |
122 } | 123 } |
123 | 124 |
124 ZoomBubbleView::ZoomBubbleView( | 125 ZoomBubbleView::ZoomBubbleView( |
125 views::View* anchor_view, | 126 views::View* anchor_view, |
126 content::WebContents* web_contents, | 127 content::WebContents* web_contents, |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 void ZoomBubbleView::WindowClosing() { | 353 void ZoomBubbleView::WindowClosing() { |
353 // |zoom_bubble_| can be a new bubble by this point (as Close(); doesn't | 354 // |zoom_bubble_| can be a new bubble by this point (as Close(); doesn't |
354 // call this right away). Only set to NULL when it's this bubble. | 355 // call this right away). Only set to NULL when it's this bubble. |
355 if (zoom_bubble_ == this) | 356 if (zoom_bubble_ == this) |
356 zoom_bubble_ = NULL; | 357 zoom_bubble_ = NULL; |
357 } | 358 } |
358 | 359 |
359 ZoomBubbleView::ZoomBubbleExtensionInfo::ZoomBubbleExtensionInfo() {} | 360 ZoomBubbleView::ZoomBubbleExtensionInfo::ZoomBubbleExtensionInfo() {} |
360 | 361 |
361 ZoomBubbleView::ZoomBubbleExtensionInfo::~ZoomBubbleExtensionInfo() {} | 362 ZoomBubbleView::ZoomBubbleExtensionInfo::~ZoomBubbleExtensionInfo() {} |
OLD | NEW |