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

Unified Diff: chrome/browser/ui/views/location_bar/zoom_bubble_view.cc

Issue 2394143004: Harmony - Update anchors for the rest of the location bar icons that (Closed)
Patch Set: Created 4 years, 2 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/location_bar/zoom_bubble_view.cc
diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
index 51ca14f5b0bc371ce41780dd0e0021322bd31bd4..a04787c1f3a3d3406a6e89c45bc2035528c38282 100644
--- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
@@ -34,7 +34,7 @@
#include "ui/views/widget/widget.h"
// static
-ZoomBubbleView* ZoomBubbleView::zoom_bubble_ = NULL;
+ZoomBubbleView* ZoomBubbleView::zoom_bubble_ = nullptr;
// static
void ZoomBubbleView::ShowBubble(content::WebContents* web_contents,
@@ -47,8 +47,8 @@ void ZoomBubbleView::ShowBubble(content::WebContents* web_contents,
bool is_fullscreen = browser_view->IsFullscreen();
bool anchor_to_view = !is_fullscreen ||
browser_view->immersive_mode_controller()->IsRevealed();
- ZoomView* anchor_view = anchor_to_view ?
- browser_view->GetLocationBarView()->zoom_view() : NULL;
+ views::View* anchor_view =
msw 2016/10/11 17:04:54 Should this still anchor to the zoom_view if not u
Evan Stade 2016/10/11 23:49:50 yes, thanks for catching.
+ anchor_to_view ? browser_view->GetLocationBarView() : nullptr;
// Find the extension that initiated the zoom change, if any.
zoom::ZoomController* zoom_controller =
@@ -85,8 +85,10 @@ void ZoomBubbleView::ShowBubble(content::WebContents* web_contents,
views::Widget* zoom_bubble_widget =
views::BubbleDialogDelegateView::CreateBubble(zoom_bubble_);
- if (anchor_view)
- zoom_bubble_widget->AddObserver(anchor_view);
+ if (anchor_to_view) {
+ zoom_bubble_widget->AddObserver(
+ browser_view->GetLocationBarView()->zoom_view());
+ }
// Adjust for fullscreen after creation as it relies on the content size.
if (is_fullscreen)
@@ -112,8 +114,8 @@ ZoomBubbleView::ZoomBubbleView(
DisplayReason reason,
ImmersiveModeController* immersive_mode_controller)
: LocationBarBubbleDelegateView(anchor_view, web_contents),
- image_button_(NULL),
- label_(NULL),
+ image_button_(nullptr),
+ label_(nullptr),
web_contents_(web_contents),
auto_close_(reason == AUTOMATIC),
immersive_mode_controller_(immersive_mode_controller) {
@@ -200,16 +202,16 @@ void ZoomBubbleView::Init() {
void ZoomBubbleView::WindowClosing() {
// |zoom_bubble_| can be a new bubble by this point (as Close(); doesn't
- // call this right away). Only set to NULL when it's this bubble.
+ // call this right away). Only set to nullptr when it's this bubble.
if (zoom_bubble_ == this)
- zoom_bubble_ = NULL;
+ zoom_bubble_ = nullptr;
}
void ZoomBubbleView::CloseBubble() {
// Widget's Close() is async, but we don't want to use zoom_bubble_ after
// this. Additionally web_contents_ may have been destroyed.
- zoom_bubble_ = NULL;
- web_contents_ = NULL;
+ zoom_bubble_ = nullptr;
+ web_contents_ = nullptr;
LocationBarBubbleDelegateView::CloseBubble();
}
@@ -232,7 +234,7 @@ void ZoomBubbleView::OnImmersiveRevealStarted() {
}
void ZoomBubbleView::OnImmersiveModeControllerDestroyed() {
- immersive_mode_controller_ = NULL;
+ immersive_mode_controller_ = nullptr;
}
void ZoomBubbleView::OnExtensionIconImageChanged(

Powered by Google App Engine
This is Rietveld 408576698