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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc

Issue 1423653005: Further plumb visual rect into cc:DisplayItemList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix clip recorder params in omnibox. Created 5 years 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/omnibox/omnibox_popup_contents_view.h" 5 #include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/browser/search/search.h" 9 #include "chrome/browser/search/search.h"
10 #include "chrome/browser/themes/theme_properties.h" 10 #include "chrome/browser/themes/theme_properties.h"
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 canvas->TileImageInt(*bottom_shadow_, 0, height() - bottom_shadow_->height(), 458 canvas->TileImageInt(*bottom_shadow_, 0, height() - bottom_shadow_->height(),
459 width(), bottom_shadow_->height()); 459 width(), bottom_shadow_->height());
460 } 460 }
461 461
462 void OmniboxPopupContentsView::PaintChildren(const ui::PaintContext& context) { 462 void OmniboxPopupContentsView::PaintChildren(const ui::PaintContext& context) {
463 gfx::Rect contents_bounds = GetContentsBounds(); 463 gfx::Rect contents_bounds = GetContentsBounds();
464 const int interior = GetLayoutConstant(OMNIBOX_DROPDOWN_BORDER_INTERIOR); 464 const int interior = GetLayoutConstant(OMNIBOX_DROPDOWN_BORDER_INTERIOR);
465 contents_bounds.Inset(0, views::NonClientFrameView::kClientEdgeThickness, 0, 465 contents_bounds.Inset(0, views::NonClientFrameView::kClientEdgeThickness, 0,
466 bottom_shadow_->height() - interior); 466 bottom_shadow_->height() - interior);
467 467
468 ui::ClipRecorder clip_recorder(context); 468 ui::ClipRecorder clip_recorder(context, size());
469 clip_recorder.ClipRect(contents_bounds); 469 clip_recorder.ClipRect(contents_bounds);
470 { 470 {
471 ui::PaintRecorder recorder(context, size()); 471 ui::PaintRecorder recorder(context, size());
472 SkColor background_color = result_view_at(0)->GetColor( 472 SkColor background_color = result_view_at(0)->GetColor(
473 OmniboxResultView::NORMAL, OmniboxResultView::BACKGROUND); 473 OmniboxResultView::NORMAL, OmniboxResultView::BACKGROUND);
474 recorder.canvas()->DrawColor(background_color); 474 recorder.canvas()->DrawColor(background_color);
475 } 475 }
476 View::PaintChildren(context); 476 View::PaintChildren(context);
477 } 477 }
478 478
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 size_t index = GetIndexForPoint(event.location()); 526 size_t index = GetIndexForPoint(event.location());
527 if (!HasMatchAt(index)) 527 if (!HasMatchAt(index))
528 return; 528 return;
529 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, 529 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition,
530 GURL(), base::string16(), index); 530 GURL(), base::string16(), index);
531 } 531 }
532 532
533 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { 533 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) {
534 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); 534 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i)));
535 } 535 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_view.cc ('k') | chrome/browser/ui/views/profiles/profile_chooser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698