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

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

Issue 2595163002: Add origin() method on View and use it to simplify some callers. (Closed)
Patch Set: Created 3 years, 12 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 } 365 }
366 return nullptr; 366 return nullptr;
367 } 367 }
368 368
369 void LocationBarView::SetStarToggled(bool on) { 369 void LocationBarView::SetStarToggled(bool on) {
370 if (star_view_) 370 if (star_view_)
371 star_view_->SetToggled(on); 371 star_view_->SetToggled(on);
372 } 372 }
373 373
374 gfx::Point LocationBarView::GetOmniboxViewOrigin() const { 374 gfx::Point LocationBarView::GetOmniboxViewOrigin() const {
375 gfx::Point origin(omnibox_view_->bounds().origin()); 375 gfx::Point origin(omnibox_view_->origin());
376 origin.set_x(GetMirroredXInView(origin.x())); 376 origin.set_x(GetMirroredXInView(origin.x()));
377 views::View::ConvertPointToScreen(this, &origin); 377 views::View::ConvertPointToScreen(this, &origin);
378 return origin; 378 return origin;
379 } 379 }
380 380
381 void LocationBarView::SetImeInlineAutocompletion(const base::string16& text) { 381 void LocationBarView::SetImeInlineAutocompletion(const base::string16& text) {
382 ime_inline_autocomplete_view_->SetText(text); 382 ime_inline_autocomplete_view_->SetText(text);
383 ime_inline_autocomplete_view_->SetVisible(!text.empty()); 383 ime_inline_autocomplete_view_->SetVisible(!text.empty());
384 } 384 }
385 385
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 // LocationBarView, private TemplateURLServiceObserver implementation: 1214 // LocationBarView, private TemplateURLServiceObserver implementation:
1215 1215
1216 void LocationBarView::OnTemplateURLServiceChanged() { 1216 void LocationBarView::OnTemplateURLServiceChanged() {
1217 template_url_service_->RemoveObserver(this); 1217 template_url_service_->RemoveObserver(this);
1218 template_url_service_ = nullptr; 1218 template_url_service_ = nullptr;
1219 // If the browser is no longer active, let's not show the info bubble, as this 1219 // If the browser is no longer active, let's not show the info bubble, as this
1220 // would make the browser the active window again. 1220 // would make the browser the active window again.
1221 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) 1221 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive())
1222 ShowFirstRunBubble(); 1222 ShowFirstRunBubble();
1223 } 1223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698