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

Side by Side Diff: Source/core/page/Chrome.cpp

Issue 27030014: Remove Backslash-as-JPY hack (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: TextCodec/Encoding added Created 7 years, 2 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/html/HTMLOptionElement.cpp ('k') | Source/core/platform/graphics/Font.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) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2012, Samsung Electronics. All rights reserved. 4 * Copyright (C) 2012, Samsung Electronics. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 { 236 {
237 if (!canRunModalIfDuringPageDismissal(m_page, ChromeClient::AlertDialog, mes sage)) 237 if (!canRunModalIfDuringPageDismissal(m_page, ChromeClient::AlertDialog, mes sage))
238 return; 238 return;
239 239
240 // Defer loads in case the client method runs a new event loop that would 240 // Defer loads in case the client method runs a new event loop that would
241 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript. 241 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript.
242 PageGroupLoadDeferrer deferrer(m_page, true); 242 PageGroupLoadDeferrer deferrer(m_page, true);
243 243
244 ASSERT(frame); 244 ASSERT(frame);
245 notifyPopupOpeningObservers(); 245 notifyPopupOpeningObservers();
246 String displayMessage = frame->displayStringModifiedByEncoding(message);
247 246
248 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(m_page, displayMessage); 247 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(m_page, message);
249 m_client->runJavaScriptAlert(frame, displayMessage); 248 m_client->runJavaScriptAlert(frame, message);
250 InspectorInstrumentation::didRunJavaScriptDialog(cookie); 249 InspectorInstrumentation::didRunJavaScriptDialog(cookie);
251 } 250 }
252 251
253 bool Chrome::runJavaScriptConfirm(Frame* frame, const String& message) 252 bool Chrome::runJavaScriptConfirm(Frame* frame, const String& message)
254 { 253 {
255 if (!canRunModalIfDuringPageDismissal(m_page, ChromeClient::ConfirmDialog, m essage)) 254 if (!canRunModalIfDuringPageDismissal(m_page, ChromeClient::ConfirmDialog, m essage))
256 return false; 255 return false;
257 256
258 // Defer loads in case the client method runs a new event loop that would 257 // Defer loads in case the client method runs a new event loop that would
259 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript. 258 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript.
260 PageGroupLoadDeferrer deferrer(m_page, true); 259 PageGroupLoadDeferrer deferrer(m_page, true);
261 260
262 ASSERT(frame); 261 ASSERT(frame);
263 notifyPopupOpeningObservers(); 262 notifyPopupOpeningObservers();
264 String displayMessage = frame->displayStringModifiedByEncoding(message);
265 263
266 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(m_page, displayMessage); 264 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(m_page, message);
267 bool ok = m_client->runJavaScriptConfirm(frame, displayMessage); 265 bool ok = m_client->runJavaScriptConfirm(frame, message);
268 InspectorInstrumentation::didRunJavaScriptDialog(cookie); 266 InspectorInstrumentation::didRunJavaScriptDialog(cookie);
269 return ok; 267 return ok;
270 } 268 }
271 269
272 bool Chrome::runJavaScriptPrompt(Frame* frame, const String& prompt, const Strin g& defaultValue, String& result) 270 bool Chrome::runJavaScriptPrompt(Frame* frame, const String& prompt, const Strin g& defaultValue, String& result)
273 { 271 {
274 if (!canRunModalIfDuringPageDismissal(m_page, ChromeClient::PromptDialog, pr ompt)) 272 if (!canRunModalIfDuringPageDismissal(m_page, ChromeClient::PromptDialog, pr ompt))
275 return false; 273 return false;
276 274
277 // Defer loads in case the client method runs a new event loop that would 275 // Defer loads in case the client method runs a new event loop that would
278 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript. 276 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript.
279 PageGroupLoadDeferrer deferrer(m_page, true); 277 PageGroupLoadDeferrer deferrer(m_page, true);
280 278
281 ASSERT(frame); 279 ASSERT(frame);
282 notifyPopupOpeningObservers(); 280 notifyPopupOpeningObservers();
283 String displayPrompt = frame->displayStringModifiedByEncoding(prompt);
284 281
285 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(m_page, displayPrompt); 282 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(m_page, prompt);
286 bool ok = m_client->runJavaScriptPrompt(frame, displayPrompt, frame->display StringModifiedByEncoding(defaultValue), result); 283 bool ok = m_client->runJavaScriptPrompt(frame, prompt, defaultValue, result) ;
287 InspectorInstrumentation::didRunJavaScriptDialog(cookie); 284 InspectorInstrumentation::didRunJavaScriptDialog(cookie);
288 285
289 if (ok)
290 result = frame->displayStringModifiedByEncoding(result);
291
292 return ok; 286 return ok;
293 } 287 }
294 288
295 void Chrome::setStatusbarText(Frame* frame, const String& status) 289 void Chrome::setStatusbarText(Frame* frame, const String& status)
296 { 290 {
297 ASSERT(frame); 291 ASSERT(frame);
298 m_client->setStatusbarText(frame->displayStringModifiedByEncoding(status)); 292 m_client->setStatusbarText(status);
299 } 293 }
300 294
301 IntRect Chrome::windowResizerRect() const 295 IntRect Chrome::windowResizerRect() const
302 { 296 {
303 return m_client->windowResizerRect(); 297 return m_client->windowResizerRect();
304 } 298 }
305 299
306 void Chrome::mouseDidMoveOverElement(const HitTestResult& result, unsigned modif ierFlags) 300 void Chrome::mouseDidMoveOverElement(const HitTestResult& result, unsigned modif ierFlags)
307 { 301 {
308 if (result.innerNode()) { 302 if (result.innerNode()) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 } 407 }
414 408
415 void Chrome::notifyPopupOpeningObservers() const 409 void Chrome::notifyPopupOpeningObservers() const
416 { 410 {
417 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers); 411 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers);
418 for (size_t i = 0; i < observers.size(); ++i) 412 for (size_t i = 0; i < observers.size(); ++i)
419 observers[i]->willOpenPopup(); 413 observers[i]->willOpenPopup();
420 } 414 }
421 415
422 } // namespace WebCore 416 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLOptionElement.cpp ('k') | Source/core/platform/graphics/Font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698