summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/api/src/PasswordAutocompleteListener.h51
-rw-r--r--webkit/glue/dom_operations.cc4
-rw-r--r--webkit/glue/editor_client_impl.cc22
-rw-r--r--webkit/glue/password_autocomplete_listener_impl.cc (renamed from webkit/glue/password_autocomplete_listener.cc)35
-rw-r--r--webkit/glue/password_autocomplete_listener_impl.h (renamed from webkit/glue/password_autocomplete_listener.h)30
-rw-r--r--webkit/glue/password_autocomplete_listener_unittest.cc53
-rw-r--r--webkit/glue/webframe_impl.cc7
-rw-r--r--webkit/glue/webframe_impl.h11
-rw-r--r--webkit/glue/webpopupmenu_impl.cc9
-rw-r--r--webkit/glue/webworker_impl.cc2
-rw-r--r--webkit/webkit.gyp5
11 files changed, 136 insertions, 93 deletions
diff --git a/webkit/api/src/PasswordAutocompleteListener.h b/webkit/api/src/PasswordAutocompleteListener.h
new file mode 100644
index 0000000..0451f8f
--- /dev/null
+++ b/webkit/api/src/PasswordAutocompleteListener.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PasswordAutocompleteListener_h
+#define PasswordAutocompleteListener_h
+
+namespace WebKit {
+
+class PasswordAutocompleteListener {
+public:
+ virtual ~PasswordAutocompleteListener() {}
+
+ virtual void didBlurInputElement(
+ const WebCore::String& userInput) = 0;
+
+ virtual void performInlineAutocomplete(
+ const WebCore::String& userInput,
+ bool backSpaceOrDeletePressed,
+ bool showSuggestions) = 0;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc
index 1537e5c..f859ce4 100644
--- a/webkit/glue/dom_operations.cc
+++ b/webkit/glue/dom_operations.cc
@@ -37,7 +37,7 @@ MSVC_POP_WARNING();
#include "webkit/glue/dom_operations_private.h"
#include "webkit/glue/form_data.h"
#include "webkit/glue/glue_util.h"
-#include "webkit/glue/password_autocomplete_listener.h"
+#include "webkit/glue/password_autocomplete_listener_impl.h"
#include "webkit/glue/webframe_impl.h"
#include "webkit/glue/webview_impl.h"
@@ -351,7 +351,7 @@ void FillPasswordForm(WebView* view,
WebFrameImpl* webframe_impl = frame_loader_client->webframe();
webframe_impl->RegisterPasswordListener(
username_element,
- new PasswordAutocompleteListener(
+ new PasswordAutocompleteListenerImpl(
new HTMLInputDelegate(username_element),
new HTMLInputDelegate(password_element),
data));
diff --git a/webkit/glue/editor_client_impl.cc b/webkit/glue/editor_client_impl.cc
index a09c9c8..80077ef 100644
--- a/webkit/glue/editor_client_impl.cc
+++ b/webkit/glue/editor_client_impl.cc
@@ -30,16 +30,16 @@
#include "webkit/api/public/WebViewClient.h"
// Can include api/src since eventually editor_client_impl will be there too.
#include "webkit/api/src/DOMUtilitiesPrivate.h"
+#include "webkit/api/src/PasswordAutocompleteListener.h"
#include "webkit/glue/editor_client_impl.h"
#include "webkit/glue/form_field_values.h"
#include "webkit/glue/glue_util.h"
-#include "webkit/glue/password_autocomplete_listener.h"
#include "webkit/glue/webview_impl.h"
+using WebKit::PasswordAutocompleteListener;
using WebKit::WebEditingAction;
using WebKit::WebString;
using WebKit::WebTextAffinity;
-using webkit_glue::FormFieldValues;
// Arbitrary depth limit for the undo stack, to keep it from using
// unbounded memory. This is the maximum number of distinct undoable
@@ -667,12 +667,12 @@ void EditorClientImpl::textFieldDidEndEditing(WebCore::Element* element) {
WebFrameImpl* webframe =
WebFrameImpl::FromFrame(input_element->document()->frame());
- webkit_glue::PasswordAutocompleteListener* listener =
+ PasswordAutocompleteListener* listener =
webframe->GetPasswordListener(input_element);
if (!listener)
return;
- listener->OnBlur(input_element, input_element->value());
+ listener->didBlurInputElement(input_element->value());
}
void EditorClientImpl::textDidChangeInTextField(WebCore::Element* element) {
@@ -754,14 +754,14 @@ void EditorClientImpl::DoAutofill(WebCore::Timer<EditorClientImpl>* timer) {
// a node would be confusing.
WebFrameImpl* webframe =
WebFrameImpl::FromFrame(input_element->document()->frame());
- webkit_glue::PasswordAutocompleteListener* listener =
+ PasswordAutocompleteListener* listener =
webframe->GetPasswordListener(input_element);
if (listener) {
if (args->autofill_form_only)
return;
- listener->OnInlineAutocompleteNeeded(
- input_element, value, args->backspace_or_delete_pressed, true);
+ listener->performInlineAutocomplete(
+ value, args->backspace_or_delete_pressed, true);
return;
}
@@ -786,14 +786,12 @@ void EditorClientImpl::OnAutofillSuggestionAccepted(
WebCore::HTMLInputElement* text_field) {
WebFrameImpl* webframe =
WebFrameImpl::FromFrame(text_field->document()->frame());
- webkit_glue::PasswordAutocompleteListener* listener =
+ PasswordAutocompleteListener* listener =
webframe->GetPasswordListener(text_field);
// Password listeners need to autocomplete other fields that depend on the
// input element with autofill suggestions.
- if (listener) {
- listener->OnInlineAutocompleteNeeded(
- text_field, text_field->value(), false, false);
- }
+ if (listener)
+ listener->performInlineAutocomplete(text_field->value(), false, false);
}
bool EditorClientImpl::doTextFieldCommandFromEvent(
diff --git a/webkit/glue/password_autocomplete_listener.cc b/webkit/glue/password_autocomplete_listener_impl.cc
index ca6fd9a..883e6bc 100644
--- a/webkit/glue/password_autocomplete_listener.cc
+++ b/webkit/glue/password_autocomplete_listener_impl.cc
@@ -14,7 +14,7 @@
#include "webkit/api/public/WebNode.h"
#include "webkit/api/public/WebVector.h"
#include "webkit/glue/glue_util.h"
-#include "webkit/glue/password_autocomplete_listener.h"
+#include "webkit/glue/password_autocomplete_listener_impl.h"
#include "webkit/glue/webframe_impl.h"
#include "webkit/glue/webview_impl.h"
@@ -22,15 +22,9 @@ namespace webkit_glue {
HTMLInputDelegate::HTMLInputDelegate(WebCore::HTMLInputElement* element)
: element_(element) {
- // Reference the element for the lifetime of this delegate.
- // element is NULL when testing.
- if (element_)
- element_->ref();
}
HTMLInputDelegate::~HTMLInputDelegate() {
- if (element_)
- element_->deref();
}
void HTMLInputDelegate::SetValue(const string16& value) {
@@ -62,7 +56,7 @@ void HTMLInputDelegate::RefreshAutofillPopup(
webkit_glue::NodeToWebNode(element_), suggestions, 0);
}
-PasswordAutocompleteListener::PasswordAutocompleteListener(
+PasswordAutocompleteListenerImpl::PasswordAutocompleteListenerImpl(
HTMLInputDelegate* username_delegate,
HTMLInputDelegate* password_delegate,
const PasswordFormDomManager::FillData& data)
@@ -71,8 +65,8 @@ PasswordAutocompleteListener::PasswordAutocompleteListener(
data_(data) {
}
-void PasswordAutocompleteListener::OnBlur(WebCore::HTMLInputElement* element,
- const WebCore::String& user_input) {
+void PasswordAutocompleteListenerImpl::didBlurInputElement(
+ const WebCore::String& user_input) {
// If this listener exists, its because the password manager had more than
// one match for the password form, which implies it had at least one
// [preferred] username/password pair.
@@ -92,11 +86,10 @@ void PasswordAutocompleteListener::OnBlur(WebCore::HTMLInputElement* element,
password_delegate_->OnFinishedAutocompleting();
}
-void PasswordAutocompleteListener::OnInlineAutocompleteNeeded(
- WebCore::HTMLInputElement* element,
+void PasswordAutocompleteListenerImpl::performInlineAutocomplete(
const WebCore::String& user_input,
- bool backspace_or_delete,
- bool with_suggestion_popup) {
+ bool backspace_or_delete_pressed,
+ bool show_suggestions) {
// If wait_for_username is true, we only autofill the password when
// the username field is blurred (i.e not inline) with a matching
// username string entered.
@@ -105,20 +98,20 @@ void PasswordAutocompleteListener::OnInlineAutocompleteNeeded(
string16 user_input16 = webkit_glue::StringToString16(user_input);
- if (with_suggestion_popup) {
+ if (show_suggestions) {
std::vector<string16> suggestions;
GetSuggestions(user_input16, &suggestions);
username_delegate_->RefreshAutofillPopup(suggestions, 0);
}
- if (backspace_or_delete)
+ if (backspace_or_delete_pressed)
return; // Don't inline autocomplete when the user deleted something.
// Look for any suitable matches to current field text.
// TODO(timsteele): The preferred login (in basic_data.values) and
// additional logins could be bundled into the same data structure
// (possibly even as WebCore strings) upon construction of the
- // PasswordAutocompleteListener to simplify lookup and save string
+ // PasswordAutocompleteListenerImpl to simplify lookup and save string
// conversions (see SetValue) on each successful call to
// OnInlineAutocompleteNeeded.
if (TryToMatch(user_input16,
@@ -137,9 +130,9 @@ void PasswordAutocompleteListener::OnInlineAutocompleteNeeded(
}
}
-bool PasswordAutocompleteListener::TryToMatch(const string16& input,
- const string16& username,
- const string16& password) {
+bool PasswordAutocompleteListenerImpl::TryToMatch(const string16& input,
+ const string16& username,
+ const string16& password) {
if (!StartsWith(username, input, false))
return false;
@@ -152,7 +145,7 @@ bool PasswordAutocompleteListener::TryToMatch(const string16& input,
return true;
}
-void PasswordAutocompleteListener::GetSuggestions(
+void PasswordAutocompleteListenerImpl::GetSuggestions(
const string16& input, std::vector<string16>* suggestions) {
if (StartsWith(data_.basic_data.values[0], input, false))
suggestions->push_back(data_.basic_data.values[0]);
diff --git a/webkit/glue/password_autocomplete_listener.h b/webkit/glue/password_autocomplete_listener_impl.h
index 52643e7..cc56a95 100644
--- a/webkit/glue/password_autocomplete_listener.h
+++ b/webkit/glue/password_autocomplete_listener_impl.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
+#include "webkit/api/src/PasswordAutocompleteListener.h"
#include "webkit/glue/password_form_dom_manager.h"
namespace WebCore {
@@ -25,6 +26,7 @@ class HTMLInputDelegate {
explicit HTMLInputDelegate(WebCore::HTMLInputElement* element);
virtual ~HTMLInputDelegate();
+ // These are virtual to support unit testing.
virtual void SetValue(const string16& value);
virtual void SetSelectionRange(size_t start, size_t end);
virtual void OnFinishedAutocompleting();
@@ -36,26 +38,26 @@ class HTMLInputDelegate {
// The underlying DOM element we're wrapping. We reference the underlying
// HTMLInputElement for its lifetime to ensure it does not get freed by
// WebCore while in use by the delegate instance.
- WebCore::HTMLInputElement* element_;
+ RefPtr<WebCore::HTMLInputElement> element_;
DISALLOW_COPY_AND_ASSIGN(HTMLInputDelegate);
};
-
-class PasswordAutocompleteListener {
+class PasswordAutocompleteListenerImpl :
+ public WebKit::PasswordAutocompleteListener {
public:
- PasswordAutocompleteListener(HTMLInputDelegate* username_delegate,
- HTMLInputDelegate* password_delegate,
- const PasswordFormDomManager::FillData& data);
- virtual ~PasswordAutocompleteListener() {
+ PasswordAutocompleteListenerImpl(
+ HTMLInputDelegate* username_delegate,
+ HTMLInputDelegate* password_delegate,
+ const PasswordFormDomManager::FillData& data);
+ ~PasswordAutocompleteListenerImpl() {
}
- virtual void OnBlur(WebCore::HTMLInputElement* element,
- const WebCore::String& user_input);
- virtual void OnInlineAutocompleteNeeded(WebCore::HTMLInputElement* element,
- const WebCore::String& user_input,
- bool backspace_or_delete,
- bool with_suggestion_popup);
+ // WebKit::PasswordAutocompleteListener methods:
+ virtual void didBlurInputElement(const WebCore::String& user_input);
+ virtual void performInlineAutocomplete(const WebCore::String& user_input,
+ bool backspace_or_delete_pressed,
+ bool show_suggestions);
private:
// Check if the input string resembles a potential matching login
@@ -76,7 +78,7 @@ class PasswordAutocompleteListener {
// Contains the extra logins for matching on delta/blur.
PasswordFormDomManager::FillData data_;
- DISALLOW_COPY_AND_ASSIGN(PasswordAutocompleteListener);
+ DISALLOW_COPY_AND_ASSIGN(PasswordAutocompleteListenerImpl);
};
} // webkit_glue
diff --git a/webkit/glue/password_autocomplete_listener_unittest.cc b/webkit/glue/password_autocomplete_listener_unittest.cc
index 38730c1..c422345 100644
--- a/webkit/glue/password_autocomplete_listener_unittest.cc
+++ b/webkit/glue/password_autocomplete_listener_unittest.cc
@@ -27,11 +27,11 @@ MSVC_POP_WARNING();
#include "base/string_util.h"
#include "webkit/glue/glue_util.h"
-#include "webkit/glue/password_autocomplete_listener.h"
+#include "webkit/glue/password_autocomplete_listener_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
using WebCore::String;
-using webkit_glue::PasswordAutocompleteListener;
+using webkit_glue::PasswordAutocompleteListenerImpl;
using webkit_glue::PasswordFormDomManager;
using webkit_glue::HTMLInputDelegate;
@@ -127,23 +127,24 @@ TEST_F(PasswordManagerAutocompleteTests, OnBlur) {
TestHTMLInputDelegate* username_delegate = new TestHTMLInputDelegate();
TestHTMLInputDelegate* password_delegate = new TestHTMLInputDelegate();
- scoped_ptr<PasswordAutocompleteListener> listener(
- new PasswordAutocompleteListener(username_delegate, password_delegate,
- data_));
+ scoped_ptr<PasswordAutocompleteListenerImpl> listener(
+ new PasswordAutocompleteListenerImpl(username_delegate,
+ password_delegate,
+ data_));
// Clear the password field.
password_delegate->SetValue(string16());
// Simulate a blur event on the username field and expect a password autofill.
- listener->OnBlur(NULL, webkit_glue::String16ToString(username1_));
+ listener->didBlurInputElement(webkit_glue::String16ToString(username1_));
EXPECT_EQ(password1_, password_delegate->value());
// Now the user goes back and changes the username to something we don't
// have saved. The password should remain unchanged.
- listener->OnBlur(NULL, String("blahblahblah"));
+ listener->didBlurInputElement(String("blahblahblah"));
EXPECT_EQ(password1_, password_delegate->value());
// Now they type in the additional login username.
- listener->OnBlur(NULL, webkit_glue::String16ToString(username2_));
+ listener->didBlurInputElement(webkit_glue::String16ToString(username2_));
EXPECT_EQ(password2_, password_delegate->value());
}
@@ -151,13 +152,14 @@ TEST_F(PasswordManagerAutocompleteTests, OnInlineAutocompleteNeeded) {
TestHTMLInputDelegate* username_delegate = new TestHTMLInputDelegate();
TestHTMLInputDelegate* password_delegate = new TestHTMLInputDelegate();
- scoped_ptr<PasswordAutocompleteListener> listener(
- new PasswordAutocompleteListener(username_delegate, password_delegate,
- data_));
+ scoped_ptr<PasswordAutocompleteListenerImpl> listener(
+ new PasswordAutocompleteListenerImpl(username_delegate,
+ password_delegate,
+ data_));
password_delegate->SetValue(string16());
// Simulate the user typing in the first letter of 'alice', a stored username.
- listener->OnInlineAutocompleteNeeded(NULL, String("a"), false, false);
+ listener->performInlineAutocomplete(String("a"), false, false);
// Both the username and password delegates should reflect selection
// of the stored login.
EXPECT_EQ(username1_, username_delegate->value());
@@ -170,7 +172,7 @@ TEST_F(PasswordManagerAutocompleteTests, OnInlineAutocompleteNeeded) {
EXPECT_TRUE(password_delegate->did_call_on_finish());
// Now the user types the next letter of the same username, 'l'.
- listener->OnInlineAutocompleteNeeded(NULL, String("al"), false, false);
+ listener->performInlineAutocomplete(String("al"), false, false);
// Now the fields should have the same value, but the selection should have a
// different start value.
EXPECT_EQ(username1_, username_delegate->value());
@@ -187,10 +189,10 @@ TEST_F(PasswordManagerAutocompleteTests, OnInlineAutocompleteNeeded) {
// and selection would be set directly by WebCore in practice.
// Reset the delegate's test state so we can determine what, if anything,
- // was invoked during OnInlineAutocompleteNeeded.
+ // was invoked during performInlineAutocomplete.
username_delegate->ResetTestState();
password_delegate->ResetTestState();
- listener->OnInlineAutocompleteNeeded(NULL, String("alf"), false, false);
+ listener->performInlineAutocomplete(String("alf"), false, false);
EXPECT_FALSE(username_delegate->did_set_selection());
EXPECT_FALSE(username_delegate->did_set_value());
EXPECT_FALSE(username_delegate->did_call_on_finish());
@@ -198,7 +200,7 @@ TEST_F(PasswordManagerAutocompleteTests, OnInlineAutocompleteNeeded) {
EXPECT_FALSE(password_delegate->did_call_on_finish());
// Ok, so now the user removes all the text and enters the letter 'b'.
- listener->OnInlineAutocompleteNeeded(NULL, String("b"), false, false);
+ listener->performInlineAutocomplete(String("b"), false, false);
// The username and password fields should match the 'bob' entry.
EXPECT_EQ(username2_, username_delegate->value());
EXPECT_EQ(password2_, password_delegate->value());
@@ -215,34 +217,35 @@ TEST_F(PasswordManagerAutocompleteTests, TestWaitUsername) {
// We require an explicit blur on the username field, and that a valid
// matching username is in the field, before we autofill passwords.
data_.wait_for_username = true;
- scoped_ptr<PasswordAutocompleteListener> listener(
- new PasswordAutocompleteListener(username_delegate, password_delegate,
- data_));
+ scoped_ptr<PasswordAutocompleteListenerImpl> listener(
+ new PasswordAutocompleteListenerImpl(username_delegate,
+ password_delegate,
+ data_));
string16 empty;
// In all cases, username_delegate should remain empty because we should
// never modify it when wait_for_username is true; only the user can by
// typing into (in real life) the HTMLInputElement.
password_delegate->SetValue(string16());
- listener->OnInlineAutocompleteNeeded(NULL, String("a"), false, false);
+ listener->performInlineAutocomplete(String("a"), false, false);
EXPECT_EQ(empty, username_delegate->value());
EXPECT_EQ(empty, password_delegate->value());
- listener->OnInlineAutocompleteNeeded(NULL, String("al"), false, false);
+ listener->performInlineAutocomplete(String("al"), false, false);
EXPECT_EQ(empty, username_delegate->value());
EXPECT_EQ(empty, password_delegate->value());
- listener->OnInlineAutocompleteNeeded(NULL, String("alice"), false, false);
+ listener->performInlineAutocomplete(String("alice"), false, false);
EXPECT_EQ(empty, username_delegate->value());
EXPECT_EQ(empty, password_delegate->value());
- listener->OnBlur(NULL, String("a"));
+ listener->didBlurInputElement(String("a"));
EXPECT_EQ(empty, username_delegate->value());
EXPECT_EQ(empty, password_delegate->value());
- listener->OnBlur(NULL, String("ali"));
+ listener->didBlurInputElement(String("ali"));
EXPECT_EQ(empty, username_delegate->value());
EXPECT_EQ(empty, password_delegate->value());
// Blur with 'alice' should allow password autofill.
- listener->OnBlur(NULL, String("alice"));
+ listener->didBlurInputElement(String("alice"));
EXPECT_EQ(empty, username_delegate->value());
EXPECT_EQ(password1_, password_delegate->value());
}
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index e3a0fd5..b64af0f 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -142,10 +142,10 @@
#include "webkit/api/public/WebURLError.h"
#include "webkit/api/public/WebVector.h"
#include "webkit/api/src/DOMUtilitiesPrivate.h"
+#include "webkit/api/src/PasswordAutocompleteListener.h"
#include "webkit/api/src/WebDataSourceImpl.h"
#include "webkit/glue/chrome_client_impl.h"
#include "webkit/glue/glue_util.h"
-#include "webkit/glue/password_autocomplete_listener.h"
#include "webkit/glue/webframe_impl.h"
#include "webkit/glue/webview_impl.h"
@@ -192,6 +192,7 @@ using WebCore::TextIterator;
using WebCore::VisiblePosition;
using WebCore::XPathResult;
+using WebKit::PasswordAutocompleteListener;
using WebKit::WebCanvas;
using WebKit::WebConsoleMessage;
using WebKit::WebData;
@@ -1698,13 +1699,13 @@ void WebFrameImpl::SetAllowsScrolling(bool flag) {
void WebFrameImpl::RegisterPasswordListener(
PassRefPtr<HTMLInputElement> input_element,
- webkit_glue::PasswordAutocompleteListener* listener) {
+ PasswordAutocompleteListener* listener) {
RefPtr<HTMLInputElement> element = input_element;
ASSERT(password_listeners_.find(element) == password_listeners_.end());
password_listeners_.set(element, listener);
}
-webkit_glue::PasswordAutocompleteListener* WebFrameImpl::GetPasswordListener(
+PasswordAutocompleteListener* WebFrameImpl::GetPasswordListener(
HTMLInputElement* input_element) {
return password_listeners_.get(RefPtr<HTMLInputElement>(input_element));
}
diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h
index 8ec1f9f..9d0b86d 100644
--- a/webkit/glue/webframe_impl.h
+++ b/webkit/glue/webframe_impl.h
@@ -52,15 +52,12 @@ struct WindowFeatures;
}
namespace WebKit {
+class PasswordAutocompleteListener;
class WebDataSourceImpl;
class WebFrameClient;
class WebView;
}
-namespace webkit_glue {
-class PasswordAutocompleteListener;
-}
-
// Implementation of WebFrame, note that this is a reference counted object.
class WebFrameImpl : public WebKit::WebFrame, public RefCounted<WebFrameImpl> {
public:
@@ -230,13 +227,13 @@ class WebFrameImpl : public WebKit::WebFrame, public RefCounted<WebFrameImpl> {
// The WebFrameImpl becomes the owner of the passed listener.
void RegisterPasswordListener(
PassRefPtr<WebCore::HTMLInputElement> user_name_input_element,
- webkit_glue::PasswordAutocompleteListener* listener);
+ WebKit::PasswordAutocompleteListener* listener);
// Returns the password autocomplete listener associated with the passed
// user name input element, or NULL if none available.
// Note that the returned listener is owner by the WebFrameImpl and should not
// be kept around as it is deleted when the page goes away.
- webkit_glue::PasswordAutocompleteListener* GetPasswordListener(
+ WebKit::PasswordAutocompleteListener* GetPasswordListener(
WebCore::HTMLInputElement* user_name_input_element);
WebKit::WebFrameClient* client() const { return client_handle_->client(); }
@@ -380,7 +377,7 @@ class WebFrameImpl : public WebKit::WebFrame, public RefCounted<WebFrameImpl> {
// The input fields that are interested in edit events and their associated
// listeners.
typedef HashMap<RefPtr<WebCore::HTMLInputElement>,
- webkit_glue::PasswordAutocompleteListener*> PasswordListenerMap;
+ WebKit::PasswordAutocompleteListener*> PasswordListenerMap;
PasswordListenerMap password_listeners_;
};
diff --git a/webkit/glue/webpopupmenu_impl.cc b/webkit/glue/webpopupmenu_impl.cc
index 0c4c437..881511f 100644
--- a/webkit/glue/webpopupmenu_impl.cc
+++ b/webkit/glue/webpopupmenu_impl.cc
@@ -15,7 +15,6 @@
#include "SkiaUtils.h"
#undef LOG
-#include "base/logging.h"
#include "skia/ext/platform_canvas.h"
#include "webkit/api/public/WebInputEvent.h"
#include "webkit/api/public/WebRect.h"
@@ -151,7 +150,7 @@ void WebPopupMenuImpl::paint(WebCanvas* canvas, const WebRect& rect) {
// PlatformGraphicsContext is actually a pointer to PlatformContextSkia.
GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context));
#else
- NOTIMPLEMENTED();
+ notImplemented();
#endif
widget_->paint(&gc, webkit_glue::WebRectToIntRect(rect));
}
@@ -254,13 +253,13 @@ void WebPopupMenuImpl::scroll(const WebCore::IntSize& scroll_delta,
WebCore::IntPoint WebPopupMenuImpl::screenToWindow(
const WebCore::IntPoint& point) const {
- NOTIMPLEMENTED();
+ notImplemented();
return WebCore::IntPoint();
}
WebCore::IntRect WebPopupMenuImpl::windowToScreen(
const WebCore::IntRect& rect) const {
- NOTIMPLEMENTED();
+ notImplemented();
return WebCore::IntRect();
}
@@ -278,7 +277,7 @@ void WebPopupMenuImpl::scrollbarsModeDidChange() const {
// WebCore::FramelessScrollViewClient
void WebPopupMenuImpl::popupClosed(WebCore::FramelessScrollView* widget) {
- DCHECK(widget == widget_);
+ ASSERT(widget == widget_);
if (widget_) {
widget_->setClient(NULL);
widget_ = NULL;
diff --git a/webkit/glue/webworker_impl.cc b/webkit/glue/webworker_impl.cc
index ec943cd..172ba4d 100644
--- a/webkit/glue/webworker_impl.cc
+++ b/webkit/glue/webworker_impl.cc
@@ -4,8 +4,6 @@
#include "config.h"
-#include "base/compiler_specific.h"
-
#include "DedicatedWorkerContext.h"
#include "DedicatedWorkerThread.h"
#include "GenericWorkerTask.h"
diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp
index f7846c6..61cc89a 100644
--- a/webkit/webkit.gyp
+++ b/webkit/webkit.gyp
@@ -182,6 +182,7 @@
'api/src/MediaPlayerPrivateChromium.cpp',
'api/src/NotificationPresenterImpl.h',
'api/src/NotificationPresenterImpl.cpp',
+ 'api/src/PasswordAutocompleteListener.h',
'api/src/PlatformMessagePortChannel.cpp',
'api/src/PlatformMessagePortChannel.h',
'api/src/ResourceHandle.cpp',
@@ -596,8 +597,8 @@
'glue/multipart_response_delegate.h',
'glue/npruntime_util.cc',
'glue/npruntime_util.h',
- 'glue/password_autocomplete_listener.cc',
- 'glue/password_autocomplete_listener.h',
+ 'glue/password_autocomplete_listener_impl.cc',
+ 'glue/password_autocomplete_listener_impl.h',
'glue/password_form.h',
'glue/password_form_dom_manager.cc',
'glue/password_form_dom_manager.h',