OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extension_action_runner.h" | 5 #include "chrome/browser/extensions/extension_action_runner.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 return; | 376 return; |
377 { | 377 { |
378 // Ignore the active tab permission being granted because we don't want | 378 // Ignore the active tab permission being granted because we don't want |
379 // to run scripts right before we refresh the page. | 379 // to run scripts right before we refresh the page. |
380 base::AutoReset<bool> ignore_active_tab(&ignore_active_tab_granted_, | 380 base::AutoReset<bool> ignore_active_tab(&ignore_active_tab_granted_, |
381 true); | 381 true); |
382 TabHelper::FromWebContents(web_contents()) | 382 TabHelper::FromWebContents(web_contents()) |
383 ->active_tab_permission_granter() | 383 ->active_tab_permission_granter() |
384 ->GrantIfRequested(extension); | 384 ->GrantIfRequested(extension); |
385 } | 385 } |
386 web_contents()->GetController().Reload(false); | 386 web_contents()->GetController().Reload(content::ReloadType::NORMAL, false); |
387 } | 387 } |
388 } | 388 } |
389 | 389 |
390 bool ExtensionActionRunner::OnMessageReceived( | 390 bool ExtensionActionRunner::OnMessageReceived( |
391 const IPC::Message& message, | 391 const IPC::Message& message, |
392 content::RenderFrameHost* render_frame_host) { | 392 content::RenderFrameHost* render_frame_host) { |
393 bool handled = true; | 393 bool handled = true; |
394 IPC_BEGIN_MESSAGE_MAP(ExtensionActionRunner, message) | 394 IPC_BEGIN_MESSAGE_MAP(ExtensionActionRunner, message) |
395 IPC_MESSAGE_HANDLER(ExtensionHostMsg_RequestScriptInjectionPermission, | 395 IPC_MESSAGE_HANDLER(ExtensionHostMsg_RequestScriptInjectionPermission, |
396 OnRequestScriptInjectionPermission) | 396 OnRequestScriptInjectionPermission) |
(...skipping 23 matching lines...) Expand all Loading... |
420 UnloadedExtensionInfo::Reason reason) { | 420 UnloadedExtensionInfo::Reason reason) { |
421 PendingScriptMap::iterator iter = pending_scripts_.find(extension->id()); | 421 PendingScriptMap::iterator iter = pending_scripts_.find(extension->id()); |
422 if (iter != pending_scripts_.end()) { | 422 if (iter != pending_scripts_.end()) { |
423 pending_scripts_.erase(iter); | 423 pending_scripts_.erase(iter); |
424 ExtensionActionAPI::Get(browser_context_) | 424 ExtensionActionAPI::Get(browser_context_) |
425 ->NotifyPageActionsChanged(web_contents()); | 425 ->NotifyPageActionsChanged(web_contents()); |
426 } | 426 } |
427 } | 427 } |
428 | 428 |
429 } // namespace extensions | 429 } // namespace extensions |
OLD | NEW |