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

Unified Diff: chrome/renderer/extensions/platform_app_dispatcher.cc

Issue 8447017: [DRAFT] Add new default stylesheet for platform apps. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « chrome/renderer/extensions/platform_app_dispatcher.h ('k') | chrome/renderer/renderer_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/platform_app_dispatcher.cc
diff --git a/chrome/renderer/extensions/platform_app_dispatcher.cc b/chrome/renderer/extensions/platform_app_dispatcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7253d859e0d7e9de3e8efe2015a9e4a18a58dac5
--- /dev/null
+++ b/chrome/renderer/extensions/platform_app_dispatcher.cc
@@ -0,0 +1,44 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/renderer/extensions/platform_app_dispatcher.h"
+
+#include "base/logging.h"
+#include "grit/renderer_resources.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "chrome/common/extensions/platform_app_messages.h"
+
+using WebKit::WebString;
+using WebKit::WebView;
+using WebKit::WebVector;
+
+PlatformAppDispatcher::PlatformAppDispatcher() {
+}
+
+PlatformAppDispatcher::~PlatformAppDispatcher() {
+}
+
+bool PlatformAppDispatcher::OnControlMessageReceived(
+ const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(PlatformAppDispatcher, message)
+ IPC_MESSAGE_HANDLER(PlatformAppMsg_IsPlatformApp, OnIsPlatformApp)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+
+ return handled;
+}
+
+void PlatformAppDispatcher::OnIsPlatformApp() {
+ WebString scheme(WebString::fromUTF8("chrome-extension://*/*"));
+ WebVector<WebString> patterns;
+ patterns.assign(&scheme, 1);
+ WebView::addUserStyleSheet(
+ WebString::fromUTF8(ResourceBundle::GetSharedInstance().
+ GetRawDataResource(IDR_PLATFORM_APP_CSS)),
+ patterns,
+ WebView::UserContentInjectInAllFrames,
+ WebView::UserStyleInjectInExistingDocuments);
+}
« no previous file with comments | « chrome/renderer/extensions/platform_app_dispatcher.h ('k') | chrome/renderer/renderer_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698