OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/intents/default_web_intent_service.h" | |
6 #include "base/string_util.h" | |
7 | |
8 DefaultWebIntentService::DefaultWebIntentService() | |
9 : url_pattern(URLPattern::SCHEME_ALL, URLPattern::kAllUrlsPattern), | |
10 user_date(-1), | |
11 suppression(0) {} | |
12 | |
13 DefaultWebIntentService::DefaultWebIntentService( | |
14 const string16& srv_action, | |
15 const string16& srv_type, | |
16 const std::string& srv_service_url) | |
17 : action(srv_action), type(srv_type), | |
18 url_pattern(URLPattern::SCHEME_ALL, URLPattern::kAllUrlsPattern), | |
19 user_date(-1), suppression(0), service_url(srv_service_url) {} | |
20 | |
21 DefaultWebIntentService::DefaultWebIntentService( | |
22 const string16& srv_scheme, | |
23 const std::string& srv_service_url) | |
24 : scheme(srv_scheme), | |
25 url_pattern(URLPattern::SCHEME_ALL, URLPattern::kAllUrlsPattern), | |
26 user_date(-1), suppression(0), service_url(srv_service_url) {} | |
27 | |
28 DefaultWebIntentService::~DefaultWebIntentService() {} | |
29 | |
30 std::string DefaultWebIntentService::ToString() const { | |
31 return "{action=" + UTF16ToASCII(action) | |
32 + ", type=" + UTF16ToASCII(type) | |
33 + ", service_url=" + service_url | |
34 + ", url_pattern=" + url_pattern.GetAsString() | |
35 + "}"; | |
36 } | |
37 | |
38 bool DefaultWebIntentService::operator==( | |
39 const DefaultWebIntentService& other) const { | |
40 return action == other.action && | |
41 type == other.type && | |
42 scheme == other.scheme && | |
43 url_pattern == other.url_pattern && | |
44 user_date == other.user_date && | |
45 suppression == other.suppression && | |
46 service_url == other.service_url; | |
47 } | |
OLD | NEW |