| OLD | NEW |
| 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/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 using blink::WebVector; | 114 using blink::WebVector; |
| 115 using blink::WebWidget; | 115 using blink::WebWidget; |
| 116 | 116 |
| 117 namespace { | 117 namespace { |
| 118 | 118 |
| 119 typedef std::map<std::string, ui::TextInputMode> TextInputModeMap; | 119 typedef std::map<std::string, ui::TextInputMode> TextInputModeMap; |
| 120 | 120 |
| 121 class TextInputModeMapSingleton { | 121 class TextInputModeMapSingleton { |
| 122 public: | 122 public: |
| 123 static TextInputModeMapSingleton* GetInstance() { | 123 static TextInputModeMapSingleton* GetInstance() { |
| 124 return Singleton<TextInputModeMapSingleton>::get(); | 124 return base::Singleton<TextInputModeMapSingleton>::get(); |
| 125 } | 125 } |
| 126 TextInputModeMapSingleton() { | 126 TextInputModeMapSingleton() { |
| 127 map_["verbatim"] = ui::TEXT_INPUT_MODE_VERBATIM; | 127 map_["verbatim"] = ui::TEXT_INPUT_MODE_VERBATIM; |
| 128 map_["latin"] = ui::TEXT_INPUT_MODE_LATIN; | 128 map_["latin"] = ui::TEXT_INPUT_MODE_LATIN; |
| 129 map_["latin-name"] = ui::TEXT_INPUT_MODE_LATIN_NAME; | 129 map_["latin-name"] = ui::TEXT_INPUT_MODE_LATIN_NAME; |
| 130 map_["latin-prose"] = ui::TEXT_INPUT_MODE_LATIN_PROSE; | 130 map_["latin-prose"] = ui::TEXT_INPUT_MODE_LATIN_PROSE; |
| 131 map_["full-width-latin"] = ui::TEXT_INPUT_MODE_FULL_WIDTH_LATIN; | 131 map_["full-width-latin"] = ui::TEXT_INPUT_MODE_FULL_WIDTH_LATIN; |
| 132 map_["kana"] = ui::TEXT_INPUT_MODE_KANA; | 132 map_["kana"] = ui::TEXT_INPUT_MODE_KANA; |
| 133 map_["katakana"] = ui::TEXT_INPUT_MODE_KATAKANA; | 133 map_["katakana"] = ui::TEXT_INPUT_MODE_KATAKANA; |
| 134 map_["numeric"] = ui::TEXT_INPUT_MODE_NUMERIC; | 134 map_["numeric"] = ui::TEXT_INPUT_MODE_NUMERIC; |
| 135 map_["tel"] = ui::TEXT_INPUT_MODE_TEL; | 135 map_["tel"] = ui::TEXT_INPUT_MODE_TEL; |
| 136 map_["email"] = ui::TEXT_INPUT_MODE_EMAIL; | 136 map_["email"] = ui::TEXT_INPUT_MODE_EMAIL; |
| 137 map_["url"] = ui::TEXT_INPUT_MODE_URL; | 137 map_["url"] = ui::TEXT_INPUT_MODE_URL; |
| 138 } | 138 } |
| 139 const TextInputModeMap& map() const { return map_; } | 139 const TextInputModeMap& map() const { return map_; } |
| 140 private: | 140 private: |
| 141 TextInputModeMap map_; | 141 TextInputModeMap map_; |
| 142 | 142 |
| 143 friend struct DefaultSingletonTraits<TextInputModeMapSingleton>; | 143 friend struct base::DefaultSingletonTraits<TextInputModeMapSingleton>; |
| 144 | 144 |
| 145 DISALLOW_COPY_AND_ASSIGN(TextInputModeMapSingleton); | 145 DISALLOW_COPY_AND_ASSIGN(TextInputModeMapSingleton); |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 ui::TextInputMode ConvertInputMode(const blink::WebString& input_mode) { | 148 ui::TextInputMode ConvertInputMode(const blink::WebString& input_mode) { |
| 149 static TextInputModeMapSingleton* singleton = | 149 static TextInputModeMapSingleton* singleton = |
| 150 TextInputModeMapSingleton::GetInstance(); | 150 TextInputModeMapSingleton::GetInstance(); |
| 151 TextInputModeMap::const_iterator it = | 151 TextInputModeMap::const_iterator it = |
| 152 singleton->map().find(input_mode.utf8()); | 152 singleton->map().find(input_mode.utf8()); |
| 153 if (it == singleton->map().end()) | 153 if (it == singleton->map().end()) |
| (...skipping 2276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2430 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2430 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2431 video_hole_frames_.AddObserver(frame); | 2431 video_hole_frames_.AddObserver(frame); |
| 2432 } | 2432 } |
| 2433 | 2433 |
| 2434 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2434 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2435 video_hole_frames_.RemoveObserver(frame); | 2435 video_hole_frames_.RemoveObserver(frame); |
| 2436 } | 2436 } |
| 2437 #endif // defined(VIDEO_HOLE) | 2437 #endif // defined(VIDEO_HOLE) |
| 2438 | 2438 |
| 2439 } // namespace content | 2439 } // namespace content |
| OLD | NEW |