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

Side by Side Diff: chrome/browser/web_resource/notification_promo_mobile_ntp.h

Issue 10860025: Remove promotion-type-specific JSON handling from NotificationPromo (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
OLDNEW
(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 #ifndef CHROME_BROWSER_WEB_RESOURCE_NOTIFICATION_PROMO_MOBILE_NTP_H_
6 #define CHROME_BROWSER_WEB_RESOURCE_NOTIFICATION_PROMO_MOBILE_NTP_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "chrome/browser/web_resource/notification_promo.h"
12
13 namespace base {
14 class DictionaryValue;
15 class ListValue;
16 }
17
18 // Helper class for NotificationPromo that deals with mobile_ntp promos.
19 // NOTE: Its lifetime should be less than the lifetime of NotificationPromo.
20 class NotificationPromoMobileNtp {
21 public:
22 // Loads the NotificationPromoMobileNtp from NotificationPromo.
23 explicit NotificationPromoMobileNtp(const NotificationPromo& promo);
24 ~NotificationPromoMobileNtp();
25 bool valid() const { return valid_; }
26
27 const std::string& text() const { return text_; }
28 const std::string& text_long() const { return text_long_; }
29 const std::string& action_type() const { return action_type_; }
30 const base::ListValue* action_args() const { return action_args_; }
31 bool requires_mobile_only_sync() const { return requires_mobile_only_sync_; }
32 bool requires_sync() const { return requires_sync_; }
33 bool show_on_most_visited() const { return show_on_most_visited_; }
34 bool show_on_open_tabs() const { return show_on_open_tabs_; }
35 bool show_as_virtual_computer() const { return show_as_virtual_computer_; }
36 const std::string& virtual_computer_title() const {
37 return virtual_computer_title_;
38 }
39 const std::string& virtual_computer_lastsync() const {
40 return virtual_computer_lastsync_;
41 }
42 const base::DictionaryValue* payload() const { return payload_; }
43
44 private:
45 bool valid_;
46 std::string text_;
47 std::string text_long_;
48 std::string action_type_;
49 std::string virtual_computer_title_;
50 std::string virtual_computer_lastsync_;
51 bool requires_mobile_only_sync_;
52 bool requires_sync_;
53 bool show_on_most_visited_;
54 bool show_on_open_tabs_;
55 bool show_as_virtual_computer_;
56 const base::ListValue* action_args_;
57 const base::DictionaryValue* payload_;
58
59 DISALLOW_COPY_AND_ASSIGN(NotificationPromoMobileNtp);
60 };
61
62 #endif // CHROME_BROWSER_WEB_RESOURCE_NOTIFICATION_PROMO_MOBILE_NTP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698