OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_TAB_CONTENTS_INTERSTITIAL_PAGE_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_INTERSTITIAL_PAGE_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_INTERSTITIAL_PAGE_H_ | 6 #define CHROME_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> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 virtual void Show(); | 62 virtual void Show(); |
63 | 63 |
64 // Hides the interstitial page. Warning: this deletes the InterstitialPage. | 64 // Hides the interstitial page. Warning: this deletes the InterstitialPage. |
65 void Hide(); | 65 void Hide(); |
66 | 66 |
67 // Retrieves the InterstitialPage if any associated with the specified | 67 // Retrieves the InterstitialPage if any associated with the specified |
68 // |tab_contents| (used by ui tests). | 68 // |tab_contents| (used by ui tests). |
69 static InterstitialPage* GetInterstitialPage(TabContents* tab_contents); | 69 static InterstitialPage* GetInterstitialPage(TabContents* tab_contents); |
70 | 70 |
71 // Sub-classes should return the HTML that should be displayed in the page. | 71 // Sub-classes should return the HTML that should be displayed in the page. |
72 virtual std::string GetHTMLContents() { return std::string(); } | 72 virtual std::string GetHTMLContents(); |
73 | 73 |
74 // Reverts to the page showing before the interstitial. | 74 // Reverts to the page showing before the interstitial. |
75 // Sub-classes should call this method when the user has chosen NOT to proceed | 75 // Sub-classes should call this method when the user has chosen NOT to proceed |
76 // to the target URL. | 76 // to the target URL. |
77 // Warning: if |new_navigation| was set to true in the constructor, 'this' | 77 // Warning: if |new_navigation| was set to true in the constructor, 'this' |
78 // will be deleted when this method returns. | 78 // will be deleted when this method returns. |
79 virtual void DontProceed(); | 79 virtual void DontProceed(); |
80 | 80 |
81 // Sub-classes should call this method when the user has chosen to proceed to | 81 // Sub-classes should call this method when the user has chosen to proceed to |
82 // the target URL. | 82 // the target URL. |
(...skipping 10 matching lines...) Expand all Loading... |
93 | 93 |
94 ActionState action_taken() const { return action_taken_; } | 94 ActionState action_taken() const { return action_taken_; } |
95 | 95 |
96 // Sets the focus to the interstitial. | 96 // Sets the focus to the interstitial. |
97 void Focus(); | 97 void Focus(); |
98 | 98 |
99 // Focus the first (last if reverse is true) element in the interstitial page. | 99 // Focus the first (last if reverse is true) element in the interstitial page. |
100 // Called when tab traversing. | 100 // Called when tab traversing. |
101 void FocusThroughTabTraversal(bool reverse); | 101 void FocusThroughTabTraversal(bool reverse); |
102 | 102 |
103 virtual ViewType::Type GetRenderViewType() const { | 103 virtual ViewType::Type GetRenderViewType() const; |
104 return ViewType::INTERSTITIAL_PAGE; | |
105 } | |
106 virtual int GetBrowserWindowID() const; | 104 virtual int GetBrowserWindowID() const; |
107 | 105 |
108 // See description above field. | 106 // See description above field. |
109 void set_reload_on_dont_proceed(bool value) { | 107 void set_reload_on_dont_proceed(bool value) { |
110 reload_on_dont_proceed_ = value; | 108 reload_on_dont_proceed_ = value; |
111 } | 109 } |
112 bool reload_on_dont_proceed() const { return reload_on_dont_proceed_; } | 110 bool reload_on_dont_proceed() const { return reload_on_dont_proceed_; } |
113 | 111 |
114 virtual void UpdateInspectorSetting(const std::string& key, | 112 virtual void UpdateInspectorSetting(const std::string& key, |
115 const std::string& value); | 113 const std::string& value); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 typedef std::map<TabContents*, InterstitialPage*> InterstitialPageMap; | 233 typedef std::map<TabContents*, InterstitialPage*> InterstitialPageMap; |
236 static InterstitialPageMap* tab_to_interstitial_page_; | 234 static InterstitialPageMap* tab_to_interstitial_page_; |
237 | 235 |
238 // Settings passed to the renderer. | 236 // Settings passed to the renderer. |
239 RendererPreferences renderer_preferences_; | 237 RendererPreferences renderer_preferences_; |
240 | 238 |
241 DISALLOW_COPY_AND_ASSIGN(InterstitialPage); | 239 DISALLOW_COPY_AND_ASSIGN(InterstitialPage); |
242 }; | 240 }; |
243 | 241 |
244 #endif // CHROME_BROWSER_TAB_CONTENTS_INTERSTITIAL_PAGE_H_ | 242 #endif // CHROME_BROWSER_TAB_CONTENTS_INTERSTITIAL_PAGE_H_ |
OLD | NEW |