| 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 "chrome/browser/media/router/issue.h" | |
| 6 | |
| 7 #include "base/atomic_sequence_num.h" | |
| 8 | |
| 9 namespace media_router { | |
| 10 | |
| 11 namespace { | |
| 12 // ID generator for Issue. | |
| 13 base::StaticAtomicSequenceNumber g_next_issue_id; | |
| 14 } | |
| 15 | |
| 16 IssueInfo::IssueInfo() | |
| 17 : default_action(IssueInfo::Action::DISMISS), | |
| 18 severity(IssueInfo::Severity::NOTIFICATION), | |
| 19 is_blocking(false), | |
| 20 help_page_id(IssueInfo::kUnknownHelpPageId) {} | |
| 21 | |
| 22 IssueInfo::IssueInfo(const std::string& title, | |
| 23 const Action default_action, | |
| 24 Severity severity) | |
| 25 : title(title), | |
| 26 default_action(default_action), | |
| 27 severity(severity), | |
| 28 is_blocking(severity == IssueInfo::Severity::FATAL), | |
| 29 help_page_id(IssueInfo::kUnknownHelpPageId) {} | |
| 30 | |
| 31 IssueInfo::IssueInfo(const IssueInfo& other) = default; | |
| 32 | |
| 33 IssueInfo::~IssueInfo() = default; | |
| 34 | |
| 35 IssueInfo& IssueInfo::operator=(const IssueInfo& other) = default; | |
| 36 | |
| 37 bool IssueInfo::operator==(const IssueInfo& other) const { | |
| 38 return title == other.title && default_action == other.default_action && | |
| 39 severity == other.severity && message == other.message && | |
| 40 secondary_actions == other.secondary_actions && | |
| 41 route_id == other.route_id && is_blocking == other.is_blocking && | |
| 42 help_page_id == other.help_page_id; | |
| 43 } | |
| 44 | |
| 45 Issue::Issue(const IssueInfo& info) | |
| 46 : id_(g_next_issue_id.GetNext()), info_(info) {} | |
| 47 | |
| 48 Issue::~Issue() = default; | |
| 49 | |
| 50 } // namespace media_router | |
| OLD | NEW |