diff options
author | rdevlin.cronin <rdevlin.cronin@chromium.org> | 2015-06-24 13:36:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-24 20:36:34 +0000 |
commit | b2cec918668eb5b49df32d4983df84f777e9d37f (patch) | |
tree | 5bb9785b9ab5abe27c63c567dcff8a76152910e5 /extensions/browser/app_window | |
parent | 11af83139c09b9a3fe17fabc8f32642527f0536f (diff) | |
download | chromium_src-b2cec918668eb5b49df32d4983df84f777e9d37f.zip chromium_src-b2cec918668eb5b49df32d4983df84f777e9d37f.tar.gz chromium_src-b2cec918668eb5b49df32d4983df84f777e9d37f.tar.bz2 |
[Extensions] Kill off ExtensionMsg_AddMessageToConsole
ExtensionMsg_AddMessageToConsole does the same things as
RenderFrameHost::AddMessageToConsole, and adds a fair amount of code bloat.
Remove it.
In addition to being a nice cleanup, this kills off a bunch of
RenderViewHost dependencies, as well.
BUG=455776
TBR=timvolodine@chromium.org
Review URL: https://codereview.chromium.org/1200503002
Cr-Commit-Position: refs/heads/master@{#335991}
Diffstat (limited to 'extensions/browser/app_window')
-rw-r--r-- | extensions/browser/app_window/app_web_contents_helper.cc | 20 | ||||
-rw-r--r-- | extensions/browser/app_window/app_web_contents_helper.h | 5 | ||||
-rw-r--r-- | extensions/browser/app_window/app_window.cc | 2 |
3 files changed, 6 insertions, 21 deletions
diff --git a/extensions/browser/app_window/app_web_contents_helper.cc b/extensions/browser/app_window/app_web_contents_helper.cc index fb66479..72b1376 100644 --- a/extensions/browser/app_window/app_web_contents_helper.cc +++ b/extensions/browser/app_window/app_web_contents_helper.cc @@ -7,12 +7,12 @@ #include "base/strings/stringprintf.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/page_navigator.h" -#include "content/public/browser/render_view_host.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" +#include "content/public/common/console_message_level.h" #include "extensions/browser/app_window/app_delegate.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/suggest_permission_util.h" -#include "extensions/common/extension_messages.h" #include "extensions/common/permissions/api_permission.h" namespace extensions { @@ -46,7 +46,7 @@ content::WebContents* AppWebContentsHelper::OpenURLFromTab( // TOOD(mihaip): Can we check for user gestures instead? WindowOpenDisposition disposition = params.disposition; if (disposition == CURRENT_TAB) { - AddMessageToDevToolsConsole( + web_contents_->GetMainFrame()->AddMessageToConsole( content::CONSOLE_MESSAGE_LEVEL_ERROR, base::StringPrintf( "Can't open same-window link to \"%s\"; try target=\"_blank\".", @@ -63,7 +63,7 @@ content::WebContents* AppWebContentsHelper::OpenURLFromTab( content::WebContents* contents = app_delegate_->OpenURLFromTab(browser_context_, web_contents_, params); if (!contents) { - AddMessageToDevToolsConsole( + web_contents_->GetMainFrame()->AddMessageToConsole( content::CONSOLE_MESSAGE_LEVEL_ERROR, base::StringPrintf( "Can't navigate to \"%s\"; apps do not support navigation.", @@ -79,9 +79,7 @@ void AppWebContentsHelper::RequestToLockMouse() const { return; bool has_permission = IsExtensionWithPermissionOrSuggestInConsole( - APIPermission::kPointerLock, - extension, - web_contents_->GetRenderViewHost()); + APIPermission::kPointerLock, extension, web_contents_->GetMainFrame()); web_contents_->GotResponseToLockMouseRequest(has_permission); } @@ -114,12 +112,4 @@ const Extension* AppWebContentsHelper::GetExtension() const { .GetByID(extension_id_); } -void AppWebContentsHelper::AddMessageToDevToolsConsole( - content::ConsoleMessageLevel level, - const std::string& message) const { - content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); - rvh->Send(new ExtensionMsg_AddMessageToConsole( - rvh->GetRoutingID(), level, message)); -} - } // namespace extensions diff --git a/extensions/browser/app_window/app_web_contents_helper.h b/extensions/browser/app_window/app_web_contents_helper.h index ea4f13e..8e45eba5 100644 --- a/extensions/browser/app_window/app_web_contents_helper.h +++ b/extensions/browser/app_window/app_web_contents_helper.h @@ -5,7 +5,6 @@ #ifndef EXTENSIONS_BROWSER_APP_WINDOW_APP_WEB_CONTENTS_HELPER_H_ #define EXTENSIONS_BROWSER_APP_WINDOW_APP_WEB_CONTENTS_HELPER_H_ -#include "content/public/common/console_message_level.h" #include "content/public/common/media_stream_request.h" namespace blink { @@ -56,10 +55,6 @@ class AppWebContentsHelper { private: const Extension* GetExtension() const; - // Helper method to add a message to the renderer's DevTools console. - void AddMessageToDevToolsConsole(content::ConsoleMessageLevel level, - const std::string& message) const; - // The browser context with which this window is associated. // AppWindowWebContentsDelegate does not own this object. content::BrowserContext* browser_context_; diff --git a/extensions/browser/app_window/app_window.cc b/extensions/browser/app_window/app_window.cc index 77da594..4ebc38e 100644 --- a/extensions/browser/app_window/app_window.cc +++ b/extensions/browser/app_window/app_window.cc @@ -926,7 +926,7 @@ void AppWindow::ToggleFullscreenModeForTab(content::WebContents* source, return; if (!IsExtensionWithPermissionOrSuggestInConsole( - APIPermission::kFullscreen, extension, source->GetRenderViewHost())) { + APIPermission::kFullscreen, extension, source->GetMainFrame())) { return; } |