OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/extension_view_host.h" | 5 #include "chrome/browser/extensions/extension_view_host.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/strings/string_piece.h" | 8 #include "base/strings/string_piece.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 return false; | 141 return false; |
142 } | 142 } |
143 | 143 |
144 // content::WebContentsDelegate overrides: | 144 // content::WebContentsDelegate overrides: |
145 | 145 |
146 WebContents* ExtensionViewHost::OpenURLFromTab( | 146 WebContents* ExtensionViewHost::OpenURLFromTab( |
147 WebContents* source, | 147 WebContents* source, |
148 const OpenURLParams& params) { | 148 const OpenURLParams& params) { |
149 // Whitelist the dispositions we will allow to be opened. | 149 // Whitelist the dispositions we will allow to be opened. |
150 switch (params.disposition) { | 150 switch (params.disposition) { |
151 case SINGLETON_TAB: | 151 case WindowOpenDisposition::SINGLETON_TAB: |
152 case NEW_FOREGROUND_TAB: | 152 case WindowOpenDisposition::NEW_FOREGROUND_TAB: |
153 case NEW_BACKGROUND_TAB: | 153 case WindowOpenDisposition::NEW_BACKGROUND_TAB: |
154 case NEW_POPUP: | 154 case WindowOpenDisposition::NEW_POPUP: |
155 case NEW_WINDOW: | 155 case WindowOpenDisposition::NEW_WINDOW: |
156 case SAVE_TO_DISK: | 156 case WindowOpenDisposition::SAVE_TO_DISK: |
157 case OFF_THE_RECORD: { | 157 case WindowOpenDisposition::OFF_THE_RECORD: { |
158 // Only allow these from hosts that are bound to a browser (e.g. popups). | 158 // Only allow these from hosts that are bound to a browser (e.g. popups). |
159 // Otherwise they are not driven by a user gesture. | 159 // Otherwise they are not driven by a user gesture. |
160 Browser* browser = view_->GetBrowser(); | 160 Browser* browser = view_->GetBrowser(); |
161 return browser ? browser->OpenURL(params) : NULL; | 161 return browser ? browser->OpenURL(params) : NULL; |
162 } | 162 } |
163 default: | 163 default: |
164 return NULL; | 164 return NULL; |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 const content::NotificationSource& source, | 298 const content::NotificationSource& source, |
299 const content::NotificationDetails& details) { | 299 const content::NotificationDetails& details) { |
300 DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY); | 300 DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY); |
301 DCHECK(ExtensionSystem::Get(browser_context()) | 301 DCHECK(ExtensionSystem::Get(browser_context()) |
302 ->runtime_data() | 302 ->runtime_data() |
303 ->IsBackgroundPageReady(extension())); | 303 ->IsBackgroundPageReady(extension())); |
304 LoadInitialURL(); | 304 LoadInitialURL(); |
305 } | 305 } |
306 | 306 |
307 } // namespace extensions | 307 } // namespace extensions |
OLD | NEW |