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

Side by Side Diff: chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc

Issue 340077: Gets find bar animation/clipping to work on views/gtk. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 // Translate the contents rect into widget coordinates, since that's what 843 // Translate the contents rect into widget coordinates, since that's what
844 // DwmEnableBlurBehindWindow expects a region in. 844 // DwmEnableBlurBehindWindow expects a region in.
845 gfx::Rect contents_rect = GetLocalBounds(false); 845 gfx::Rect contents_rect = GetLocalBounds(false);
846 gfx::Point origin(contents_rect.origin()); 846 gfx::Point origin(contents_rect.origin());
847 views::View::ConvertPointToWidget(this, &origin); 847 views::View::ConvertPointToWidget(this, &origin);
848 contents_rect.set_origin(origin); 848 contents_rect.set_origin(origin);
849 849
850 gfx::Path contents_path; 850 gfx::Path contents_path;
851 MakeContentsPath(&contents_path, contents_rect); 851 MakeContentsPath(&contents_path, contents_rect);
852 ScopedGDIObject<HRGN> popup_region; 852 ScopedGDIObject<HRGN> popup_region;
853 popup_region.Set(contents_path.CreateHRGN()); 853 popup_region.Set(contents_path.CreateNativeRegion());
854 bb.hRgnBlur = popup_region.Get(); 854 bb.hRgnBlur = popup_region.Get();
855 DwmEnableBlurBehindWindow(GetWidget()->GetNativeView(), &bb); 855 DwmEnableBlurBehindWindow(GetWidget()->GetNativeView(), &bb);
856 #endif 856 #endif
857 } 857 }
858 858
859 void AutocompletePopupContentsView::MakeCanvasTransparent( 859 void AutocompletePopupContentsView::MakeCanvasTransparent(
860 gfx::Canvas* canvas) { 860 gfx::Canvas* canvas) {
861 // Allow the window blur effect to show through the popup background. 861 // Allow the window blur effect to show through the popup background.
862 SkAlpha alpha = GetThemeProvider()->ShouldUseNativeFrame() ? 862 SkAlpha alpha = GetThemeProvider()->ShouldUseNativeFrame() ?
863 kGlassPopupAlpha : kOpaquePopupAlpha; 863 kGlassPopupAlpha : kOpaquePopupAlpha;
864 canvas->drawColor(SkColorSetA(GetColor(NORMAL, BACKGROUND), alpha), 864 canvas->drawColor(SkColorSetA(GetColor(NORMAL, BACKGROUND), alpha),
865 SkXfermode::kDstIn_Mode); 865 SkXfermode::kDstIn_Mode);
866 } 866 }
867 867
868 // static 868 // static
869 AutocompletePopupView* AutocompletePopupView::CreatePopupView( 869 AutocompletePopupView* AutocompletePopupView::CreatePopupView(
870 const gfx::Font& font, 870 const gfx::Font& font,
871 AutocompleteEditView* edit_view, 871 AutocompleteEditView* edit_view,
872 AutocompleteEditModel* edit_model, 872 AutocompleteEditModel* edit_model,
873 Profile* profile, 873 Profile* profile,
874 const BubblePositioner* bubble_positioner) { 874 const BubblePositioner* bubble_positioner) {
875 return new AutocompletePopupContentsView(font, edit_view, edit_model, 875 return new AutocompletePopupContentsView(font, edit_view, edit_model,
876 profile, bubble_positioner); 876 profile, bubble_positioner);
877 } 877 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698