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

Side by Side Diff: Source/web/AutofillPopupMenuClient.cpp

Issue 22955006: Chrome::client() should return a ChromeClient reference. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
« no previous file with comments | « Source/core/testing/Internals.cpp ('k') | Source/web/PopupContainer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 m_itemIDs.append(itemIDs[i]); 324 m_itemIDs.append(itemIDs[i]);
325 } 325 }
326 326
327 // Try to preserve selection if possible. 327 // Try to preserve selection if possible.
328 if (getSelectedIndex() >= static_cast<int>(names.size())) 328 if (getSelectedIndex() >= static_cast<int>(names.size()))
329 setSelectedIndex(-1); 329 setSelectedIndex(-1);
330 } 330 }
331 331
332 WebViewImpl* AutofillPopupMenuClient::getWebView() const 332 WebViewImpl* AutofillPopupMenuClient::getWebView() const
333 { 333 {
334 Frame* frame = m_textField->document()->frame(); 334 return WebViewImpl::fromPage(m_textField->document()->page());
335 if (!frame)
336 return 0;
337
338 Page* page = frame->page();
339 if (!page)
340 return 0;
341
342 return static_cast<WebViewImpl*>(page->chrome().client()->webView());
343 } 335 }
344 336
345 RenderStyle* AutofillPopupMenuClient::textFieldStyle() const 337 RenderStyle* AutofillPopupMenuClient::textFieldStyle() const
346 { 338 {
347 RenderStyle* style = m_textField->computedStyle(); 339 RenderStyle* style = m_textField->computedStyle();
348 if (!style) { 340 if (!style) {
349 // It seems we can only have a 0 style in a TextField if the 341 // It seems we can only have a 0 style in a TextField if the
350 // node is detached, in which case we the popup should not be 342 // node is detached, in which case we the popup should not be
351 // showing. Please report this in http://crbug.com/7708 and 343 // showing. Please report this in http://crbug.com/7708 and
352 // include the page you were visiting. 344 // include the page you were visiting.
353 ASSERT_NOT_REACHED(); 345 ASSERT_NOT_REACHED();
354 } 346 }
355 return style; 347 return style;
356 } 348 }
357 349
358 } // namespace WebKit 350 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.cpp ('k') | Source/web/PopupContainer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698