| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 WebContents* web_contents, | 213 WebContents* web_contents, |
| 214 SkColor initial_color, | 214 SkColor initial_color, |
| 215 const std::vector<content::ColorSuggestion>& suggestions) { | 215 const std::vector<content::ColorSuggestion>& suggestions) { |
| 216 // Similar to the file chooser below, opening a color chooser requires a | 216 // Similar to the file chooser below, opening a color chooser requires a |
| 217 // visible <input> element to click on. Therefore this code only exists for | 217 // visible <input> element to click on. Therefore this code only exists for |
| 218 // extensions with a view. | 218 // extensions with a view. |
| 219 return chrome::ShowColorChooser(web_contents, initial_color); | 219 return chrome::ShowColorChooser(web_contents, initial_color); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void ExtensionViewHost::RunFileChooser( | 222 void ExtensionViewHost::RunFileChooser( |
| 223 WebContents* tab, | 223 content::RenderFrameHost* render_frame_host, |
| 224 const content::FileChooserParams& params) { | 224 const content::FileChooserParams& params) { |
| 225 // For security reasons opening a file picker requires a visible <input> | 225 // For security reasons opening a file picker requires a visible <input> |
| 226 // element to click on, so this code only exists for extensions with a view. | 226 // element to click on, so this code only exists for extensions with a view. |
| 227 FileSelectHelper::RunFileChooser(tab, params); | 227 FileSelectHelper::RunFileChooser(render_frame_host, params); |
| 228 } | 228 } |
| 229 | 229 |
| 230 | 230 |
| 231 void ExtensionViewHost::ResizeDueToAutoResize(WebContents* source, | 231 void ExtensionViewHost::ResizeDueToAutoResize(WebContents* source, |
| 232 const gfx::Size& new_size) { | 232 const gfx::Size& new_size) { |
| 233 view_->ResizeDueToAutoResize(source, new_size); | 233 view_->ResizeDueToAutoResize(source, new_size); |
| 234 } | 234 } |
| 235 | 235 |
| 236 // content::WebContentsObserver overrides: | 236 // content::WebContentsObserver overrides: |
| 237 | 237 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 const content::NotificationSource& source, | 299 const content::NotificationSource& source, |
| 300 const content::NotificationDetails& details) { | 300 const content::NotificationDetails& details) { |
| 301 DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY); | 301 DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY); |
| 302 DCHECK(ExtensionSystem::Get(browser_context()) | 302 DCHECK(ExtensionSystem::Get(browser_context()) |
| 303 ->runtime_data() | 303 ->runtime_data() |
| 304 ->IsBackgroundPageReady(extension())); | 304 ->IsBackgroundPageReady(extension())); |
| 305 LoadInitialURL(); | 305 LoadInitialURL(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 } // namespace extensions | 308 } // namespace extensions |
| OLD | NEW |