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

Side by Side Diff: third_party/WebKit/Source/core/page/ChromeClient.cpp

Issue 2555923002: Changed TextDirection to an enum class and renamed its members (Closed)
Patch Set: Rebase after reopen Created 3 years, 12 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
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 if (toolTip.isEmpty()) { 173 if (toolTip.isEmpty()) {
174 if (Node* node = result.innerNode()) { 174 if (Node* node = result.innerNode()) {
175 if (node->isElementNode()) { 175 if (node->isElementNode()) {
176 toolTip = toElement(node)->defaultToolTip(); 176 toolTip = toElement(node)->defaultToolTip();
177 177
178 // FIXME: We should obtain text direction of tooltip from 178 // FIXME: We should obtain text direction of tooltip from
179 // ChromeClient or platform. As of October 2011, all client 179 // ChromeClient or platform. As of October 2011, all client
180 // implementations don't use text direction information for 180 // implementations don't use text direction information for
181 // ChromeClient::setToolTip. We'll work on tooltip text 181 // ChromeClient::setToolTip. We'll work on tooltip text
182 // direction during bidi cleanup in form inputs. 182 // direction during bidi cleanup in form inputs.
183 toolTipDirection = LTR; 183 toolTipDirection = TextDirection::Ltr;
184 } 184 }
185 } 185 }
186 } 186 }
187 187
188 if (m_lastToolTipPoint == result.hitTestLocation().point() && 188 if (m_lastToolTipPoint == result.hitTestLocation().point() &&
189 m_lastToolTipText == toolTip) 189 m_lastToolTipText == toolTip)
190 return; 190 return;
191 m_lastToolTipPoint = result.hitTestLocation().point(); 191 m_lastToolTipPoint = result.hitTestLocation().point();
192 m_lastToolTipText = toolTip; 192 m_lastToolTipText = toolTip;
193 setToolTip(frame, toolTip, toolTipDirection); 193 setToolTip(frame, toolTip, toolTipDirection);
194 } 194 }
195 195
196 void ChromeClient::clearToolTip(LocalFrame& frame) { 196 void ChromeClient::clearToolTip(LocalFrame& frame) {
197 // Do not check m_lastToolTip* and do not update them intentionally. 197 // Do not check m_lastToolTip* and do not update them intentionally.
198 // We don't want to show tooltips with same content after clearToolTip(). 198 // We don't want to show tooltips with same content after clearToolTip().
199 setToolTip(frame, String(), LTR); 199 setToolTip(frame, String(), TextDirection::Ltr);
200 } 200 }
201 201
202 bool ChromeClient::print(LocalFrame* frame) { 202 bool ChromeClient::print(LocalFrame* frame) {
203 if (frame->document()->isSandboxed(SandboxModals)) { 203 if (frame->document()->isSandboxed(SandboxModals)) {
204 UseCounter::count(frame, UseCounter::DialogInSandboxedContext); 204 UseCounter::count(frame, UseCounter::DialogInSandboxedContext);
205 frame->console().addMessage(ConsoleMessage::create( 205 frame->console().addMessage(ConsoleMessage::create(
206 SecurityMessageSource, ErrorMessageLevel, 206 SecurityMessageSource, ErrorMessageLevel,
207 "Ignored call to 'print()'. The document is sandboxed, and the " 207 "Ignored call to 'print()'. The document is sandboxed, and the "
208 "'allow-modals' keyword is not set.")); 208 "'allow-modals' keyword is not set."));
209 return false; 209 return false;
210 } 210 }
211 211
212 // Suspend pages in case the client method runs a new event loop that would 212 // Suspend pages in case the client method runs a new event loop that would
213 // otherwise cause the load to continue while we're in the middle of 213 // otherwise cause the load to continue while we're in the middle of
214 // executing JavaScript. 214 // executing JavaScript.
215 ScopedPageSuspender suspender; 215 ScopedPageSuspender suspender;
216 216
217 printDelegate(frame); 217 printDelegate(frame);
218 return true; 218 return true;
219 } 219 }
220 220
221 } // namespace blink 221 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698