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

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

Issue 160378: Make TOOLKIT_VIEWS port use views-based Autocomplete popup.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months 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
(Empty)
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
3 // LICENSE file.
4
5 #include "chrome/browser/views/autocomplete/autocomplete_popup_gtk.h"
6
7 #include "app/gfx/insets.h"
8 #include "chrome/browser/autocomplete/autocomplete_edit_view.h"
9 #include "chrome/browser/autocomplete/autocomplete_popup_model.h"
10 #include "chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h"
11
12 ////////////////////////////////////////////////////////////////////////////////
13 // AutocompletePopupGtk, public:
14
15 AutocompletePopupGtk::AutocompletePopupGtk(
16 AutocompletePopupContentsView* contents)
17 : WidgetGtk(WidgetGtk::TYPE_POPUP),
18 contents_(contents) {
19 set_delete_on_destroy(false);
20 }
21
22 AutocompletePopupGtk::~AutocompletePopupGtk() {
23 }
24
25 void AutocompletePopupGtk::Init(AutocompleteEditView* edit_view,
26 views::View* contents) {
27 MakeTransparent();
28 // Create the popup
29 WidgetGtk::Init(gtk_widget_get_parent(edit_view->GetNativeView()),
30 contents_->GetPopupBounds());
31 // The contents is owned by the LocationBarView.
32 contents_->SetParentOwned(false);
33 SetContentsView(contents_);
34 }
35
36 void AutocompletePopupGtk::Show() {
37 // Move the popup to the place appropriate for the window's current position -
38 // it may have been moved since it was last shown.
39 SetBounds(contents_->GetPopupBounds());
40 if (!IsVisible())
41 WidgetGtk::Show();
42 }
43
44 bool AutocompletePopupGtk::IsOpen() const {
45 return IsCreated() && IsVisible();
46 }
47
48 bool AutocompletePopupGtk::IsCreated() const {
49 return GTK_IS_WIDGET(GetNativeView());
50 }
OLDNEW
« no previous file with comments | « chrome/browser/views/autocomplete/autocomplete_popup_gtk.h ('k') | chrome/browser/views/autocomplete/autocomplete_popup_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698