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

Side by Side Diff: content/renderer/render_widget.cc

Issue 10534037: Add text input types newly introduced in WebKit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove TEXT_INPUT_TYPE_MAX_PLUS_1 for switch/case with clang friendly Created 8 years, 6 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 | « no previous file | ui/base/ime/text_input_type.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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 COMPILE_ASSERT(int(WebKit::WebTextInputTypeSearch) == \ 1651 COMPILE_ASSERT(int(WebKit::WebTextInputTypeSearch) == \
1652 int(ui::TEXT_INPUT_TYPE_SEARCH), mismatching_enums); 1652 int(ui::TEXT_INPUT_TYPE_SEARCH), mismatching_enums);
1653 COMPILE_ASSERT(int(WebKit::WebTextInputTypeEmail) == \ 1653 COMPILE_ASSERT(int(WebKit::WebTextInputTypeEmail) == \
1654 int(ui::TEXT_INPUT_TYPE_EMAIL), mismatching_enums); 1654 int(ui::TEXT_INPUT_TYPE_EMAIL), mismatching_enums);
1655 COMPILE_ASSERT(int(WebKit::WebTextInputTypeNumber) == \ 1655 COMPILE_ASSERT(int(WebKit::WebTextInputTypeNumber) == \
1656 int(ui::TEXT_INPUT_TYPE_NUMBER), mismatching_enums); 1656 int(ui::TEXT_INPUT_TYPE_NUMBER), mismatching_enums);
1657 COMPILE_ASSERT(int(WebKit::WebTextInputTypeTelephone) == \ 1657 COMPILE_ASSERT(int(WebKit::WebTextInputTypeTelephone) == \
1658 int(ui::TEXT_INPUT_TYPE_TELEPHONE), mismatching_enums); 1658 int(ui::TEXT_INPUT_TYPE_TELEPHONE), mismatching_enums);
1659 COMPILE_ASSERT(int(WebKit::WebTextInputTypeURL) == \ 1659 COMPILE_ASSERT(int(WebKit::WebTextInputTypeURL) == \
1660 int(ui::TEXT_INPUT_TYPE_URL), mismatching_enums); 1660 int(ui::TEXT_INPUT_TYPE_URL), mismatching_enums);
1661 COMPILE_ASSERT(int(WebKit::WebTextInputTypeDate) == \
1662 int(ui::TEXT_INPUT_TYPE_DATE), mismatching_enum);
1663 COMPILE_ASSERT(int(WebKit::WebTextInputTypeDateTime) == \
1664 int(ui::TEXT_INPUT_TYPE_DATE_TIME), mismatching_enum);
1665 COMPILE_ASSERT(int(WebKit::WebTextInputTypeDateTimeLocal) == \
1666 int(ui::TEXT_INPUT_TYPE_DATE_TIME_LOCAL), mismatching_enum);
1667 COMPILE_ASSERT(int(WebKit::WebTextInputTypeMonth) == \
1668 int(ui::TEXT_INPUT_TYPE_MONTH), mismatching_enum);
1669 COMPILE_ASSERT(int(WebKit::WebTextInputTypeTime) == \
1670 int(ui::TEXT_INPUT_TYPE_TIME), mismatching_enum);
1671 COMPILE_ASSERT(int(WebKit::WebTextInputTypeWeek) == \
1672 int(ui::TEXT_INPUT_TYPE_WEEK), mismatching_enum);
1661 1673
1662 ui::TextInputType RenderWidget::GetTextInputType() { 1674 ui::TextInputType RenderWidget::GetTextInputType() {
1663 if (webwidget_) { 1675 if (webwidget_) {
1664 int type = webwidget_->textInputType(); 1676 int type = webwidget_->textInputType();
1665 // Check the type is in the range representable by ui::TextInputType. 1677 // Check the type is in the range representable by ui::TextInputType.
1666 DCHECK(type <= ui::TEXT_INPUT_TYPE_URL) << 1678 DCHECK_LE(type, ui::TEXT_INPUT_TYPE_WEEK) <<
1667 "WebKit::WebTextInputType and ui::TextInputType not synchronized"; 1679 "WebKit::WebTextInputType and ui::TextInputType not synchronized";
1668 return static_cast<ui::TextInputType>(type); 1680 return static_cast<ui::TextInputType>(type);
1669 } 1681 }
1670 return ui::TEXT_INPUT_TYPE_NONE; 1682 return ui::TEXT_INPUT_TYPE_NONE;
1671 } 1683 }
1672 1684
1673 bool RenderWidget::CanComposeInline() { 1685 bool RenderWidget::CanComposeInline() {
1674 return true; 1686 return true;
1675 } 1687 }
1676 1688
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1733 } 1745 }
1734 } 1746 }
1735 1747
1736 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { 1748 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) {
1737 return false; 1749 return false;
1738 } 1750 }
1739 1751
1740 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { 1752 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const {
1741 return false; 1753 return false;
1742 } 1754 }
OLDNEW
« no previous file with comments | « no previous file | ui/base/ime/text_input_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698