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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/renderer/extensions/platform_app_dispatcher.h"
6
7 #include "base/logging.h"
8 #include "grit/renderer_resources.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
10 #include "ui/base/resource/resource_bundle.h"
11 #include "chrome/common/extensions/platform_app_messages.h"
12
13 using WebKit::WebString;
14 using WebKit::WebView;
15 using WebKit::WebVector;
16
17 PlatformAppDispatcher::PlatformAppDispatcher() {
18 }
19
20 PlatformAppDispatcher::~PlatformAppDispatcher() {
21 }
22
23 bool PlatformAppDispatcher::OnControlMessageReceived(
24 const IPC::Message& message) {
25 bool handled = true;
26 IPC_BEGIN_MESSAGE_MAP(PlatformAppDispatcher, message)
27 IPC_MESSAGE_HANDLER(PlatformAppMsg_IsPlatformApp, OnIsPlatformApp)
28 IPC_MESSAGE_UNHANDLED(handled = false)
29 IPC_END_MESSAGE_MAP()
30
31 return handled;
32 }
33
34 void PlatformAppDispatcher::OnIsPlatformApp() {
35 WebString scheme(WebString::fromUTF8("chrome-extension://*/*"));
36 WebVector<WebString> patterns;
37 patterns.assign(&scheme, 1);
38 WebView::addUserStyleSheet(
39 WebString::fromUTF8(ResourceBundle::GetSharedInstance().
40 GetRawDataResource(IDR_PLATFORM_APP_CSS)),
41 patterns,
42 WebView::UserContentInjectInAllFrames,
43 WebView::UserStyleInjectInExistingDocuments);
44 }
OLDNEW
« 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