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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 2845593002: Updates Zoom bubble layout and adds +/- buttons (Closed)
Patch Set: Updates Zoom bubble layout and adds +/- buttons (comments) Created 3 years, 7 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
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/ui/views/location_bar/location_bar_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 } 313 }
314 314
315 void LocationBarView::ZoomChangedForActiveTab(bool can_show_bubble) { 315 void LocationBarView::ZoomChangedForActiveTab(bool can_show_bubble) {
316 DCHECK(zoom_view_); 316 DCHECK(zoom_view_);
317 if (RefreshZoomView()) { 317 if (RefreshZoomView()) {
318 Layout(); 318 Layout();
319 SchedulePaint(); 319 SchedulePaint();
320 } 320 }
321 321
322 WebContents* web_contents = GetWebContents(); 322 WebContents* web_contents = GetWebContents();
323 if (can_show_bubble && zoom_view_->visible() && web_contents) 323 // Zoom bubble may be present without its corresponding decoration
324 // |zoom_view_| such as when using + or - buttons in the bubble to
325 // set the zoom to 100%. When either is visible, show or update the
326 // bubble contents.
327 if (can_show_bubble && web_contents &&
328 (zoom_view_->visible() || ZoomBubbleView::GetZoomBubble())) {
324 ZoomBubbleView::ShowBubble(web_contents, gfx::Point(), 329 ZoomBubbleView::ShowBubble(web_contents, gfx::Point(),
325 ZoomBubbleView::AUTOMATIC); 330 ZoomBubbleView::AUTOMATIC);
331 }
326 } 332 }
327 333
328 void LocationBarView::SetStarToggled(bool on) { 334 void LocationBarView::SetStarToggled(bool on) {
329 if (star_view_) 335 if (star_view_)
330 star_view_->SetToggled(on); 336 star_view_->SetToggled(on);
331 } 337 }
332 338
333 gfx::Point LocationBarView::GetOmniboxViewOrigin() const { 339 gfx::Point LocationBarView::GetOmniboxViewOrigin() const {
334 gfx::Point origin(omnibox_view_->origin()); 340 gfx::Point origin(omnibox_view_->origin());
335 origin.set_x(GetMirroredXInView(origin.x())); 341 origin.set_x(GetMirroredXInView(origin.x()));
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 // LocationBarView, private TemplateURLServiceObserver implementation: 1047 // LocationBarView, private TemplateURLServiceObserver implementation:
1042 1048
1043 void LocationBarView::OnTemplateURLServiceChanged() { 1049 void LocationBarView::OnTemplateURLServiceChanged() {
1044 template_url_service_->RemoveObserver(this); 1050 template_url_service_->RemoveObserver(this);
1045 template_url_service_ = nullptr; 1051 template_url_service_ = nullptr;
1046 // If the browser is no longer active, let's not show the info bubble, as this 1052 // If the browser is no longer active, let's not show the info bubble, as this
1047 // would make the browser the active window again. 1053 // would make the browser the active window again.
1048 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) 1054 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive())
1049 ShowFirstRunBubble(); 1055 ShowFirstRunBubble();
1050 } 1056 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698