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/public/browser/web_contents_delegate.h" | 5 #include "content/public/browser/web_contents_delegate.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // it with proper implementation. | 89 // it with proper implementation. |
90 GURL url = GURL(chrome::kViewSourceScheme + std::string(":") + | 90 GURL url = GURL(chrome::kViewSourceScheme + std::string(":") + |
91 page_url.spec()); | 91 page_url.spec()); |
92 OpenURLFromTab(source, OpenURLParams(url, Referrer(), | 92 OpenURLFromTab(source, OpenURLParams(url, Referrer(), |
93 NEW_FOREGROUND_TAB, | 93 NEW_FOREGROUND_TAB, |
94 PAGE_TRANSITION_LINK, false)); | 94 PAGE_TRANSITION_LINK, false)); |
95 } | 95 } |
96 | 96 |
97 void WebContentsDelegate::ViewSourceForFrame(WebContents* source, | 97 void WebContentsDelegate::ViewSourceForFrame(WebContents* source, |
98 const GURL& frame_url, | 98 const GURL& frame_url, |
99 const std::string& content_state) { | 99 const PageState& page_state) { |
100 // Same as ViewSourceForTab, but for given subframe. | 100 // Same as ViewSourceForTab, but for given subframe. |
101 GURL url = GURL(chrome::kViewSourceScheme + std::string(":") + | 101 GURL url = GURL(chrome::kViewSourceScheme + std::string(":") + |
102 frame_url.spec()); | 102 frame_url.spec()); |
103 OpenURLFromTab(source, OpenURLParams(url, Referrer(), | 103 OpenURLFromTab(source, OpenURLParams(url, Referrer(), |
104 NEW_FOREGROUND_TAB, | 104 NEW_FOREGROUND_TAB, |
105 PAGE_TRANSITION_LINK, false)); | 105 PAGE_TRANSITION_LINK, false)); |
106 } | 106 } |
107 | 107 |
108 bool WebContentsDelegate::PreHandleKeyboardEvent( | 108 bool WebContentsDelegate::PreHandleKeyboardEvent( |
109 WebContents* source, | 109 WebContents* source, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end()); | 159 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end()); |
160 attached_contents_.insert(web_contents); | 160 attached_contents_.insert(web_contents); |
161 } | 161 } |
162 | 162 |
163 void WebContentsDelegate::Detach(WebContents* web_contents) { | 163 void WebContentsDelegate::Detach(WebContents* web_contents) { |
164 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); | 164 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); |
165 attached_contents_.erase(web_contents); | 165 attached_contents_.erase(web_contents); |
166 } | 166 } |
167 | 167 |
168 } // namespace content | 168 } // namespace content |
OLD | NEW |