OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 | 8 |
9 MSVC_PUSH_WARNING_LEVEL(0); | 9 MSVC_PUSH_WARNING_LEVEL(0); |
10 #include "AnimationController.h" | 10 #include "AnimationController.h" |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 static int ParseSingleIconSize(const std::wstring& text) { | 678 static int ParseSingleIconSize(const std::wstring& text) { |
679 // Size must not start with 0, and be between 0 and 9. | 679 // Size must not start with 0, and be between 0 and 9. |
680 if (text.empty() || !(text[0] >= L'1' && text[0] <= L'9')) | 680 if (text.empty() || !(text[0] >= L'1' && text[0] <= L'9')) |
681 return 0; | 681 return 0; |
682 // Make sure all chars are from 0-9. | 682 // Make sure all chars are from 0-9. |
683 for (size_t i = 1; i < text.length(); ++i) { | 683 for (size_t i = 1; i < text.length(); ++i) { |
684 if (!(text[i] >= L'0' && text[i] <= L'9')) | 684 if (!(text[i] >= L'0' && text[i] <= L'9')) |
685 return 0; | 685 return 0; |
686 } | 686 } |
687 int output; | 687 int output; |
688 if (!StringToInt(text, &output)) | 688 if (!StringToInt(WideToUTF16Hack(text), &output)) |
689 return 0; | 689 return 0; |
690 return output; | 690 return output; |
691 } | 691 } |
692 | 692 |
693 // Parses an icon size. An icon size must match the following regex: | 693 // Parses an icon size. An icon size must match the following regex: |
694 // [1-9][0-9]*x[1-9][0-9]*. | 694 // [1-9][0-9]*x[1-9][0-9]*. |
695 // If the input couldn't be parsed, a size with a width/height < 0 is returned. | 695 // If the input couldn't be parsed, a size with a width/height < 0 is returned. |
696 static gfx::Size ParseIconSize(const std::wstring& text) { | 696 static gfx::Size ParseIconSize(const std::wstring& text) { |
697 std::vector<std::wstring> sizes; | 697 std::vector<std::wstring> sizes; |
698 SplitStringDontTrim(text, L'x', &sizes); | 698 SplitStringDontTrim(text, L'x', &sizes); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 | 867 |
868 WebCore::Frame* frame = static_cast<WebFrameImpl*>(web_frame)->frame(); | 868 WebCore::Frame* frame = static_cast<WebFrameImpl*>(web_frame)->frame(); |
869 WebCore::AnimationController* controller = frame->animation(); | 869 WebCore::AnimationController* controller = frame->animation(); |
870 if (!controller) | 870 if (!controller) |
871 return -1; | 871 return -1; |
872 | 872 |
873 return controller->numberOfActiveAnimations(); | 873 return controller->numberOfActiveAnimations(); |
874 } | 874 } |
875 | 875 |
876 } // webkit_glue | 876 } // webkit_glue |
OLD | NEW |