| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 using WebCore::SubstituteData; | 176 using WebCore::SubstituteData; |
| 177 using WebCore::TextIterator; | 177 using WebCore::TextIterator; |
| 178 using WebCore::VisiblePosition; | 178 using WebCore::VisiblePosition; |
| 179 using WebCore::XPathResult; | 179 using WebCore::XPathResult; |
| 180 | 180 |
| 181 // TODO(darin): This used to be defined on WidgetClientChromium, but that | 181 // TODO(darin): This used to be defined on WidgetClientChromium, but that |
| 182 // interface no longer exists. We'll need to come up with something better | 182 // interface no longer exists. We'll need to come up with something better |
| 183 // once we figure out how to make tickmark support work again! | 183 // once we figure out how to make tickmark support work again! |
| 184 static const size_t kNoTickmark = size_t(-1); | 184 static const size_t kNoTickmark = size_t(-1); |
| 185 | 185 |
| 186 static const wchar_t* const kWebFrameActiveCount = L"WebFrameActiveCount"; | 186 // Key for a StatsCounter tracking how many WebFrames are active. |
| 187 static const char* const kWebFrameActiveCount = "WebFrameActiveCount"; |
| 187 | 188 |
| 188 static const char* const kOSDType = "application/opensearchdescription+xml"; | 189 static const char* const kOSDType = "application/opensearchdescription+xml"; |
| 189 static const char* const kOSDRel = "search"; | 190 static const char* const kOSDRel = "search"; |
| 190 | 191 |
| 191 // The separator between frames when the frames are converted to plain text. | 192 // The separator between frames when the frames are converted to plain text. |
| 192 static const wchar_t kFrameSeparator[] = L"\n\n"; | 193 static const wchar_t kFrameSeparator[] = L"\n\n"; |
| 193 static const int kFrameSeparatorLen = arraysize(kFrameSeparator) - 1; | 194 static const int kFrameSeparatorLen = arraysize(kFrameSeparator) - 1; |
| 194 | 195 |
| 195 // Backend for GetContentAsPlainText, this is a recursive function that gets | 196 // Backend for GetContentAsPlainText, this is a recursive function that gets |
| 196 // the text for the current frame and all of its subframes. It will append | 197 // the text for the current frame and all of its subframes. It will append |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 // only get saved to history when it becomes the previous item. The caller | 481 // only get saved to history when it becomes the previous item. The caller |
| 481 // is expected to query the history state after a navigation occurs, after | 482 // is expected to query the history state after a navigation occurs, after |
| 482 // the desired history item has become the previous entry. | 483 // the desired history item has become the previous entry. |
| 483 if (frame_->page()->backForwardList()->isPreviousItemFake()) | 484 if (frame_->page()->backForwardList()->isPreviousItemFake()) |
| 484 return false; | 485 return false; |
| 485 | 486 |
| 486 RefPtr<HistoryItem> item = frame_->page()->backForwardList()->previousItem(); | 487 RefPtr<HistoryItem> item = frame_->page()->backForwardList()->previousItem(); |
| 487 if (!item) | 488 if (!item) |
| 488 return false; | 489 return false; |
| 489 | 490 |
| 490 static StatsCounterTimer history_timer(L"GetHistoryTimer"); | 491 static StatsCounterTimer history_timer("GetHistoryTimer"); |
| 491 StatsScope<StatsCounterTimer> history_scope(history_timer); | 492 StatsScope<StatsCounterTimer> history_scope(history_timer); |
| 492 | 493 |
| 493 webkit_glue::HistoryItemToString(item, history_state); | 494 webkit_glue::HistoryItemToString(item, history_state); |
| 494 *url = webkit_glue::KURLToGURL(item->url()); | 495 *url = webkit_glue::KURLToGURL(item->url()); |
| 495 *title = webkit_glue::StringToStdWString(item->title()); | 496 *title = webkit_glue::StringToStdWString(item->title()); |
| 496 | 497 |
| 497 return true; | 498 return true; |
| 498 } | 499 } |
| 499 | 500 |
| 500 bool WebFrameImpl::GetCurrentState(GURL* url, std::wstring* title, | 501 bool WebFrameImpl::GetCurrentState(GURL* url, std::wstring* title, |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 if (view) | 1468 if (view) |
| 1468 view->layout(); | 1469 view->layout(); |
| 1469 | 1470 |
| 1470 // recursively layout child frames | 1471 // recursively layout child frames |
| 1471 Frame* child = frame_->tree()->firstChild(); | 1472 Frame* child = frame_->tree()->firstChild(); |
| 1472 for (; child; child = child->tree()->nextSibling()) | 1473 for (; child; child = child->tree()->nextSibling()) |
| 1473 FromFrame(child)->Layout(); | 1474 FromFrame(child)->Layout(); |
| 1474 } | 1475 } |
| 1475 | 1476 |
| 1476 void WebFrameImpl::Paint(gfx::PlatformCanvas* canvas, const gfx::Rect& rect) { | 1477 void WebFrameImpl::Paint(gfx::PlatformCanvas* canvas, const gfx::Rect& rect) { |
| 1477 static StatsRate rendering(L"WebFramePaintTime"); | 1478 static StatsRate rendering("WebFramePaintTime"); |
| 1478 StatsScope<StatsRate> rendering_scope(rendering); | 1479 StatsScope<StatsRate> rendering_scope(rendering); |
| 1479 | 1480 |
| 1480 if (!rect.IsEmpty()) { | 1481 if (!rect.IsEmpty()) { |
| 1481 IntRect dirty_rect(rect.x(), rect.y(), rect.width(), rect.height()); | 1482 IntRect dirty_rect(rect.x(), rect.y(), rect.width(), rect.height()); |
| 1482 #if defined(OS_MACOSX) | 1483 #if defined(OS_MACOSX) |
| 1483 CGContextRef context = canvas->getTopPlatformDevice().GetBitmapContext(); | 1484 CGContextRef context = canvas->getTopPlatformDevice().GetBitmapContext(); |
| 1484 GraphicsContext gc(context); | 1485 GraphicsContext gc(context); |
| 1485 #else | 1486 #else |
| 1486 PlatformContextSkia context(canvas); | 1487 PlatformContextSkia context(canvas); |
| 1487 | 1488 |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1887 } | 1888 } |
| 1888 | 1889 |
| 1889 void WebFrameImpl::ClearPasswordListeners() { | 1890 void WebFrameImpl::ClearPasswordListeners() { |
| 1890 for (PasswordListenerMap::iterator iter = password_listeners_.begin(); | 1891 for (PasswordListenerMap::iterator iter = password_listeners_.begin(); |
| 1891 iter != password_listeners_.end(); ++iter) { | 1892 iter != password_listeners_.end(); ++iter) { |
| 1892 delete iter->second; | 1893 delete iter->second; |
| 1893 } | 1894 } |
| 1894 password_listeners_.clear(); | 1895 password_listeners_.clear(); |
| 1895 } | 1896 } |
| 1896 | 1897 |
| OLD | NEW |