| Index: third_party/grpc/src/compiler/ruby_generator_helpers-inl.h
|
| diff --git a/third_party/WebKit/Source/core/html/forms/ButtonInputType.cpp b/third_party/grpc/src/compiler/ruby_generator_helpers-inl.h
|
| similarity index 58%
|
| copy from third_party/WebKit/Source/core/html/forms/ButtonInputType.cpp
|
| copy to third_party/grpc/src/compiler/ruby_generator_helpers-inl.h
|
| index 8c287c763cb0bd11ffed567f0411acf44972e26c..9da7cab3c7f3dd5d33b023f67fc26a50cbd8686d 100644
|
| --- a/third_party/WebKit/Source/core/html/forms/ButtonInputType.cpp
|
| +++ b/third_party/grpc/src/compiler/ruby_generator_helpers-inl.h
|
| @@ -1,5 +1,7 @@
|
| /*
|
| - * Copyright (C) 2010 Google Inc. All rights reserved.
|
| + *
|
| + * Copyright 2015, Google Inc.
|
| + * All rights reserved.
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| * modification, are permitted provided that the following conditions are
|
| @@ -26,33 +28,38 @@
|
| * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| + *
|
| */
|
|
|
| -#include "core/html/forms/ButtonInputType.h"
|
| +#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H
|
| +#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H
|
|
|
| -#include "core/InputTypeNames.h"
|
| -#include "wtf/PassOwnPtr.h"
|
| +#include "src/compiler/config.h"
|
| +#include "src/compiler/ruby_generator_string-inl.h"
|
|
|
| -namespace blink {
|
| +namespace grpc_ruby_generator {
|
|
|
| -InputType* ButtonInputType::create(HTMLInputElement& element)
|
| -{
|
| - return new ButtonInputType(element);
|
| -}
|
| -
|
| -const AtomicString& ButtonInputType::formControlType() const
|
| -{
|
| - return InputTypeNames::button;
|
| -}
|
| -
|
| -bool ButtonInputType::supportsValidation() const
|
| -{
|
| +inline bool ServicesFilename(const grpc::protobuf::FileDescriptor *file,
|
| + grpc::string *file_name_or_error) {
|
| + // Get output file name.
|
| + static const unsigned proto_suffix_length = 6; // length of ".proto"
|
| + if (file->name().size() > proto_suffix_length &&
|
| + file->name().find_last_of(".proto") == file->name().size() - 1) {
|
| + *file_name_or_error =
|
| + file->name().substr(0, file->name().size() - proto_suffix_length) +
|
| + "_services.rb";
|
| + return true;
|
| + } else {
|
| + *file_name_or_error = "Invalid proto file name: must end with .proto";
|
| return false;
|
| + }
|
| }
|
|
|
| -bool ButtonInputType::isTextButton() const
|
| -{
|
| - return true;
|
| +inline grpc::string MessagesRequireName(
|
| + const grpc::protobuf::FileDescriptor *file) {
|
| + return Replace(file->name(), ".proto", "");
|
| }
|
|
|
| -} // namespace blink
|
| +} // namespace grpc_ruby_generator
|
| +
|
| +#endif // GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H
|
|
|