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

Unified Diff: extensions/browser/guest_view/extension_view/extension_view_guest.h

Issue 873933002: Add <extensionview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/guest_view/extension_view/extension_view_guest.h
diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.h b/extensions/browser/guest_view/extension_view/extension_view_guest.h
similarity index 62%
copy from extensions/browser/guest_view/extension_options/extension_options_guest.h
copy to extensions/browser/guest_view/extension_view/extension_view_guest.h
index b21aeda2ecd054359bd5dfcfc983afd2a3f63649..dae73667644088e1996a1737db3e513077417dc3 100644
--- a/extensions/browser/guest_view/extension_options/extension_options_guest.h
+++ b/extensions/browser/guest_view/extension_view/extension_view_guest.h
@@ -1,13 +1,13 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright 2015 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 EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUEST_H_
-#define EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUEST_H_
+#ifndef EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_VIEW_EXTENSION_VIEW_GUEST_H_
+#define EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_VIEW_EXTENSION_VIEW_GUEST_H_
#include "base/macros.h"
#include "extensions/browser/extension_function_dispatcher.h"
-#include "extensions/browser/guest_view/extension_options/extension_options_guest_delegate.h"
+#include "extensions/browser/guest_view/extension_view/extension_view_guest_delegate.h"
#include "extensions/browser/guest_view/guest_view.h"
#include "url/gurl.h"
@@ -17,8 +17,8 @@ class BrowserContext;
namespace extensions {
-class ExtensionOptionsGuest
- : public extensions::GuestView<ExtensionOptionsGuest>,
+class ExtensionViewGuest
+ : public extensions::GuestView<ExtensionViewGuest>,
public extensions::ExtensionFunctionDispatcher::Delegate {
public:
static const char Type[];
@@ -26,19 +26,16 @@ class ExtensionOptionsGuest
content::WebContents* owner_web_contents,
int guest_instance_id);
+ // Request navigating the guest to the provided |src| URL.
+ void NavigateGuest(const std::string& src, bool force_navigation);
+
// GuestViewBase implementation.
- bool CanRunInDetachedState() const override;
void CreateWebContents(const base::DictionaryValue& create_params,
const WebContentsCreatedCallback& callback) override;
+ void DidAttachToEmbedder() override;
void DidInitialize(const base::DictionaryValue& create_params) override;
- void DidStopLoading() override;
const char* GetAPINamespace() const override;
int GetTaskPrefix() const override;
- void GuestSizeChangedDueToAutoSize(const gfx::Size& old_size,
- const gfx::Size& new_size) override;
- bool IsAutoSizeSupported() const override;
- bool IsPreferredSizeModeEnabled() const override;
- void OnPreferredSizeChanged(const gfx::Size& pref_size) override;
// ExtensionFunctionDispatcher::Delegate implementation.
content::WebContents* GetAssociatedWebContents() const override;
@@ -47,7 +44,6 @@ class ExtensionOptionsGuest
content::WebContents* OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) override;
- void CloseContents(content::WebContents* source) override;
bool HandleContextMenu(const content::ContextMenuParams& params) override;
bool ShouldCreateWebContents(
content::WebContents* web_contents,
@@ -66,20 +62,24 @@ class ExtensionOptionsGuest
bool OnMessageReceived(const IPC::Message& message) override;
private:
- ExtensionOptionsGuest(content::WebContents* owner_web_contents,
- int guest_instance_id);
- ~ExtensionOptionsGuest() override;
+ ExtensionViewGuest(content::WebContents* owner_web_contents,
+ int guest_instance_id);
+ ~ExtensionViewGuest() override;
void OnRequest(const ExtensionHostMsg_Request_Params& params);
+ // TODO(apacible): Apply all attributes.
+ // Applies src attribute to the extensionview.
+ void ApplySrc(const base::DictionaryValue& params);
+
scoped_ptr<extensions::ExtensionFunctionDispatcher>
extension_function_dispatcher_;
- scoped_ptr<extensions::ExtensionOptionsGuestDelegate>
- extension_options_guest_delegate_;
- GURL options_page_;
+ scoped_ptr<extensions::ExtensionViewGuestDelegate>
+ extension_view_guest_delegate_;
+ GURL view_page_;
- DISALLOW_COPY_AND_ASSIGN(ExtensionOptionsGuest);
+ DISALLOW_COPY_AND_ASSIGN(ExtensionViewGuest);
};
} // namespace extensions
-#endif // EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_OPTIONS_EXTENSION_OPTIONS_GUEST_H_
+#endif // EXTENSIONS_BROWSER_GUEST_VIEW_EXTENSION_VIEW_EXTENSION_VIEW_GUEST_H_

Powered by Google App Engine
This is Rietveld 408576698