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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/extension_view_mac.h

Issue 653843002: Mac: Attach Extension NSViews to the view hierarchy before creating renderers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DCHECK Created 5 years, 10 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_ 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "chrome/browser/extensions/extension_view.h" 9 #include "chrome/browser/extensions/extension_view.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 ExtensionViewMac(extensions::ExtensionHost* extension_host, Browser* browser); 47 ExtensionViewMac(extensions::ExtensionHost* extension_host, Browser* browser);
48 ~ExtensionViewMac() override; 48 ~ExtensionViewMac() override;
49 49
50 // Sets the container for this view. 50 // Sets the container for this view.
51 void set_container(Container* container) { container_ = container; } 51 void set_container(Container* container) { container_ = container; }
52 52
53 // Informs the view that its containing window's frame changed. 53 // Informs the view that its containing window's frame changed.
54 void WindowFrameChanged(); 54 void WindowFrameChanged();
55 55
56 // Create the host view, adding it as a subview of |superview|.
57 void CreateWidgetHostViewIn(gfx::NativeView superview);
58
56 // extensions::ExtensionView: 59 // extensions::ExtensionView:
57 void Init() override;
58 Browser* GetBrowser() override; 60 Browser* GetBrowser() override;
59 gfx::NativeView GetNativeView() override; 61 gfx::NativeView GetNativeView() override;
60 void ResizeDueToAutoResize(const gfx::Size& new_size) override; 62 void ResizeDueToAutoResize(const gfx::Size& new_size) override;
61 void RenderViewCreated() override; 63 void RenderViewCreated() override;
62 void HandleKeyboardEvent( 64 void HandleKeyboardEvent(
63 content::WebContents* source, 65 content::WebContents* source,
64 const content::NativeWebKeyboardEvent& event) override; 66 const content::NativeWebKeyboardEvent& event) override;
65 void DidStopLoading() override; 67 void DidStopLoading() override;
66 68
67 private: 69 private:
68 content::RenderViewHost* render_view_host() const; 70 content::RenderViewHost* render_view_host() const;
69 71
70 void CreateWidgetHostView();
71
72 // We wait to show the ExtensionView until several things have loaded. 72 // We wait to show the ExtensionView until several things have loaded.
73 void ShowIfCompletelyLoaded(); 73 void ShowIfCompletelyLoaded();
74 74
75 Browser* browser_; // weak 75 Browser* browser_; // weak
76 76
77 extensions::ExtensionHost* extension_host_; // weak 77 extensions::ExtensionHost* extension_host_; // weak
78 78
79 // What we should set the preferred width to once the ExtensionView has 79 // What we should set the preferred width to once the ExtensionView has
80 // loaded. 80 // loaded.
81 gfx::Size pending_preferred_size_; 81 gfx::Size pending_preferred_size_;
82 82
83 Container* container_; 83 Container* container_;
84 84
85 DISALLOW_COPY_AND_ASSIGN(ExtensionViewMac); 85 DISALLOW_COPY_AND_ASSIGN(ExtensionViewMac);
86 }; 86 };
87 87
88 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_ 88 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698