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

Side by Side Diff: chrome/browser/autofill/autofill_popup_view.cc

Issue 10411033: Browser Plugin: WebContents should notify when it's restored (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Removed a test DCHECK Created 8 years, 7 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
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 #include "chrome/browser/autofill/autofill_popup_view.h" 5 #include "chrome/browser/autofill/autofill_popup_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/autofill/autofill_external_delegate.h" 9 #include "chrome/browser/autofill/autofill_external_delegate.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 AutofillPopupView::AutofillPopupView( 43 AutofillPopupView::AutofillPopupView(
44 content::WebContents* web_contents, 44 content::WebContents* web_contents,
45 AutofillExternalDelegate* external_delegate) 45 AutofillExternalDelegate* external_delegate)
46 : external_delegate_(external_delegate), 46 : external_delegate_(external_delegate),
47 selected_line_(kNoSelection) { 47 selected_line_(kNoSelection) {
48 if (!web_contents) 48 if (!web_contents)
49 return; 49 return;
50 50
51 registrar_.Add(this, 51 registrar_.Add(this,
52 content::NOTIFICATION_WEB_CONTENTS_HIDDEN, 52 content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED,
53 content::Source<content::WebContents>(web_contents)); 53 content::Source<content::WebContents>(web_contents));
54 registrar_.Add( 54 registrar_.Add(
55 this, 55 this,
56 content::NOTIFICATION_NAV_ENTRY_COMMITTED, 56 content::NOTIFICATION_NAV_ENTRY_COMMITTED,
57 content::Source<content::NavigationController>( 57 content::Source<content::NavigationController>(
58 &(web_contents->GetController()))); 58 &(web_contents->GetController())));
59 } 59 }
60 60
61 AutofillPopupView::~AutofillPopupView() {} 61 AutofillPopupView::~AutofillPopupView() {}
62 62
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 (autofill_unique_ids_[0] > 0 || 189 (autofill_unique_ids_[0] > 0 ||
190 autofill_unique_ids_[0] == 190 autofill_unique_ids_[0] ==
191 WebAutofillClient::MenuItemIDAutocompleteEntry || 191 WebAutofillClient::MenuItemIDAutocompleteEntry ||
192 autofill_unique_ids_[0] == WebAutofillClient::MenuItemIDPasswordEntry || 192 autofill_unique_ids_[0] == WebAutofillClient::MenuItemIDPasswordEntry ||
193 autofill_unique_ids_[0] == WebAutofillClient::MenuItemIDDataListEntry); 193 autofill_unique_ids_[0] == WebAutofillClient::MenuItemIDDataListEntry);
194 } 194 }
195 195
196 void AutofillPopupView::Observe(int type, 196 void AutofillPopupView::Observe(int type,
197 const content::NotificationSource& source, 197 const content::NotificationSource& source,
198 const content::NotificationDetails& details) { 198 const content::NotificationDetails& details) {
199 if (type == content::NOTIFICATION_WEB_CONTENTS_HIDDEN 199 bool visible = true;
200 || type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) 200 if (type == content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED)
201 visible = *content::Details<bool>(details).ptr();
202 if (!visible || type == content::NOTIFICATION_NAV_ENTRY_COMMITTED)
jam 2012/05/18 23:40:51 nit: this code is not that readable. better to mak
Fady Samuel 2012/05/19 15:59:02 Done.
201 Hide(); 203 Hide();
202 } 204 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_popup_view_browsertest.cc » ('j') | content/public/browser/notification_types.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698