| OLD | NEW |
| (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 #include "chrome/browser/extensions/api/extension_action/extension_script_badge_
api.h" |
| 6 |
| 7 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 8 #include "chrome/browser/extensions/location_bar_controller.h" |
| 9 #include "content/public/browser/web_contents.h" |
| 10 |
| 11 ScriptBadgeRequestToActFunction::~ScriptBadgeRequestToActFunction() {} |
| 12 |
| 13 bool ScriptBadgeRequestToActFunction::RunExtensionAction() { |
| 14 // Do nothing if the extension already has access to this page or |
| 15 // can never be granted access. |
| 16 if (!GetExtension()->CanRequestToActOnPage( |
| 17 tab_helper().web_contents()->GetURL(), tab_id_)) { |
| 18 return true; |
| 19 } |
| 20 |
| 21 tab_helper().location_bar_controller()-> |
| 22 RequestScriptPermission(extension_id()); |
| 23 return true; |
| 24 } |
| OLD | NEW |