OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #include "chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h" | 5 #include "chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h" |
6 | 6 |
7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
8 #include "app/gfx/color_utils.h" | 8 #include "app/gfx/color_utils.h" |
9 #include "app/gfx/insets.h" | 9 #include "app/gfx/insets.h" |
10 #include "app/gfx/path.h" | 10 #include "app/gfx/path.h" |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 // Translate the contents rect into widget coordinates, since that's what | 850 // Translate the contents rect into widget coordinates, since that's what |
851 // DwmEnableBlurBehindWindow expects a region in. | 851 // DwmEnableBlurBehindWindow expects a region in. |
852 gfx::Rect contents_rect = GetLocalBounds(false); | 852 gfx::Rect contents_rect = GetLocalBounds(false); |
853 gfx::Point origin(contents_rect.origin()); | 853 gfx::Point origin(contents_rect.origin()); |
854 views::View::ConvertPointToWidget(this, &origin); | 854 views::View::ConvertPointToWidget(this, &origin); |
855 contents_rect.set_origin(origin); | 855 contents_rect.set_origin(origin); |
856 | 856 |
857 gfx::Path contents_path; | 857 gfx::Path contents_path; |
858 MakeContentsPath(&contents_path, contents_rect); | 858 MakeContentsPath(&contents_path, contents_rect); |
859 ScopedGDIObject<HRGN> popup_region; | 859 ScopedGDIObject<HRGN> popup_region; |
860 popup_region.Set(contents_path.CreateHRGN()); | 860 popup_region.Set(contents_path.CreateNativeRegion()); |
861 bb.hRgnBlur = popup_region.Get(); | 861 bb.hRgnBlur = popup_region.Get(); |
862 DwmEnableBlurBehindWindow(GetWidget()->GetNativeView(), &bb); | 862 DwmEnableBlurBehindWindow(GetWidget()->GetNativeView(), &bb); |
863 #endif | 863 #endif |
864 } | 864 } |
865 | 865 |
866 void AutocompletePopupContentsView::MakeCanvasTransparent( | 866 void AutocompletePopupContentsView::MakeCanvasTransparent( |
867 gfx::Canvas* canvas) { | 867 gfx::Canvas* canvas) { |
868 // Allow the window blur effect to show through the popup background. | 868 // Allow the window blur effect to show through the popup background. |
869 SkAlpha alpha = GetThemeProvider()->ShouldUseNativeFrame() ? | 869 SkAlpha alpha = GetThemeProvider()->ShouldUseNativeFrame() ? |
870 kGlassPopupAlpha : kOpaquePopupAlpha; | 870 kGlassPopupAlpha : kOpaquePopupAlpha; |
871 canvas->drawColor(SkColorSetA(GetColor(NORMAL, BACKGROUND), alpha), | 871 canvas->drawColor(SkColorSetA(GetColor(NORMAL, BACKGROUND), alpha), |
872 SkXfermode::kDstIn_Mode); | 872 SkXfermode::kDstIn_Mode); |
873 } | 873 } |
874 | 874 |
875 // static | 875 // static |
876 AutocompletePopupView* AutocompletePopupView::CreatePopupView( | 876 AutocompletePopupView* AutocompletePopupView::CreatePopupView( |
877 const gfx::Font& font, | 877 const gfx::Font& font, |
878 AutocompleteEditView* edit_view, | 878 AutocompleteEditView* edit_view, |
879 AutocompleteEditModel* edit_model, | 879 AutocompleteEditModel* edit_model, |
880 Profile* profile, | 880 Profile* profile, |
881 const BubblePositioner* bubble_positioner) { | 881 const BubblePositioner* bubble_positioner) { |
882 return new AutocompletePopupContentsView(font, edit_view, edit_model, | 882 return new AutocompletePopupContentsView(font, edit_view, edit_model, |
883 profile, bubble_positioner); | 883 profile, bubble_positioner); |
884 } | 884 } |
OLD | NEW |