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

Side by Side Diff: chrome/browser/extensions/api/notifications/notifications_api.cc

Issue 684253002: Provide default implementations for NotificationDelegate methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month 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
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/api/notifications/notifications_api.h" 5 #include "chrome/browser/extensions/api/notifications/notifications_api.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/guid.h" 8 #include "base/guid.h"
9 #include "base/rand_util.h" 9 #include "base/rand_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 const std::string& extension_id, 78 const std::string& extension_id,
79 const std::string& id) 79 const std::string& id)
80 : api_function_(api_function), 80 : api_function_(api_function),
81 profile_(profile), 81 profile_(profile),
82 extension_id_(extension_id), 82 extension_id_(extension_id),
83 id_(id), 83 id_(id),
84 scoped_id_(CreateScopedIdentifier(extension_id, id)) { 84 scoped_id_(CreateScopedIdentifier(extension_id, id)) {
85 DCHECK(api_function_.get()); 85 DCHECK(api_function_.get());
86 } 86 }
87 87
88 void Display() override {}
89
90 void Error() override {}
91
92 void Close(bool by_user) override { 88 void Close(bool by_user) override {
93 EventRouter::UserGestureState gesture = 89 EventRouter::UserGestureState gesture =
94 by_user ? EventRouter::USER_GESTURE_ENABLED 90 by_user ? EventRouter::USER_GESTURE_ENABLED
95 : EventRouter::USER_GESTURE_NOT_ENABLED; 91 : EventRouter::USER_GESTURE_NOT_ENABLED;
96 scoped_ptr<base::ListValue> args(CreateBaseEventArgs()); 92 scoped_ptr<base::ListValue> args(CreateBaseEventArgs());
97 args->Append(new base::FundamentalValue(by_user)); 93 args->Append(new base::FundamentalValue(by_user));
98 SendEvent(notifications::OnClosed::kEventName, gesture, args.Pass()); 94 SendEvent(notifications::OnClosed::kEventName, gesture, args.Pass());
99 } 95 }
100 96
101 void Click() override { 97 void Click() override {
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 ? api::notifications::PERMISSION_LEVEL_GRANTED 601 ? api::notifications::PERMISSION_LEVEL_GRANTED
606 : api::notifications::PERMISSION_LEVEL_DENIED; 602 : api::notifications::PERMISSION_LEVEL_DENIED;
607 603
608 SetResult(new base::StringValue(api::notifications::ToString(result))); 604 SetResult(new base::StringValue(api::notifications::ToString(result)));
609 SendResponse(true); 605 SendResponse(true);
610 606
611 return true; 607 return true;
612 } 608 }
613 609
614 } // namespace extensions 610 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/power/peripheral_battery_observer.cc ('k') | chrome/browser/local_discovery/privet_notifications.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698