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

Side by Side Diff: chrome/browser/external_tab_container_win.h

Issue 7374008: Move download stuff from download helper back to TabContents. This is basically a revert of r8576... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_CONTAINER_WIN_H_ 5 #ifndef CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_WIN_H_
6 #define CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_WIN_H_ 6 #define CHROME_BROWSER_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>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "chrome/browser/automation/automation_resource_message_filter.h" 15 #include "chrome/browser/automation/automation_resource_message_filter.h"
16 #include "chrome/browser/net/chrome_url_request_context.h" 16 #include "chrome/browser/net/chrome_url_request_context.h"
17 #include "chrome/browser/tab_contents/infobar_container.h" 17 #include "chrome/browser/tab_contents/infobar_container.h"
18 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate. h" 18 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate. h"
19 #include "chrome/browser/ui/download/download_tab_helper_delegate.h"
20 #include "chrome/browser/ui/views/frame/browser_bubble_host.h" 19 #include "chrome/browser/ui/views/frame/browser_bubble_host.h"
21 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" 20 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h"
22 #include "content/browser/tab_contents/tab_contents_delegate.h" 21 #include "content/browser/tab_contents/tab_contents_delegate.h"
23 #include "content/browser/tab_contents/tab_contents_observer.h" 22 #include "content/browser/tab_contents/tab_contents_observer.h"
24 #include "content/common/navigation_types.h" 23 #include "content/common/navigation_types.h"
25 #include "content/common/notification_observer.h" 24 #include "content/common/notification_observer.h"
26 #include "content/common/notification_registrar.h" 25 #include "content/common/notification_registrar.h"
27 #include "views/accelerator.h" 26 #include "views/accelerator.h"
28 #include "views/widget/native_widget_win.h" 27 #include "views/widget/native_widget_win.h"
29 28
30 class AutomationProvider; 29 class AutomationProvider;
31 class Browser; 30 class Browser;
32 class Profile; 31 class Profile;
33 class TabContentsContainer; 32 class TabContentsContainer;
34 class TabContentsWrapper; 33 class TabContentsWrapper;
35 class RenderViewContextMenuViews; 34 class RenderViewContextMenuViews;
36 struct NavigationInfo; 35 struct NavigationInfo;
37 36
38 namespace ui { 37 namespace ui {
39 class ViewProp; 38 class ViewProp;
40 } 39 }
41 40
42 // This class serves as the container window for an external tab. 41 // This class serves as the container window for an external tab.
43 // An external tab is a Chrome tab that is meant to displayed in an 42 // An external tab is a Chrome tab that is meant to displayed in an
44 // external process. This class provides the FocusManger needed by the 43 // external process. This class provides the FocusManger needed by the
45 // TabContents as well as an implementation of TabContentsDelegate. 44 // TabContents as well as an implementation of TabContentsDelegate.
46 class ExternalTabContainer : public TabContentsDelegate, 45 class ExternalTabContainer : public TabContentsDelegate,
47 public TabContentsObserver, 46 public TabContentsObserver,
48 public DownloadTabHelperDelegate,
49 public NotificationObserver, 47 public NotificationObserver,
50 public views::NativeWidgetWin, 48 public views::NativeWidgetWin,
51 public base::RefCounted<ExternalTabContainer>, 49 public base::RefCounted<ExternalTabContainer>,
52 public views::AcceleratorTarget, 50 public views::AcceleratorTarget,
53 public InfoBarContainer::Delegate, 51 public InfoBarContainer::Delegate,
54 public BrowserBubbleHost, 52 public BrowserBubbleHost,
55 public BlockedContentTabHelperDelegate { 53 public BlockedContentTabHelperDelegate {
56 public: 54 public:
57 typedef std::map<uintptr_t, scoped_refptr<ExternalTabContainer> > PendingTabs; 55 typedef std::map<uintptr_t, scoped_refptr<ExternalTabContainer> > PendingTabs;
58 56
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 TabContents* new_contents, 126 TabContents* new_contents,
129 WindowOpenDisposition disposition, 127 WindowOpenDisposition disposition,
130 const gfx::Rect& initial_pos, 128 const gfx::Rect& initial_pos,
131 bool user_gesture); 129 bool user_gesture);
132 virtual void CloseContents(TabContents* source); 130 virtual void CloseContents(TabContents* source);
133 virtual void MoveContents(TabContents* source, const gfx::Rect& pos); 131 virtual void MoveContents(TabContents* source, const gfx::Rect& pos);
134 virtual bool IsPopup(const TabContents* source) const; 132 virtual bool IsPopup(const TabContents* source) const;
135 virtual void UpdateTargetURL(TabContents* source, const GURL& url); 133 virtual void UpdateTargetURL(TabContents* source, const GURL& url);
136 virtual void ContentsZoomChange(bool zoom_in); 134 virtual void ContentsZoomChange(bool zoom_in);
137 virtual gfx::NativeWindow GetFrameNativeWindow(); 135 virtual gfx::NativeWindow GetFrameNativeWindow();
138
139 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, 136 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
140 bool* is_keyboard_shortcut); 137 bool* is_keyboard_shortcut);
141 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); 138 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event);
142
143 virtual bool TakeFocus(bool reverse); 139 virtual bool TakeFocus(bool reverse);
144 140 virtual bool CanDownload(int request_id);
145 virtual bool OnGoToEntryOffset(int offset); 141 virtual bool OnGoToEntryOffset(int offset);
146
147 virtual void ShowPageInfo(Profile* profile, 142 virtual void ShowPageInfo(Profile* profile,
148 const GURL& url, 143 const GURL& url,
149 const NavigationEntry::SSLStatus& ssl, 144 const NavigationEntry::SSLStatus& ssl,
150 bool show_history); 145 bool show_history);
151
152 // Handles the context menu display operation. This allows external
153 // hosts to customize the menu.
Randy Smith (Not in Mondays) 2011/07/15 15:55:12 Why eliminate the comments?
jam 2011/07/15 17:28:14 this is duplicating the TabContentsDelegate commen
154 virtual bool HandleContextMenu(const ContextMenuParams& params); 146 virtual bool HandleContextMenu(const ContextMenuParams& params);
155
156 // Executes the context menu command identified by the command
157 // parameter.
158 virtual bool ExecuteContextMenuCommand(int command); 147 virtual bool ExecuteContextMenuCommand(int command);
159
160 virtual void BeforeUnloadFired(TabContents* tab, 148 virtual void BeforeUnloadFired(TabContents* tab,
161 bool proceed, 149 bool proceed,
162 bool* proceed_to_fire_unload); 150 bool* proceed_to_fire_unload);
163 151 virtual content::JavaScriptDialogCreator* GetJavaScriptDialogCreator();
164 virtual content::JavaScriptDialogCreator* GetJavaScriptDialogCreator()
165 OVERRIDE;
166
167 void ShowRepostFormWarningDialog(TabContents* tab_contents); 152 void ShowRepostFormWarningDialog(TabContents* tab_contents);
168
169 void RegisterRenderViewHost(RenderViewHost* render_view_host); 153 void RegisterRenderViewHost(RenderViewHost* render_view_host);
170 void UnregisterRenderViewHost(RenderViewHost* render_view_host); 154 void UnregisterRenderViewHost(RenderViewHost* render_view_host);
171 155
172
173 // Overridden from TabContentsObserver: 156 // Overridden from TabContentsObserver:
174 // IPC::Channel::Listener implementation. 157 // IPC::Channel::Listener implementation.
175 virtual bool OnMessageReceived(const IPC::Message& message); 158 virtual bool OnMessageReceived(const IPC::Message& message);
176 159
177 // Message handlers 160 // Message handlers
178 void OnForwardMessageToExternalHost(const std::string& message, 161 void OnForwardMessageToExternalHost(const std::string& message,
179 const std::string& origin, 162 const std::string& origin,
180 const std::string& target); 163 const std::string& target);
181 164
182 // Overridden from NotificationObserver: 165 // Overridden from NotificationObserver:
183 virtual void Observe(int type, 166 virtual void Observe(int type,
184 const NotificationSource& source, 167 const NotificationSource& source,
185 const NotificationDetails& details); 168 const NotificationDetails& details);
186 169
187 // Overridden from DownloadTabHelperDelegate:
188 virtual bool CanDownload(int request_id) OVERRIDE;
189 virtual void OnStartDownload(DownloadItem* download,
190 TabContentsWrapper* tab) OVERRIDE;
191
192 // Returns the ExternalTabContainer instance associated with the cookie 170 // Returns the ExternalTabContainer instance associated with the cookie
193 // passed in. It also erases the corresponding reference from the map. 171 // passed in. It also erases the corresponding reference from the map.
194 // Returns NULL if we fail to find the cookie in the map. 172 // Returns NULL if we fail to find the cookie in the map.
195 static scoped_refptr<ExternalTabContainer> RemovePendingTab(uintptr_t cookie); 173 static scoped_refptr<ExternalTabContainer> RemovePendingTab(uintptr_t cookie);
196 174
197 // Handles the specified |accelerator| being pressed. 175 // Handles the specified |accelerator| being pressed.
198 bool AcceleratorPressed(const views::Accelerator& accelerator); 176 bool AcceleratorPressed(const views::Accelerator& accelerator);
199 177
200 bool pending() const { 178 bool pending() const {
201 return pending_; 179 return pending_;
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 return false; 381 return false;
404 } 382 }
405 383
406 virtual void BeforeUnloadFired(TabContents* tab, bool proceed, 384 virtual void BeforeUnloadFired(TabContents* tab, bool proceed,
407 bool* proceed_to_fire_unload) { 385 bool* proceed_to_fire_unload) {
408 NOTREACHED(); 386 NOTREACHED();
409 } 387 }
410 }; 388 };
411 389
412 #endif // CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_WIN_H_ 390 #endif // CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_WIN_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/download_request_limiter.cc ('k') | chrome/browser/external_tab_container_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698