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

Unified Diff: chrome/browser/ui/gtk/browser_window_gtk.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, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/gtk/browser_window_gtk.cc
diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc
index 73ba57a3cfab8d94dca885f0a0755c24da20add6..caef0125975499fffc57e140107e8f503a466bbf 100644
--- a/chrome/browser/ui/gtk/browser_window_gtk.cc
+++ b/chrome/browser/ui/gtk/browser_window_gtk.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/debugger/devtools_window.h"
#include "chrome/browser/download/download_item_model.h"
+#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/browser/profiles/profile.h"
@@ -1309,6 +1310,15 @@ bool BrowserWindowGtk::DrawInfoBarArrows(int* x) const {
return true;
}
+extensions::ActiveTabPermissionGranter*
+ BrowserWindowGtk::GetActiveTabPermissionGranter() {
+ TabContents* tab = GetDisplayedTab();
+ if (!tab)
+ return NULL;
+ return extensions::TabHelper::FromWebContents(tab->web_contents())->
+ active_tab_permission_granter();
+}
+
void BrowserWindowGtk::MaybeShowBookmarkBar(bool animate) {
TRACE_EVENT0("ui::gtk", "BrowserWindowGtk::MaybeShowBookmarkBar");
if (!IsBookmarkBarSupported())
@@ -1532,7 +1542,7 @@ gboolean BrowserWindowGtk::OnMainWindowDeleteEvent(GtkWidget* widget,
void BrowserWindowGtk::OnMainWindowDestroy(GtkWidget* widget) {
// Make sure we destroy this object while the main window is still valid.
- extension_keybinding_registry_.reset(NULL);
+ extension_keybinding_registry_.reset();
// BUG 8712. When we gtk_widget_destroy() in Close(), this will emit the
// signal right away, and we will be here (while Close() is still in the
@@ -1825,9 +1835,11 @@ void BrowserWindowGtk::InitWidgets() {
UpdateCustomFrame();
// Add the keybinding registry, now that the window has been realized.
- extension_keybinding_registry_.reset(
- new ExtensionKeybindingRegistryGtk(browser_->profile(), window_,
- extensions::ExtensionKeybindingRegistry::ALL_EXTENSIONS));
+ extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryGtk(
+ browser_->profile(),
+ window_,
+ extensions::ExtensionKeybindingRegistry::ALL_EXTENSIONS,
+ this));
// We have to call this after the first window is created, but after that only
// when the theme changes. This sets the icon that will be used for windows
« no previous file with comments | « chrome/browser/ui/gtk/browser_window_gtk.h ('k') | chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698