OLD | NEW |
---|---|
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 #include "chrome/browser/ui/views/ash/panel_view_aura.h" | 5 #include "chrome/browser/ui/views/ash/panel_view_aura.h" |
6 | 6 |
7 #include "ash/wm/panel_frame_view.h" | 7 #include "ash/wm/panel_frame_view.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 9 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
10 #include "chrome/browser/extensions/extension_tab_util.h" | 10 #include "chrome/browser/extensions/extension_tab_util.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 public: | 47 public: |
48 PanelHost(PanelViewAura* panel_view, Profile* profile); | 48 PanelHost(PanelViewAura* panel_view, Profile* profile); |
49 virtual ~PanelHost(); | 49 virtual ~PanelHost(); |
50 | 50 |
51 void Init(const GURL& url); | 51 void Init(const GURL& url); |
52 | 52 |
53 content::WebContents* web_contents() const { return web_contents_.get(); } | 53 content::WebContents* web_contents() const { return web_contents_.get(); } |
54 Profile* profile() const { return profile_; } | 54 Profile* profile() const { return profile_; } |
55 | 55 |
56 // ExtensionFunctionDispatcher::Delegate overrides. | 56 // ExtensionFunctionDispatcher::Delegate overrides. |
57 virtual Browser* GetBrowser() OVERRIDE; | 57 virtual ExtensionWindowController* GetExtensionWindowController() |
sky
2012/05/03 21:04:47
nit: wrap function name to next line.
| |
58 const OVERRIDE; | |
58 virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; | 59 virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; |
59 | 60 |
60 // content::WebContentsDelegate implementation: | 61 // content::WebContentsDelegate implementation: |
61 virtual void CloseContents(content::WebContents* source) OVERRIDE; | 62 virtual void CloseContents(content::WebContents* source) OVERRIDE; |
62 virtual void HandleMouseDown() OVERRIDE; | 63 virtual void HandleMouseDown() OVERRIDE; |
63 virtual void UpdatePreferredSize(content::WebContents* source, | 64 virtual void UpdatePreferredSize(content::WebContents* source, |
64 const gfx::Size& pref_size) OVERRIDE; | 65 const gfx::Size& pref_size) OVERRIDE; |
65 virtual void AddNewContents(content::WebContents* source, | 66 virtual void AddNewContents(content::WebContents* source, |
66 content::WebContents* new_contents, | 67 content::WebContents* new_contents, |
67 WindowOpenDisposition disposition, | 68 WindowOpenDisposition disposition, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 web_contents_.reset(content::WebContents::Create( | 105 web_contents_.reset(content::WebContents::Create( |
105 profile_, site_instance_.get(), MSG_ROUTING_NONE, NULL, NULL)); | 106 profile_, site_instance_.get(), MSG_ROUTING_NONE, NULL, NULL)); |
106 web_contents_->SetViewType(chrome::VIEW_TYPE_PANEL); | 107 web_contents_->SetViewType(chrome::VIEW_TYPE_PANEL); |
107 web_contents_->SetDelegate(this); | 108 web_contents_->SetDelegate(this); |
108 Observe(web_contents_.get()); | 109 Observe(web_contents_.get()); |
109 | 110 |
110 web_contents_->GetController().LoadURL( | 111 web_contents_->GetController().LoadURL( |
111 url, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string()); | 112 url, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string()); |
112 } | 113 } |
113 | 114 |
114 Browser* PanelHost::GetBrowser() { | 115 ExtensionWindowController* PanelHost::GetExtensionWindowController() const { |
115 return NULL; | 116 return panel_view_->extension_window_controller(); |
116 } | 117 } |
117 | 118 |
118 content::WebContents* PanelHost::GetAssociatedWebContents() const { | 119 content::WebContents* PanelHost::GetAssociatedWebContents() const { |
119 return web_contents_.get(); | 120 return web_contents_.get(); |
120 } | 121 } |
121 | 122 |
122 void PanelHost::CloseContents(content::WebContents* source) { | 123 void PanelHost::CloseContents(content::WebContents* source) { |
123 panel_view_->CloseView(); | 124 panel_view_->CloseView(); |
124 } | 125 } |
125 | 126 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
414 } | 415 } |
415 | 416 |
416 void PanelViewAura::FlashFrame(bool flash) { | 417 void PanelViewAura::FlashFrame(bool flash) { |
417 // TODO(stevenjb): Implement | 418 // TODO(stevenjb): Implement |
418 NOTIMPLEMENTED(); | 419 NOTIMPLEMENTED(); |
419 } | 420 } |
420 | 421 |
421 bool PanelViewAura::IsAlwaysOnTop() const { | 422 bool PanelViewAura::IsAlwaysOnTop() const { |
422 return true; | 423 return true; |
423 } | 424 } |
OLD | NEW |