Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: chrome/browser/extensions/app_notification.cc

Issue 10540003: Move guid generation from chrome/common/ to base/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: installer Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chrome_to_mobile_service.cc ('k') | chrome/browser/history/shortcuts_backend.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 "chrome/browser/extensions/app_notification.h" 5 #include "chrome/browser/extensions/app_notification.h"
6 6
7 #include "base/guid.h"
7 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
8 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
9 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
10 #include "chrome/common/guid.h"
11 11
12 namespace { 12 namespace {
13 13
14 const char* kIsLocalKey = "is_local"; 14 const char* kIsLocalKey = "is_local";
15 const char* kCreationTime= "creation_time"; 15 const char* kCreationTime= "creation_time";
16 const char* kGuidKey = "guid"; 16 const char* kGuidKey = "guid";
17 const char* kExtensionIdKey = "extension_id"; 17 const char* kExtensionIdKey = "extension_id";
18 const char* kTitleKey = "title"; 18 const char* kTitleKey = "title";
19 const char* kBodyKey = "body"; 19 const char* kBodyKey = "body";
20 const char* kLinkUrlKey = "link_url"; 20 const char* kLinkUrlKey = "link_url";
21 const char* kLinkTextKey = "link_text"; 21 const char* kLinkTextKey = "link_text";
22 22
23 } // namespace 23 } // namespace
24 24
25 AppNotification::AppNotification(bool is_local, 25 AppNotification::AppNotification(bool is_local,
26 const base::Time& creation_time, 26 const base::Time& creation_time,
27 const std::string& guid, 27 const std::string& guid,
28 const std::string& extension_id, 28 const std::string& extension_id,
29 const std::string& title, 29 const std::string& title,
30 const std::string& body) 30 const std::string& body)
31 : is_local_(is_local), 31 : is_local_(is_local),
32 creation_time_(creation_time), 32 creation_time_(creation_time),
33 extension_id_(extension_id), 33 extension_id_(extension_id),
34 title_(title), 34 title_(title),
35 body_(body) { 35 body_(body) {
36 guid_ = guid.empty() ? guid::GenerateGUID() : guid; 36 guid_ = guid.empty() ? base::GenerateGUID() : guid;
37 } 37 }
38 38
39 AppNotification::~AppNotification() {} 39 AppNotification::~AppNotification() {}
40 40
41 AppNotification* AppNotification::Copy() { 41 AppNotification* AppNotification::Copy() {
42 AppNotification* copy = new AppNotification( 42 AppNotification* copy = new AppNotification(
43 this->is_local(), this->creation_time(), 43 this->is_local(), this->creation_time(),
44 this->guid(), this->extension_id(), 44 this->guid(), this->extension_id(),
45 this->title(), this->body()); 45 this->title(), this->body());
46 copy->set_link_url(this->link_url()); 46 copy->set_link_url(this->link_url());
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 AppNotificationList* CopyAppNotificationList( 146 AppNotificationList* CopyAppNotificationList(
147 const AppNotificationList& source) { 147 const AppNotificationList& source) {
148 AppNotificationList* copy = new AppNotificationList(); 148 AppNotificationList* copy = new AppNotificationList();
149 149
150 for (AppNotificationList::const_iterator iter = source.begin(); 150 for (AppNotificationList::const_iterator iter = source.begin();
151 iter != source.end(); ++iter) { 151 iter != source.end(); ++iter) {
152 copy->push_back(linked_ptr<AppNotification>(iter->get()->Copy())); 152 copy->push_back(linked_ptr<AppNotification>(iter->get()->Copy()));
153 } 153 }
154 return copy; 154 return copy;
155 } 155 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_to_mobile_service.cc ('k') | chrome/browser/history/shortcuts_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698