OLD | NEW |
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 CONTENT_BROWSER_TAB_CONTENTS_INTERSTITIAL_PAGE_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_INTERSTITIAL_PAGE_H_ |
6 #define CONTENT_BROWSER_TAB_CONTENTS_INTERSTITIAL_PAGE_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_INTERSTITIAL_PAGE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/i18n/rtl.h" | |
13 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
14 #include "base/process_util.h" | 13 #include "base/process_util.h" |
15 #include "content/browser/renderer_host/render_view_host_delegate.h" | 14 #include "content/browser/renderer_host/render_view_host_delegate.h" |
16 #include "content/common/notification_observer.h" | 15 #include "content/common/notification_observer.h" |
17 #include "content/common/notification_registrar.h" | 16 #include "content/common/notification_registrar.h" |
18 #include "content/common/renderer_preferences.h" | 17 #include "content/common/renderer_preferences.h" |
19 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
20 #include "ui/gfx/size.h" | 19 #include "ui/gfx/size.h" |
21 | 20 |
22 class NavigationEntry; | 21 class NavigationEntry; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 const NotificationDetails& details); | 121 const NotificationDetails& details); |
123 | 122 |
124 // RenderViewHostDelegate implementation: | 123 // RenderViewHostDelegate implementation: |
125 virtual View* GetViewDelegate(); | 124 virtual View* GetViewDelegate(); |
126 virtual const GURL& GetURL() const; | 125 virtual const GURL& GetURL() const; |
127 virtual void RenderViewGone(RenderViewHost* render_view_host, | 126 virtual void RenderViewGone(RenderViewHost* render_view_host, |
128 base::TerminationStatus status, | 127 base::TerminationStatus status, |
129 int error_code); | 128 int error_code); |
130 virtual void DidNavigate(RenderViewHost* render_view_host, | 129 virtual void DidNavigate(RenderViewHost* render_view_host, |
131 const ViewHostMsg_FrameNavigate_Params& params); | 130 const ViewHostMsg_FrameNavigate_Params& params); |
132 virtual void UpdateTitle( | 131 virtual void UpdateTitle(RenderViewHost* render_view_host, |
133 RenderViewHost* render_view_host, | 132 int32 page_id, |
134 int32 page_id, | 133 const std::wstring& title); |
135 const base::i18n::String16WithDirection& title) OVERRIDE; | |
136 virtual void DomOperationResponse(const std::string& json_string, | 134 virtual void DomOperationResponse(const std::string& json_string, |
137 int automation_id); | 135 int automation_id); |
138 virtual RendererPreferences GetRendererPrefs(Profile* profile) const; | 136 virtual RendererPreferences GetRendererPrefs(Profile* profile) const; |
139 | 137 |
140 // Invoked when the page sent a command through DOMAutomation. | 138 // Invoked when the page sent a command through DOMAutomation. |
141 virtual void CommandReceived(const std::string& command) {} | 139 virtual void CommandReceived(const std::string& command) {} |
142 | 140 |
143 // Invoked with the NavigationEntry that is going to be added to the | 141 // Invoked with the NavigationEntry that is going to be added to the |
144 // navigation controller. | 142 // navigation controller. |
145 // Gives an opportunity to sub-classes to set states on the |entry|. | 143 // Gives an opportunity to sub-classes to set states on the |entry|. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // Whether or not we should change the title of the tab when hidden (to revert | 219 // Whether or not we should change the title of the tab when hidden (to revert |
222 // it to its original value). | 220 // it to its original value). |
223 bool should_revert_tab_title_; | 221 bool should_revert_tab_title_; |
224 | 222 |
225 // Whether the ResourceDispatcherHost has been notified to cancel/resume the | 223 // Whether the ResourceDispatcherHost has been notified to cancel/resume the |
226 // resource requests blocked for the RenderViewHost. | 224 // resource requests blocked for the RenderViewHost. |
227 bool resource_dispatcher_host_notified_; | 225 bool resource_dispatcher_host_notified_; |
228 | 226 |
229 // The original title of the tab that should be reverted to when the | 227 // The original title of the tab that should be reverted to when the |
230 // interstitial is hidden. | 228 // interstitial is hidden. |
231 base::i18n::String16WithDirection original_tab_title_; | 229 std::wstring original_tab_title_; |
232 | 230 |
233 // Our RenderViewHostViewDelegate, necessary for accelerators to work. | 231 // Our RenderViewHostViewDelegate, necessary for accelerators to work. |
234 scoped_ptr<InterstitialPageRVHViewDelegate> rvh_view_delegate_; | 232 scoped_ptr<InterstitialPageRVHViewDelegate> rvh_view_delegate_; |
235 | 233 |
236 // We keep a map of the various blocking pages shown as the UI tests need to | 234 // We keep a map of the various blocking pages shown as the UI tests need to |
237 // be able to retrieve them. | 235 // be able to retrieve them. |
238 typedef std::map<TabContents*, InterstitialPage*> InterstitialPageMap; | 236 typedef std::map<TabContents*, InterstitialPage*> InterstitialPageMap; |
239 static InterstitialPageMap* tab_to_interstitial_page_; | 237 static InterstitialPageMap* tab_to_interstitial_page_; |
240 | 238 |
241 // Settings passed to the renderer. | 239 // Settings passed to the renderer. |
242 RendererPreferences renderer_preferences_; | 240 RendererPreferences renderer_preferences_; |
243 | 241 |
244 DISALLOW_COPY_AND_ASSIGN(InterstitialPage); | 242 DISALLOW_COPY_AND_ASSIGN(InterstitialPage); |
245 }; | 243 }; |
246 | 244 |
247 #endif // CONTENT_BROWSER_TAB_CONTENTS_INTERSTITIAL_PAGE_H_ | 245 #endif // CONTENT_BROWSER_TAB_CONTENTS_INTERSTITIAL_PAGE_H_ |
OLD | NEW |