forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchrome_render_view_observer.h
66 lines (54 loc) · 2.26 KB
/
chrome_render_view_observer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (c) 2012 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.
#ifndef CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_
#define CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_
#include <set>
#include <string>
#include <vector>
#include "base/macros.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
#include "content/public/common/browser_controls_state.h"
#include "content/public/renderer/render_view_observer.h"
#include "extensions/features/features.h"
#include "third_party/WebKit/public/web/window_features.mojom.h"
#include "url/gurl.h"
namespace web_cache {
class WebCacheImpl;
}
// This class holds the Chrome specific parts of RenderView, and has the same
// lifetime.
class ChromeRenderViewObserver : public content::RenderViewObserver {
public:
// translate_helper can be NULL.
ChromeRenderViewObserver(
content::RenderView* render_view,
web_cache::WebCacheImpl* web_cache_render_thread_observer);
~ChromeRenderViewObserver() override;
private:
// RenderViewObserver implementation.
bool OnMessageReceived(const IPC::Message& message) override;
void DidCommitProvisionalLoad(blink::WebLocalFrame* frame,
bool is_new_navigation) override;
void Navigate(const GURL& url) override;
void OnDestruct() override;
#if !defined(OS_ANDROID)
void OnWebUIJavaScript(const base::string16& javascript);
#endif
#if defined(OS_ANDROID)
void OnUpdateBrowserControlsState(content::BrowserControlsState constraints,
content::BrowserControlsState current,
bool animate);
#endif
void OnGetWebApplicationInfo();
void OnSetWindowFeatures(const blink::mojom::WindowFeatures& window_features);
// Determines if a host is in the strict security host set.
bool IsStrictSecurityHost(const std::string& host);
// Save the JavaScript to preload if a ViewMsg_WebUIJavaScript is received.
std::vector<base::string16> webui_javascript_;
// Owned by ChromeContentRendererClient and outlive us.
web_cache::WebCacheImpl* web_cache_impl_;
DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver);
};
#endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_