OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/ui/apps/chrome_app_delegate.h" | 5 #include "chrome/browser/ui/apps/chrome_app_delegate.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/favicon/favicon_tab_helper.h" | 9 #include "chrome/browser/favicon/favicon_tab_helper.h" |
10 #include "chrome/browser/file_select_helper.h" | 10 #include "chrome/browser/file_select_helper.h" |
11 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 11 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
12 #include "chrome/browser/platform_util.h" | 12 #include "chrome/browser/platform_util.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/shell_integration.h" | 14 #include "chrome/browser/shell_integration.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/browser_dialogs.h" | 16 #include "chrome/browser/ui/browser_dialogs.h" |
17 #include "chrome/browser/ui/browser_tabstrip.h" | 17 #include "chrome/browser/ui/browser_tabstrip.h" |
18 #include "chrome/browser/ui/browser_window.h" | 18 #include "chrome/browser/ui/browser_window.h" |
19 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 19 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
20 #include "chrome/common/extensions/chrome_extension_messages.h" | 20 #include "chrome/common/extensions/chrome_extension_messages.h" |
21 #include "content/public/browser/browser_context.h" | 21 #include "content/public/browser/browser_context.h" |
22 #include "content/public/browser/render_view_host.h" | 22 #include "content/public/browser/render_view_host.h" |
23 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
24 #include "content/public/browser/web_contents_delegate.h" | 24 #include "content/public/browser/web_contents_delegate.h" |
25 #include "extensions/common/constants.h" | 25 #include "extensions/common/constants.h" |
| 26 #include "grit/theme_resources.h" |
| 27 #include "ui/base/resource/resource_bundle.h" |
26 | 28 |
27 #if defined(USE_ASH) | 29 #if defined(USE_ASH) |
28 #include "ash/shelf/shelf_constants.h" | 30 #include "ash/shelf/shelf_constants.h" |
29 #endif | 31 #endif |
30 | 32 |
31 #if defined(ENABLE_PRINTING) | 33 #if defined(ENABLE_PRINTING) |
32 #if defined(ENABLE_FULL_PRINTING) | 34 #if defined(ENABLE_FULL_PRINTING) |
33 #include "chrome/browser/printing/print_preview_message_handler.h" | 35 #include "chrome/browser/printing/print_preview_message_handler.h" |
34 #include "chrome/browser/printing/print_view_manager.h" | 36 #include "chrome/browser/printing/print_view_manager.h" |
35 #else | 37 #else |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 } | 226 } |
225 | 227 |
226 int ChromeAppDelegate::PreferredIconSize() { | 228 int ChromeAppDelegate::PreferredIconSize() { |
227 #if defined(USE_ASH) | 229 #if defined(USE_ASH) |
228 return ash::kShelfSize; | 230 return ash::kShelfSize; |
229 #else | 231 #else |
230 return extension_misc::EXTENSION_ICON_SMALL; | 232 return extension_misc::EXTENSION_ICON_SMALL; |
231 #endif | 233 #endif |
232 } | 234 } |
233 | 235 |
| 236 gfx::ImageSkia ChromeAppDelegate::GetAppDefaultIcon() { |
| 237 return *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 238 IDR_APP_DEFAULT_ICON); |
| 239 } |
| 240 |
234 void ChromeAppDelegate::SetWebContentsBlocked( | 241 void ChromeAppDelegate::SetWebContentsBlocked( |
235 content::WebContents* web_contents, | 242 content::WebContents* web_contents, |
236 bool blocked) { | 243 bool blocked) { |
237 // RenderViewHost may be NULL during shutdown. | 244 // RenderViewHost may be NULL during shutdown. |
238 content::RenderViewHost* host = web_contents->GetRenderViewHost(); | 245 content::RenderViewHost* host = web_contents->GetRenderViewHost(); |
239 if (host) { | 246 if (host) { |
240 host->Send(new ChromeViewMsg_SetVisuallyDeemphasized(host->GetRoutingID(), | 247 host->Send(new ChromeViewMsg_SetVisuallyDeemphasized(host->GetRoutingID(), |
241 blocked)); | 248 blocked)); |
242 } | 249 } |
243 } | 250 } |
244 | 251 |
245 bool ChromeAppDelegate::IsWebContentsVisible( | 252 bool ChromeAppDelegate::IsWebContentsVisible( |
246 content::WebContents* web_contents) { | 253 content::WebContents* web_contents) { |
247 return platform_util::IsVisible(web_contents->GetNativeView()); | 254 return platform_util::IsVisible(web_contents->GetNativeView()); |
248 } | 255 } |
OLD | NEW |