Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1057)

Side by Side Diff: apps/shell/browser/shell_app_window_delegate.cc

Issue 166833004: Add support for chrome.app.window.create() to app_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (shell_app_window) Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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/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 NativeAppWindowViews* native_app_window = new NativeAppWindowViews;
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 // Opening a new tab/window is not supported.
miket_OOO 2014/02/21 18:25:38 Any chance a future developer will be confused by
James Cook 2014/02/22 00:11:17 Done.
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 // No file pickers in app_shell.
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 }
64
65 int ShellAppWindowDelegate::PreferredIconSize() {
66 // Pick an arbitrary size.
67 return 32;
68 }
69
70 void ShellAppWindowDelegate::SetWebContentsBlocked(
71 content::WebContents* web_contents,
72 bool blocked) {}
73
74 bool ShellAppWindowDelegate::IsWebContentsVisible(
75 content::WebContents* web_contents) {
76 aura::Window* native_window = web_contents->GetView()->GetNativeView();
77 return native_window->IsVisible();
78 }
79
80 } // namespace apps
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698