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 // For WinDDK ATL compatibility, these ATL headers must come first. | 5 // For WinDDK ATL compatibility, these ATL headers must come first. |
6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <atlbase.h> // NOLINT | 8 #include <atlbase.h> // NOLINT |
9 #include <atlwin.h> // NOLINT | 9 #include <atlwin.h> // NOLINT |
10 #endif | 10 #endif |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 std::max(glyph_bounds.start(), glyph_bounds.end()) : | 417 std::max(glyph_bounds.start(), glyph_bounds.end()) : |
418 std::min(glyph_bounds.start(), glyph_bounds.end()); | 418 std::min(glyph_bounds.start(), glyph_bounds.end()); |
419 | 419 |
420 return is_ui_rtl ? | 420 return is_ui_rtl ? |
421 (input_render_text->GetContentWidth() - start_padding) : start_padding; | 421 (input_render_text->GetContentWidth() - start_padding) : start_padding; |
422 } | 422 } |
423 | 423 |
424 // static | 424 // static |
425 int OmniboxResultView::default_icon_size_ = 0; | 425 int OmniboxResultView::default_icon_size_ = 0; |
426 | 426 |
| 427 const char* OmniboxResultView::GetClassName() const { |
| 428 return "OmniboxResultView"; |
| 429 } |
| 430 |
427 gfx::ImageSkia OmniboxResultView::GetIcon() const { | 431 gfx::ImageSkia OmniboxResultView::GetIcon() const { |
428 const gfx::Image image = model_->GetIconIfExtensionMatch(model_index_); | 432 const gfx::Image image = model_->GetIconIfExtensionMatch(model_index_); |
429 if (!image.IsEmpty()) | 433 if (!image.IsEmpty()) |
430 return image.AsImageSkia(); | 434 return image.AsImageSkia(); |
431 | 435 |
432 int icon = model_->IsStarredMatch(match_) ? | 436 int icon = model_->IsStarredMatch(match_) ? |
433 IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type); | 437 IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type); |
434 if (GetState() == SELECTED) { | 438 if (GetState() == SELECTED) { |
435 switch (icon) { | 439 switch (icon) { |
436 case IDR_OMNIBOX_EXTENSION_APP: | 440 case IDR_OMNIBOX_EXTENSION_APP: |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 } | 560 } |
557 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(), | 561 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(), |
558 keyword_description_rendertext_.get(), canvas, x); | 562 keyword_description_rendertext_.get(), canvas, x); |
559 } | 563 } |
560 } | 564 } |
561 | 565 |
562 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { | 566 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { |
563 Layout(); | 567 Layout(); |
564 SchedulePaint(); | 568 SchedulePaint(); |
565 } | 569 } |
OLD | NEW |