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

Side by Side Diff: chrome/browser/notifications/balloon.cc

Issue 16625012: Remove ExtensionURLInfo, make security decisions in render process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address feedback Created 7 years, 5 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
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/notifications/balloon.h" 5 #include "chrome/browser/notifications/balloon.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/notifications/balloon_collection.h" 9 #include "chrome/browser/notifications/balloon_collection.h"
10 #include "chrome/browser/notifications/notification.h" 10 #include "chrome/browser/notifications/notification.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 76
77 void Balloon::CloseByScript() { 77 void Balloon::CloseByScript() {
78 // A user-initiated close begins with the view and then closes this object; 78 // A user-initiated close begins with the view and then closes this object;
79 // we simulate that with a script-initiated close but pass |by_user|=false. 79 // we simulate that with a script-initiated close but pass |by_user|=false.
80 DCHECK(balloon_view_.get()); 80 DCHECK(balloon_view_.get());
81 balloon_view_->Close(false); 81 balloon_view_->Close(false);
82 } 82 }
83 83
84 std::string Balloon::GetExtensionId() { 84 std::string Balloon::GetExtensionId() {
85 const ExtensionURLInfo url(notification().origin_url());
86 const ExtensionService* service = profile()->GetExtensionService(); 85 const ExtensionService* service = profile()->GetExtensionService();
87 const extensions::Extension* extension = 86 const extensions::Extension* extension =
88 service->extensions()->GetExtensionOrAppByURL(url); 87 service->extensions()->GetExtensionOrAppByURL(
88 notification().origin_url());
89 return extension ? extension->id() : std::string(); 89 return extension ? extension->id() : std::string();
90 } 90 }
OLDNEW
« no previous file with comments | « chrome/browser/nacl_host/nacl_host_message_filter.cc ('k') | chrome/browser/notifications/notification_options_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698