| 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/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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 gfx::Point* top_left_screen_coord, | 469 gfx::Point* top_left_screen_coord, |
| 470 int* popup_width, | 470 int* popup_width, |
| 471 int* left_margin, | 471 int* left_margin, |
| 472 int* right_margin, | 472 int* right_margin, |
| 473 int top_edge_overlap) { | 473 int top_edge_overlap) { |
| 474 *top_left_screen_coord = gfx::Point(0, parent()->height() - top_edge_overlap); | 474 *top_left_screen_coord = gfx::Point(0, parent()->height() - top_edge_overlap); |
| 475 views::View::ConvertPointToScreen(parent(), top_left_screen_coord); | 475 views::View::ConvertPointToScreen(parent(), top_left_screen_coord); |
| 476 | 476 |
| 477 *popup_width = parent()->width(); | 477 *popup_width = parent()->width(); |
| 478 gfx::Rect location_bar_bounds(bounds()); | 478 gfx::Rect location_bar_bounds(bounds()); |
| 479 location_bar_bounds.Inset(GetHorizontalEdgeThickness(), 0); | 479 if (!ui::MaterialDesignController::IsModeMaterial()) |
| 480 location_bar_bounds.Inset(GetHorizontalEdgeThickness(), 0); |
| 480 *left_margin = location_bar_bounds.x(); | 481 *left_margin = location_bar_bounds.x(); |
| 481 *right_margin = *popup_width - location_bar_bounds.right(); | 482 *right_margin = *popup_width - location_bar_bounds.right(); |
| 482 } | 483 } |
| 483 | 484 |
| 484 //////////////////////////////////////////////////////////////////////////////// | 485 //////////////////////////////////////////////////////////////////////////////// |
| 485 // LocationBarView, public LocationBar implementation: | 486 // LocationBarView, public LocationBar implementation: |
| 486 | 487 |
| 487 void LocationBarView::FocusLocation(bool select_all) { | 488 void LocationBarView::FocusLocation(bool select_all) { |
| 488 omnibox_view_->SetFocus(); | 489 omnibox_view_->SetFocus(); |
| 489 if (select_all) | 490 if (select_all) |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1389 // LocationBarView, private TemplateURLServiceObserver implementation: | 1390 // LocationBarView, private TemplateURLServiceObserver implementation: |
| 1390 | 1391 |
| 1391 void LocationBarView::OnTemplateURLServiceChanged() { | 1392 void LocationBarView::OnTemplateURLServiceChanged() { |
| 1392 template_url_service_->RemoveObserver(this); | 1393 template_url_service_->RemoveObserver(this); |
| 1393 template_url_service_ = nullptr; | 1394 template_url_service_ = nullptr; |
| 1394 // If the browser is no longer active, let's not show the info bubble, as this | 1395 // If the browser is no longer active, let's not show the info bubble, as this |
| 1395 // would make the browser the active window again. | 1396 // would make the browser the active window again. |
| 1396 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1397 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
| 1397 ShowFirstRunBubble(); | 1398 ShowFirstRunBubble(); |
| 1398 } | 1399 } |
| OLD | NEW |