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

Side by Side Diff: blimp/engine/browser/blimp_window.h

Issue 1403083002: [Blimp] Adds Blimp EngineSession and ClientSession skeleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months 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
OLDNEW
(Empty)
1 // Copyright 2015 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 #ifndef BLIMP_ENGINE_BROWSER_BLIMP_WINDOW_H_
5 #define BLIMP_ENGINE_BROWSER_BLIMP_WINDOW_H_
6
7 #include <vector>
8
9 #include "base/lazy_instance.h"
10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "content/public/browser/web_contents_delegate.h"
13 #include "content/public/browser/web_contents_observer.h"
14 #include "ui/gfx/geometry/size.h"
15
16 namespace content {
17 class BrowserContext;
18 class SiteInstance;
19 class WebContents;
20 }
21
22 class GURL;
23
24 namespace blimp {
25 namespace engine {
26
27 // Owns and controls a WebContents instance corresponding to a window on
28 // Blimp client.
29 class BlimpWindow : public content::WebContentsDelegate {
30 public:
31 // This also unregisters itself with a singleton registry.
32 ~BlimpWindow() override;
33
34 // Creates a new blimp window with |initial_size| and navigates to the |url|.
35 // Caller retains ownership of |browser_context| and |site_instance| and
36 // ensures |browser_context| and |site_instance| outlives BlimpWindow.
37 static void Create(content::BrowserContext* browser_context,
38 const GURL& url,
39 content::SiteInstance* site_instance,
40 const gfx::Size& initial_size);
41
42 // Navigates to |url|.
43 void LoadURL(const GURL& url);
44
45 // content::WebContentsDelegate implementation.
46 content::WebContents* OpenURLFromTab(
47 content::WebContents* source,
48 const content::OpenURLParams& params) override;
49 void AddNewContents(content::WebContents* source,
50 content::WebContents* new_contents,
51 WindowOpenDisposition disposition,
52 const gfx::Rect& initial_rect,
53 bool user_gesture,
54 bool* was_blocked) override;
55 void RequestToLockMouse(content::WebContents* web_contents,
56 bool user_gesture,
57 bool last_unlocked_by_target) override;
58 void CloseContents(content::WebContents* source) override;
59 void ActivateContents(content::WebContents* contents) override;
60 void DeactivateContents(content::WebContents* contents) override;
61
62 private:
63 // The newly created instance registers itself with a singleton registry.
64 explicit BlimpWindow(scoped_ptr<content::WebContents> web_contents);
65
66 // Helper to create a new BlimpWindow given |web_contents|.
67 // The newly window is owned by a singleton registry.
68 static BlimpWindow* DoCreate(scoped_ptr<content::WebContents> web_contents,
69 const gfx::Size& initial_size);
70
71 scoped_ptr<content::WebContents> web_contents_;
72
73 DISALLOW_COPY_AND_ASSIGN(BlimpWindow);
74 };
75
76 } // namespace engine
77 } // namespace blimp
78
79 #endif // BLIMP_ENGINE_BROWSER_BLIMP_WINDOW_H_
OLDNEW
« no previous file with comments | « blimp/engine/browser/blimp_url_request_context_getter.cc ('k') | blimp/engine/browser/blimp_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698