Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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 "base/guid.h" | |
| 6 #include "chrome/browser/media/router/issue.h" | |
| 7 | |
| 8 namespace media_router { | |
| 9 | |
| 10 IssueAction::IssueAction(const IssueAction::Type type) : type_(type) { | |
| 11 } | |
| 12 | |
| 13 IssueAction::~IssueAction() { | |
| 14 } | |
| 15 | |
| 16 Issue::Issue(const std::string& title, | |
| 17 const std::string& message, | |
| 18 const IssueAction& default_action, | |
| 19 const std::vector<IssueAction>& secondary_actions, | |
| 20 const MediaRouteId& route_id, | |
| 21 const Issue::Severity severity, | |
| 22 bool is_blocking, | |
| 23 const std::string& help_url) | |
| 24 : title_(title), | |
| 25 message_(message), | |
| 26 default_action_(default_action), | |
| 27 secondary_actions_(secondary_actions), | |
| 28 route_id_(route_id), | |
| 29 severity_(severity), | |
| 30 id_(base::GenerateGUID()), | |
| 31 is_blocking_(is_blocking), | |
| 32 help_url_(GURL(help_url)) { | |
| 33 DCHECK(!title_.empty()); | |
| 34 DCHECK(severity_ != FATAL || is_blocking_) << "Severity is " << severity_; | |
|
apacible
2015/05/01 20:18:08
What gets printed out here since severity enum val
Kevin Marshall
2015/05/01 20:26:02
The ordinal value of |severity_| is printed.
| |
| 35 | |
| 36 // Check that the default and secondary actions are not of the same type. | |
| 37 if (!secondary_actions_.empty()) | |
| 38 DCHECK_NE(default_action_.type(), secondary_actions_[0].type()); | |
| 39 } | |
| 40 | |
| 41 Issue::~Issue() { | |
| 42 } | |
| 43 | |
| 44 bool Issue::IsBlocking() const { | |
| 45 return is_blocking_; | |
| 46 } | |
| 47 | |
| 48 bool Issue::IsGlobal() const { | |
| 49 return route_id_.empty(); | |
| 50 } | |
| 51 | |
| 52 bool Issue::Equals(const Issue& other) const { | |
| 53 return id_ == other.id_; | |
| 54 } | |
| 55 | |
| 56 } // namespace media_router | |
| OLD | NEW |