| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/autocomplete/autocomplete_popup_view_win.h" | 5 #include "chrome/browser/autocomplete/autocomplete_popup_view_win.h" |
| 6 | 6 |
| 7 // TODO(deanm): Clean up these includes, not going to fight it now. | 7 // TODO(deanm): Clean up these includes, not going to fight it now. |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlapp.h> | 9 #include <atlapp.h> |
| 10 #include <atlcrack.h> | 10 #include <atlcrack.h> |
| 11 #include <atlmisc.h> | 11 #include <atlmisc.h> |
| 12 #include <cmath> | 12 #include <cmath> |
| 13 | 13 |
| 14 #include "app/gfx/chrome_canvas.h" | 14 #include "app/gfx/canvas.h" |
| 15 #include "app/gfx/chrome_font.h" | 15 #include "app/gfx/font.h" |
| 16 #include "app/l10n_util.h" | 16 #include "app/l10n_util.h" |
| 17 #include "app/resource_bundle.h" | 17 #include "app/resource_bundle.h" |
| 18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 20 #include "base/win_util.h" | 20 #include "base/win_util.h" |
| 21 #include "chrome/browser/autocomplete/autocomplete.h" | 21 #include "chrome/browser/autocomplete/autocomplete.h" |
| 22 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 22 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 23 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 23 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
| 24 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
| 25 #include "chrome/browser/net/dns_global.h" | 25 #include "chrome/browser/net/dns_global.h" |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 DrawMatchFragments(dc, match.description, match.description_class, | 663 DrawMatchFragments(dc, match.description, match.description_class, |
| 664 description_max_x - description_width, y, | 664 description_max_x - description_width, y, |
| 665 description_max_x, status); | 665 description_max_x, status); |
| 666 } | 666 } |
| 667 if (starred) | 667 if (starred) |
| 668 DrawStar(dc, star_x, | 668 DrawStar(dc, star_x, |
| 669 (line_info_.line_height - star_->height()) / 2 + top_pixel); | 669 (line_info_.line_height - star_->height()) / 2 + top_pixel); |
| 670 } | 670 } |
| 671 | 671 |
| 672 void AutocompletePopupViewWin::DrawStar(HDC dc, int x, int y) const { | 672 void AutocompletePopupViewWin::DrawStar(HDC dc, int x, int y) const { |
| 673 ChromeCanvas canvas(star_->width(), star_->height(), false); | 673 gfx::Canvas canvas(star_->width(), star_->height(), false); |
| 674 // Make the background completely transparent. | 674 // Make the background completely transparent. |
| 675 canvas.drawColor(SK_ColorBLACK, SkPorterDuff::kClear_Mode); | 675 canvas.drawColor(SK_ColorBLACK, SkPorterDuff::kClear_Mode); |
| 676 canvas.DrawBitmapInt(*star_, 0, 0); | 676 canvas.DrawBitmapInt(*star_, 0, 0); |
| 677 canvas.getTopPlatformDevice().drawToHDC( | 677 canvas.getTopPlatformDevice().drawToHDC( |
| 678 dc, mirroring_context_->GetLeft(x, x + star_->width()), y, NULL); | 678 dc, mirroring_context_->GetLeft(x, x + star_->width()), y, NULL); |
| 679 } | 679 } |
| 680 | 680 |
| 681 // static | 681 // static |
| 682 AutocompletePopupView* AutocompletePopupView::CreatePopupView( | 682 AutocompletePopupView* AutocompletePopupView::CreatePopupView( |
| 683 const gfx::Font& font, | 683 const gfx::Font& font, |
| 684 AutocompleteEditViewWin* edit_view, | 684 AutocompleteEditViewWin* edit_view, |
| 685 AutocompleteEditModel* edit_model, | 685 AutocompleteEditModel* edit_model, |
| 686 Profile* profile, | 686 Profile* profile, |
| 687 AutocompletePopupPositioner* popup_positioner) { | 687 AutocompletePopupPositioner* popup_positioner) { |
| 688 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableOmnibox2)) { | 688 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableOmnibox2)) { |
| 689 return new AutocompletePopupContentsView(font, edit_view, edit_model, | 689 return new AutocompletePopupContentsView(font, edit_view, edit_model, |
| 690 profile, popup_positioner); | 690 profile, popup_positioner); |
| 691 } | 691 } |
| 692 return new AutocompletePopupViewWin(font, edit_view, edit_model, profile); | 692 return new AutocompletePopupViewWin(font, edit_view, edit_model, profile); |
| 693 } | 693 } |
| OLD | NEW |