OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "apps/shell/browser/shell_app_window_delegate.h" |
| 6 |
| 7 #include "apps/ui/views/base_native_app_window_views.h" |
| 8 #include "content/public/browser/web_contents.h" |
| 9 #include "content/public/browser/web_contents_view.h" |
| 10 #include "ui/aura/window.h" |
| 11 |
| 12 namespace apps { |
| 13 |
| 14 ShellAppWindowDelegate::ShellAppWindowDelegate() {} |
| 15 |
| 16 ShellAppWindowDelegate::~ShellAppWindowDelegate() {} |
| 17 |
| 18 void ShellAppWindowDelegate::InitWebContents( |
| 19 content::WebContents* web_contents) {} |
| 20 |
| 21 NativeAppWindow* ShellAppWindowDelegate::CreateNativeAppWindow( |
| 22 AppWindow* window, |
| 23 const AppWindow::CreateParams& params) { |
| 24 BaseNativeAppWindowViews* native_app_window = new BaseNativeAppWindowViews; |
| 25 native_app_window->Init(window, params); |
| 26 return native_app_window; |
| 27 } |
| 28 |
| 29 content::WebContents* ShellAppWindowDelegate::OpenURLFromTab( |
| 30 content::BrowserContext* context, |
| 31 content::WebContents* source, |
| 32 const content::OpenURLParams& params) { |
| 33 return NULL; |
| 34 } |
| 35 |
| 36 void ShellAppWindowDelegate::AddNewContents(content::BrowserContext* context, |
| 37 content::WebContents* new_contents, |
| 38 WindowOpenDisposition disposition, |
| 39 const gfx::Rect& initial_pos, |
| 40 bool user_gesture, |
| 41 bool* was_blocked) { |
| 42 LOG(ERROR) << "app_shell does not support opening a new tab/window."; |
| 43 } |
| 44 |
| 45 content::ColorChooser* ShellAppWindowDelegate::ShowColorChooser( |
| 46 content::WebContents* web_contents, |
| 47 SkColor initial_color) { |
| 48 return NULL; |
| 49 } |
| 50 |
| 51 void ShellAppWindowDelegate::RunFileChooser( |
| 52 content::WebContents* tab, |
| 53 const content::FileChooserParams& params) { |
| 54 LOG(ERROR) << "app_shell does not support file pickers."; |
| 55 } |
| 56 |
| 57 void ShellAppWindowDelegate::RequestMediaAccessPermission( |
| 58 content::WebContents* web_contents, |
| 59 const content::MediaStreamRequest& request, |
| 60 const content::MediaResponseCallback& callback, |
| 61 const extensions::Extension* extension) { |
| 62 // TODO(jamescook): Support media capture. |
| 63 LOG(ERROR) << "app_shell does not support media capture."; |
| 64 } |
| 65 |
| 66 int ShellAppWindowDelegate::PreferredIconSize() { |
| 67 // Pick an arbitrary size. |
| 68 return 32; |
| 69 } |
| 70 |
| 71 void ShellAppWindowDelegate::SetWebContentsBlocked( |
| 72 content::WebContents* web_contents, |
| 73 bool blocked) {} |
| 74 |
| 75 bool ShellAppWindowDelegate::IsWebContentsVisible( |
| 76 content::WebContents* web_contents) { |
| 77 aura::Window* native_window = web_contents->GetView()->GetNativeView(); |
| 78 return native_window->IsVisible(); |
| 79 } |
| 80 |
| 81 } // namespace apps |
OLD | NEW |