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 "content/browser/web_contents/interstitial_page_impl.h" | 5 #include "content/browser/web_contents/interstitial_page_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 // Initializes g_web_contents_to_interstitial_page in a thread-safe manner. | 132 // Initializes g_web_contents_to_interstitial_page in a thread-safe manner. |
133 // Should be called before accessing g_web_contents_to_interstitial_page. | 133 // Should be called before accessing g_web_contents_to_interstitial_page. |
134 static void InitInterstitialPageMap() { | 134 static void InitInterstitialPageMap() { |
135 if (!g_web_contents_to_interstitial_page) | 135 if (!g_web_contents_to_interstitial_page) |
136 g_web_contents_to_interstitial_page = new InterstitialPageMap; | 136 g_web_contents_to_interstitial_page = new InterstitialPageMap; |
137 } | 137 } |
138 | 138 |
139 namespace content { | 139 namespace content { |
140 | 140 |
141 InterstitialPage* InterstitialPage::Create(WebContents* tab, | 141 InterstitialPage* InterstitialPage::Create(WebContents* web_contents, |
142 bool new_navigation, | 142 bool new_navigation, |
143 const GURL& url, | 143 const GURL& url, |
144 InterstitialPageDelegate* delegate) { | 144 InterstitialPageDelegate* delegate) { |
145 return new InterstitialPageImpl(tab, new_navigation, url, delegate); | 145 return new InterstitialPageImpl(web_contents, new_navigation, url, delegate); |
146 } | 146 } |
147 | 147 |
148 InterstitialPage* InterstitialPage::GetInterstitialPage( | 148 InterstitialPage* InterstitialPage::GetInterstitialPage( |
149 WebContents* web_contents) { | 149 WebContents* web_contents) { |
150 InitInterstitialPageMap(); | 150 InitInterstitialPageMap(); |
151 InterstitialPageMap::const_iterator iter = | 151 InterstitialPageMap::const_iterator iter = |
152 g_web_contents_to_interstitial_page->find(web_contents); | 152 g_web_contents_to_interstitial_page->find(web_contents); |
153 if (iter == g_web_contents_to_interstitial_page->end()) | 153 if (iter == g_web_contents_to_interstitial_page->end()) |
154 return NULL; | 154 return NULL; |
155 | 155 |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 if (!web_contents->GetViewDelegate()) | 745 if (!web_contents->GetViewDelegate()) |
746 return; | 746 return; |
747 | 747 |
748 web_contents->GetViewDelegate()->TakeFocus(reverse); | 748 web_contents->GetViewDelegate()->TakeFocus(reverse); |
749 } | 749 } |
750 | 750 |
751 void InterstitialPageImpl::InterstitialPageRVHViewDelegate::OnFindReply( | 751 void InterstitialPageImpl::InterstitialPageRVHViewDelegate::OnFindReply( |
752 int request_id, int number_of_matches, const gfx::Rect& selection_rect, | 752 int request_id, int number_of_matches, const gfx::Rect& selection_rect, |
753 int active_match_ordinal, bool final_update) { | 753 int active_match_ordinal, bool final_update) { |
754 } | 754 } |
OLD | NEW |