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

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

Issue 1319983002: Add a top shadow to material design omnibox dropdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Peter's comments Created 5 years, 3 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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 int LocationBarView::GetInternalHeight(bool use_preferred_size) { 481 int LocationBarView::GetInternalHeight(bool use_preferred_size) {
482 int total_height = 482 int total_height =
483 use_preferred_size ? GetPreferredSize().height() : height(); 483 use_preferred_size ? GetPreferredSize().height() : height();
484 return std::max(total_height - (VerticalPadding() * 2), 0); 484 return std::max(total_height - (VerticalPadding() * 2), 0);
485 } 485 }
486 486
487 void LocationBarView::GetOmniboxPopupPositioningInfo( 487 void LocationBarView::GetOmniboxPopupPositioningInfo(
488 gfx::Point* top_left_screen_coord, 488 gfx::Point* top_left_screen_coord,
489 int* popup_width, 489 int* popup_width,
490 int* left_margin, 490 int* left_margin,
491 int* right_margin) { 491 int* right_margin,
492 int top_edge_overlap) {
492 // Because the popup might appear atop the attached bookmark bar, there won't 493 // Because the popup might appear atop the attached bookmark bar, there won't
493 // necessarily be a client edge separating it from the rest of the toolbar. 494 // necessarily be a client edge separating it from the rest of the toolbar.
494 // Therefore we position the popup high enough so it can draw its own client 495 // Therefore we position the popup high enough so it can draw its own client
495 // edge at the top, in the same place the toolbar would normally draw the 496 // edge at the top, in the same place the toolbar would normally draw the
496 // client edge. 497 // client edge.
Peter Kasting 2015/08/29 01:00:23 Let's remove this comment from this file, as it ba
tdanderson 2015/08/31 15:23:18 Done.
497 *top_left_screen_coord = gfx::Point( 498 *top_left_screen_coord = gfx::Point(0, parent()->height() - top_edge_overlap);
498 0, 499
499 parent()->height() - views::NonClientFrameView::kClientEdgeThickness);
500 views::View::ConvertPointToScreen(parent(), top_left_screen_coord); 500 views::View::ConvertPointToScreen(parent(), top_left_screen_coord);
501 *popup_width = parent()->width(); 501 *popup_width = parent()->width();
502 502
503 gfx::Rect location_bar_bounds(bounds()); 503 gfx::Rect location_bar_bounds(bounds());
504 location_bar_bounds.Inset(kNormalEdgeThickness, 0); 504 location_bar_bounds.Inset(kNormalEdgeThickness, 0);
505 *left_margin = location_bar_bounds.x(); 505 *left_margin = location_bar_bounds.x();
506 *right_margin = *popup_width - location_bar_bounds.right(); 506 *right_margin = *popup_width - location_bar_bounds.right();
507 } 507 }
508 508
509 //////////////////////////////////////////////////////////////////////////////// 509 ////////////////////////////////////////////////////////////////////////////////
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 1409
1410 void LocationBarView::ModelChanged(const SearchModel::State& old_state, 1410 void LocationBarView::ModelChanged(const SearchModel::State& old_state,
1411 const SearchModel::State& new_state) { 1411 const SearchModel::State& new_state) {
1412 const bool visible = !GetToolbarModel()->input_in_progress() && 1412 const bool visible = !GetToolbarModel()->input_in_progress() &&
1413 new_state.voice_search_supported; 1413 new_state.voice_search_supported;
1414 if (mic_search_view_->visible() != visible) { 1414 if (mic_search_view_->visible() != visible) {
1415 mic_search_view_->SetVisible(visible); 1415 mic_search_view_->SetVisible(visible);
1416 Layout(); 1416 Layout();
1417 } 1417 }
1418 } 1418 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698