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

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

Issue 10880064: Make extension commands grant the activeTab permission. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 8 years, 2 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/extensions/menu_manager.h" 5 #include "chrome/browser/extensions/menu_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 item->SetChecked(checked); 664 item->SetChecked(checked);
665 properties->SetBoolean("checked", item->checked()); 665 properties->SetBoolean("checked", item->checked());
666 666
667 if (extension) 667 if (extension)
668 WriteToStorage(extension); 668 WriteToStorage(extension);
669 } 669 }
670 670
671 // Note: web_contents are NULL in unit tests :( 671 // Note: web_contents are NULL in unit tests :(
672 if (web_contents && extensions::TabHelper::FromWebContents(web_contents)) { 672 if (web_contents && extensions::TabHelper::FromWebContents(web_contents)) {
673 extensions::TabHelper::FromWebContents(web_contents)-> 673 extensions::TabHelper::FromWebContents(web_contents)->
674 active_tab_permission_manager()->GrantIfRequested(extension); 674 active_tab_permission_granter()->GrantIfRequested(extension);
675 } 675 }
676 676
677 event_router->DispatchEventToExtension( 677 event_router->DispatchEventToExtension(
678 item->extension_id(), event_names::kOnContextMenus, 678 item->extension_id(), event_names::kOnContextMenus,
679 scoped_ptr<ListValue>(args->DeepCopy()), profile, GURL(), 679 scoped_ptr<ListValue>(args->DeepCopy()), profile, GURL(),
680 EventRouter::USER_GESTURE_ENABLED); 680 EventRouter::USER_GESTURE_ENABLED);
681 event_router->DispatchEventToExtension( 681 event_router->DispatchEventToExtension(
682 item->extension_id(), event_names::kOnContextMenuClicked, 682 item->extension_id(), event_names::kOnContextMenuClicked,
683 args.Pass(), profile, GURL(), 683 args.Pass(), profile, GURL(),
684 EventRouter::USER_GESTURE_ENABLED); 684 EventRouter::USER_GESTURE_ENABLED);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 if (uid < other.uid) 842 if (uid < other.uid)
843 return true; 843 return true;
844 if (uid == other.uid) 844 if (uid == other.uid)
845 return string_uid < other.string_uid; 845 return string_uid < other.string_uid;
846 } 846 }
847 } 847 }
848 return false; 848 return false;
849 } 849 }
850 850
851 } // namespace extensions 851 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model.cc ('k') | chrome/browser/extensions/page_action_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698