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

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

Issue 398673003: Rename WebCore namespace to blink in bindings and web (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/web/PopupContainer.h ('k') | Source/web/PopupListBox.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "platform/geometry/IntRect.h" 48 #include "platform/geometry/IntRect.h"
49 #include "platform/graphics/GraphicsContext.h" 49 #include "platform/graphics/GraphicsContext.h"
50 #include "platform/scroll/FramelessScrollViewClient.h" 50 #include "platform/scroll/FramelessScrollViewClient.h"
51 #include "public/web/WebPopupMenuInfo.h" 51 #include "public/web/WebPopupMenuInfo.h"
52 #include "public/web/WebPopupType.h" 52 #include "public/web/WebPopupType.h"
53 #include "public/web/WebViewClient.h" 53 #include "public/web/WebViewClient.h"
54 #include "web/WebPopupMenuImpl.h" 54 #include "web/WebPopupMenuImpl.h"
55 #include "web/WebViewImpl.h" 55 #include "web/WebViewImpl.h"
56 #include <limits> 56 #include <limits>
57 57
58 using namespace WebCore; 58 using namespace blink;
59 59
60 namespace blink { 60 namespace blink {
61 61
62 static const int borderSize = 1; 62 static const int borderSize = 1;
63 63
64 static PlatformMouseEvent constructRelativeMouseEvent(const PlatformMouseEvent& e, FramelessScrollView* parent, FramelessScrollView* child) 64 static PlatformMouseEvent constructRelativeMouseEvent(const PlatformMouseEvent& e, FramelessScrollView* parent, FramelessScrollView* child)
65 { 65 {
66 IntPoint pos = parent->convertSelfToChild(child, e.position()); 66 IntPoint pos = parent->convertSelfToChild(child, e.position());
67 67
68 // FIXME: This is a horrible hack since PlatformMouseEvent has no setters fo r x/y. 68 // FIXME: This is a horrible hack since PlatformMouseEvent has no setters fo r x/y.
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 const Vector<PopupItem*>& inputItems = popupData(); 486 const Vector<PopupItem*>& inputItems = popupData();
487 487
488 WebVector<WebMenuItemInfo> outputItems(inputItems.size()); 488 WebVector<WebMenuItemInfo> outputItems(inputItems.size());
489 489
490 for (size_t i = 0; i < inputItems.size(); ++i) { 490 for (size_t i = 0; i < inputItems.size(); ++i) {
491 const PopupItem& inputItem = *inputItems[i]; 491 const PopupItem& inputItem = *inputItems[i];
492 WebMenuItemInfo& outputItem = outputItems[i]; 492 WebMenuItemInfo& outputItem = outputItems[i];
493 493
494 outputItem.label = inputItem.label; 494 outputItem.label = inputItem.label;
495 outputItem.enabled = inputItem.enabled; 495 outputItem.enabled = inputItem.enabled;
496 if (inputItem.textDirection == WebCore::RTL) 496 if (inputItem.textDirection == blink::RTL)
497 outputItem.textDirection = WebTextDirectionRightToLeft; 497 outputItem.textDirection = WebTextDirectionRightToLeft;
498 else 498 else
499 outputItem.textDirection = WebTextDirectionLeftToRight; 499 outputItem.textDirection = WebTextDirectionLeftToRight;
500 outputItem.hasTextDirectionOverride = inputItem.hasTextDirectionOverride ; 500 outputItem.hasTextDirectionOverride = inputItem.hasTextDirectionOverride ;
501 501
502 switch (inputItem.type) { 502 switch (inputItem.type) {
503 case PopupItem::TypeOption: 503 case PopupItem::TypeOption:
504 outputItem.type = WebMenuItemInfo::Option; 504 outputItem.type = WebMenuItemInfo::Option;
505 break; 505 break;
506 case PopupItem::TypeGroup: 506 case PopupItem::TypeGroup:
507 outputItem.type = WebMenuItemInfo::Group; 507 outputItem.type = WebMenuItemInfo::Group;
508 break; 508 break;
509 case PopupItem::TypeSeparator: 509 case PopupItem::TypeSeparator:
510 outputItem.type = WebMenuItemInfo::Separator; 510 outputItem.type = WebMenuItemInfo::Separator;
511 break; 511 break;
512 } 512 }
513 } 513 }
514 514
515 info->itemHeight = menuItemHeight(); 515 info->itemHeight = menuItemHeight();
516 info->itemFontSize = menuItemFontSize(); 516 info->itemFontSize = menuItemFontSize();
517 info->selectedIndex = selectedIndex(); 517 info->selectedIndex = selectedIndex();
518 info->items.swap(outputItems); 518 info->items.swap(outputItems);
519 info->rightAligned = menuStyle().textDirection() == RTL; 519 info->rightAligned = menuStyle().textDirection() == RTL;
520 } 520 }
521 521
522 } // namespace blink 522 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/PopupContainer.h ('k') | Source/web/PopupListBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698