| 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 #ifndef CHROME_BROWSER_EXTERNAL_TAB_EXTERNAL_TAB_CONTAINER_WIN_H_ | 5 #ifndef CHROME_BROWSER_EXTERNAL_TAB_EXTERNAL_TAB_CONTAINER_WIN_H_ |
| 6 #define CHROME_BROWSER_EXTERNAL_TAB_EXTERNAL_TAB_CONTAINER_WIN_H_ | 6 #define CHROME_BROWSER_EXTERNAL_TAB_EXTERNAL_TAB_CONTAINER_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "content/public/browser/web_contents_delegate.h" | 25 #include "content/public/browser/web_contents_delegate.h" |
| 26 #include "content/public/browser/web_contents_observer.h" | 26 #include "content/public/browser/web_contents_observer.h" |
| 27 #include "ui/base/accelerators/accelerator.h" | 27 #include "ui/base/accelerators/accelerator.h" |
| 28 #include "ui/views/widget/native_widget_win.h" | 28 #include "ui/views/widget/native_widget_win.h" |
| 29 | 29 |
| 30 class AutomationProvider; | 30 class AutomationProvider; |
| 31 class Browser; | 31 class Browser; |
| 32 class Profile; | 32 class Profile; |
| 33 class TabContentsContainer; | 33 class TabContentsContainer; |
| 34 class TabContents; | 34 class TabContents; |
| 35 typedef TabContents TabContentsWrapper; | |
| 36 class RenderViewContextMenuViews; | 35 class RenderViewContextMenuViews; |
| 37 struct NavigationInfo; | 36 struct NavigationInfo; |
| 38 | 37 |
| 39 namespace content { | 38 namespace content { |
| 40 class WebIntentsDispatcher; | 39 class WebIntentsDispatcher; |
| 41 } | 40 } |
| 42 | 41 |
| 43 namespace ui { | 42 namespace ui { |
| 44 class ViewProp; | 43 class ViewProp; |
| 45 } | 44 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 60 public ui::AcceleratorTarget, | 59 public ui::AcceleratorTarget, |
| 61 public InfoBarContainer::Delegate, | 60 public InfoBarContainer::Delegate, |
| 62 public BlockedContentTabHelperDelegate { | 61 public BlockedContentTabHelperDelegate { |
| 63 public: | 62 public: |
| 64 typedef std::map<uintptr_t, scoped_refptr<ExternalTabContainer> > PendingTabs; | 63 typedef std::map<uintptr_t, scoped_refptr<ExternalTabContainer> > PendingTabs; |
| 65 | 64 |
| 66 ExternalTabContainer(AutomationProvider* automation, | 65 ExternalTabContainer(AutomationProvider* automation, |
| 67 AutomationResourceMessageFilter* filter); | 66 AutomationResourceMessageFilter* filter); |
| 68 | 67 |
| 69 content::WebContents* web_contents() const; | 68 content::WebContents* web_contents() const; |
| 70 TabContentsWrapper* tab_contents_wrapper() { return tab_contents_.get(); } | 69 TabContents* tab_contents() { return tab_contents_.get(); } |
| 71 | 70 |
| 72 // Temporary hack so we can send notifications back | 71 // Temporary hack so we can send notifications back |
| 73 void SetTabHandle(int handle); | 72 void SetTabHandle(int handle); |
| 74 | 73 |
| 75 int tab_handle() const { | 74 int tab_handle() const { |
| 76 return tab_handle_; | 75 return tab_handle_; |
| 77 } | 76 } |
| 78 | 77 |
| 79 bool Init(Profile* profile, | 78 bool Init(Profile* profile, |
| 80 HWND parent, | 79 HWND parent, |
| 81 const gfx::Rect& bounds, | 80 const gfx::Rect& bounds, |
| 82 DWORD style, | 81 DWORD style, |
| 83 bool load_requests_via_automation, | 82 bool load_requests_via_automation, |
| 84 bool handle_top_level_requests, | 83 bool handle_top_level_requests, |
| 85 TabContentsWrapper* existing_tab_contents, | 84 TabContents* existing_tab_contents, |
| 86 const GURL& initial_url, | 85 const GURL& initial_url, |
| 87 const GURL& referrer, | 86 const GURL& referrer, |
| 88 bool infobars_enabled, | 87 bool infobars_enabled, |
| 89 bool supports_full_tab_mode); | 88 bool supports_full_tab_mode); |
| 90 | 89 |
| 91 // Unhook the keystroke listener and notify about the closing WebContents. | 90 // Unhook the keystroke listener and notify about the closing WebContents. |
| 92 // This function gets called from three places, which is fine. | 91 // This function gets called from three places, which is fine. |
| 93 // 1. OnFinalMessage | 92 // 1. OnFinalMessage |
| 94 // 2. In the destructor. | 93 // 2. In the destructor. |
| 95 // 3. In AutomationProvider::CreateExternalTab | 94 // 3. In AutomationProvider::CreateExternalTab |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 237 } |
| 239 | 238 |
| 240 // InfoBarContainer::Delegate overrides | 239 // InfoBarContainer::Delegate overrides |
| 241 virtual SkColor GetInfoBarSeparatorColor() const OVERRIDE; | 240 virtual SkColor GetInfoBarSeparatorColor() const OVERRIDE; |
| 242 virtual void InfoBarContainerStateChanged(bool is_animating) OVERRIDE; | 241 virtual void InfoBarContainerStateChanged(bool is_animating) OVERRIDE; |
| 243 virtual bool DrawInfoBarArrows(int* x) const OVERRIDE; | 242 virtual bool DrawInfoBarArrows(int* x) const OVERRIDE; |
| 244 | 243 |
| 245 void RunUnloadHandlers(IPC::Message* reply_message); | 244 void RunUnloadHandlers(IPC::Message* reply_message); |
| 246 | 245 |
| 247 // Overridden from BlockedContentTabHelperDelegate: | 246 // Overridden from BlockedContentTabHelperDelegate: |
| 248 virtual TabContentsWrapper* GetConstrainingContentsWrapper( | 247 virtual TabContents* GetConstrainingContentsWrapper( |
| 249 TabContentsWrapper* source) OVERRIDE; | 248 TabContents* source) OVERRIDE; |
| 250 | 249 |
| 251 protected: | 250 protected: |
| 252 ~ExternalTabContainer(); | 251 ~ExternalTabContainer(); |
| 253 // Overridden from views::NativeWidgetWin: | 252 // Overridden from views::NativeWidgetWin: |
| 254 virtual LRESULT OnCreate(LPCREATESTRUCT create_struct); | 253 virtual LRESULT OnCreate(LPCREATESTRUCT create_struct); |
| 255 virtual void OnDestroy(); | 254 virtual void OnDestroy(); |
| 256 virtual void OnFinalMessage(HWND window); | 255 virtual void OnFinalMessage(HWND window); |
| 257 | 256 |
| 258 bool InitNavigationInfo(NavigationInfo* nav_info, | 257 bool InitNavigationInfo(NavigationInfo* nav_info, |
| 259 content::NavigationType nav_type, | 258 content::NavigationType nav_type, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 277 | 276 |
| 278 // Sends over pending Open URL requests to the external host. | 277 // Sends over pending Open URL requests to the external host. |
| 279 void ServicePendingOpenURLRequests(); | 278 void ServicePendingOpenURLRequests(); |
| 280 | 279 |
| 281 // Scheduled as a task in ExternalTabContainer::Reinitialize | 280 // Scheduled as a task in ExternalTabContainer::Reinitialize |
| 282 void OnReinitialize(); | 281 void OnReinitialize(); |
| 283 | 282 |
| 284 // Creates and initializes the view hierarchy for this ExternalTabContainer. | 283 // Creates and initializes the view hierarchy for this ExternalTabContainer. |
| 285 void SetupExternalTabView(); | 284 void SetupExternalTabView(); |
| 286 | 285 |
| 287 scoped_ptr<TabContentsWrapper> tab_contents_; | 286 scoped_ptr<TabContents> tab_contents_; |
| 288 scoped_refptr<AutomationProvider> automation_; | 287 scoped_refptr<AutomationProvider> automation_; |
| 289 | 288 |
| 290 content::NotificationRegistrar registrar_; | 289 content::NotificationRegistrar registrar_; |
| 291 | 290 |
| 292 // A view to handle focus cycling | 291 // A view to handle focus cycling |
| 293 views::WebView* tab_contents_container_; | 292 views::WebView* tab_contents_container_; |
| 294 | 293 |
| 295 int tab_handle_; | 294 int tab_handle_; |
| 296 // A failed navigation like a 404 is followed in chrome with a success | 295 // A failed navigation like a 404 is followed in chrome with a success |
| 297 // navigation for the 404 page. We need to ignore the next navigation | 296 // navigation for the 404 page. We need to ignore the next navigation |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 return false; | 419 return false; |
| 421 } | 420 } |
| 422 | 421 |
| 423 virtual void BeforeUnloadFired(content::WebContents* tab, bool proceed, | 422 virtual void BeforeUnloadFired(content::WebContents* tab, bool proceed, |
| 424 bool* proceed_to_fire_unload) { | 423 bool* proceed_to_fire_unload) { |
| 425 NOTREACHED(); | 424 NOTREACHED(); |
| 426 } | 425 } |
| 427 }; | 426 }; |
| 428 | 427 |
| 429 #endif // CHROME_BROWSER_EXTERNAL_TAB_EXTERNAL_TAB_CONTAINER_WIN_H_ | 428 #endif // CHROME_BROWSER_EXTERNAL_TAB_EXTERNAL_TAB_CONTAINER_WIN_H_ |
| OLD | NEW |