OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 inspected_node_(NULL), | 279 inspected_node_(NULL), |
280 active_tickmark_frame_(NULL), | 280 active_tickmark_frame_(NULL), |
281 active_tickmark_(kNoTickmark), | 281 active_tickmark_(kNoTickmark), |
282 locating_active_rect_(false), | 282 locating_active_rect_(false), |
283 last_active_range_(NULL), | 283 last_active_range_(NULL), |
284 last_match_count_(-1), | 284 last_match_count_(-1), |
285 total_matchcount_(-1), | 285 total_matchcount_(-1), |
286 frames_scoping_count_(-1), | 286 frames_scoping_count_(-1), |
287 scoping_complete_(false), | 287 scoping_complete_(false), |
288 next_invalidate_after_(0), | 288 next_invalidate_after_(0), |
289 printing_(false), | 289 printing_(false) { |
290 form_autocomplete_listener_(NULL) { | |
291 StatsCounter(kWebFrameActiveCount).Increment(); | 290 StatsCounter(kWebFrameActiveCount).Increment(); |
292 live_object_count_++; | 291 live_object_count_++; |
293 } | 292 } |
294 | 293 |
295 WebFrameImpl::~WebFrameImpl() { | 294 WebFrameImpl::~WebFrameImpl() { |
296 StatsCounter(kWebFrameActiveCount).Decrement(); | 295 StatsCounter(kWebFrameActiveCount).Decrement(); |
297 live_object_count_--; | 296 live_object_count_--; |
298 | 297 |
299 CancelPendingScopingEffort(); | 298 CancelPendingScopingEffort(); |
| 299 ClearPasswordListeners(); |
300 } | 300 } |
301 | 301 |
302 // WebFrame ------------------------------------------------------------------- | 302 // WebFrame ------------------------------------------------------------------- |
303 | 303 |
304 void WebFrameImpl::InitMainFrame(WebViewImpl* webview_impl) { | 304 void WebFrameImpl::InitMainFrame(WebViewImpl* webview_impl) { |
305 webview_impl_ = webview_impl; | 305 webview_impl_ = webview_impl; |
306 | 306 |
307 RefPtr<Frame> frame = | 307 RefPtr<Frame> frame = |
308 Frame::create(webview_impl_->page(), 0, &frame_loader_client_); | 308 Frame::create(webview_impl_->page(), 0, &frame_loader_client_); |
309 frame_ = frame.get(); | 309 frame_ = frame.get(); |
(...skipping 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 return WebCore::FrameLoadTypeReloadAllowingStaleData == | 1866 return WebCore::FrameLoadTypeReloadAllowingStaleData == |
1867 loader->policyLoadType(); | 1867 loader->policyLoadType(); |
1868 } | 1868 } |
1869 return false; | 1869 return false; |
1870 } | 1870 } |
1871 | 1871 |
1872 int WebFrameImpl::PendingFrameUnloadEventCount() const { | 1872 int WebFrameImpl::PendingFrameUnloadEventCount() const { |
1873 return frame()->eventHandler()->pendingFrameUnloadEventCount(); | 1873 return frame()->eventHandler()->pendingFrameUnloadEventCount(); |
1874 } | 1874 } |
1875 | 1875 |
1876 webkit_glue::AutocompleteBodyListener* WebFrameImpl::GetAutocompleteListener() { | 1876 void WebFrameImpl::RegisterPasswordListener( |
1877 if (!form_autocomplete_listener_) { | 1877 PassRefPtr<WebCore::HTMLInputElement> input_element, |
1878 form_autocomplete_listener_ = | 1878 webkit_glue::PasswordAutocompleteListener* listener) { |
1879 adoptRef(new webkit_glue::AutocompleteBodyListener(frame())); | 1879 RefPtr<WebCore::HTMLInputElement> element = input_element; |
1880 } | 1880 DCHECK(password_listeners_.find(element) == password_listeners_.end()); |
1881 return form_autocomplete_listener_.get(); | 1881 password_listeners_.set(element, listener); |
1882 } | 1882 } |
1883 | 1883 |
1884 void WebFrameImpl::ClearAutocompleteListener() { | 1884 webkit_glue::PasswordAutocompleteListener* WebFrameImpl::GetPasswordListener( |
1885 form_autocomplete_listener_ = NULL; | 1885 WebCore::HTMLInputElement* input_element) { |
| 1886 return password_listeners_.get(input_element); |
1886 } | 1887 } |
| 1888 |
| 1889 void WebFrameImpl::ClearPasswordListeners() { |
| 1890 for (PasswordListenerMap::iterator iter = password_listeners_.begin(); |
| 1891 iter != password_listeners_.end(); ++iter) { |
| 1892 delete iter->second; |
| 1893 } |
| 1894 password_listeners_.clear(); |
| 1895 } |
| 1896 |
OLD | NEW |