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/app_mode/app_mode_utils.h" | 9 #include "chrome/browser/app_mode/app_mode_utils.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 22 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
23 #include "chrome/browser/ui/web_contents_sizer.h" | 23 #include "chrome/browser/ui/web_contents_sizer.h" |
24 #include "chrome/browser/ui/zoom/zoom_controller.h" | 24 #include "chrome/browser/ui/zoom/zoom_controller.h" |
25 #include "chrome/common/extensions/chrome_extension_messages.h" | 25 #include "chrome/common/extensions/chrome_extension_messages.h" |
26 #include "content/public/browser/browser_context.h" | 26 #include "content/public/browser/browser_context.h" |
27 #include "content/public/browser/notification_service.h" | 27 #include "content/public/browser/notification_service.h" |
28 #include "content/public/browser/render_view_host.h" | 28 #include "content/public/browser/render_view_host.h" |
29 #include "content/public/browser/web_contents.h" | 29 #include "content/public/browser/web_contents.h" |
30 #include "content/public/browser/web_contents_delegate.h" | 30 #include "content/public/browser/web_contents_delegate.h" |
31 #include "extensions/common/constants.h" | 31 #include "extensions/common/constants.h" |
32 #include "extensions/grit/extensions_browser_resources.h" | |
33 #include "ui/base/resource/resource_bundle.h" | |
34 | 32 |
35 #if defined(USE_ASH) | 33 #if defined(USE_ASH) |
36 #include "ash/shelf/shelf_constants.h" | 34 #include "ash/shelf/shelf_constants.h" |
37 #endif | 35 #endif |
38 | 36 |
39 #if defined(ENABLE_PRINTING) | 37 #if defined(ENABLE_PRINTING) |
40 #if defined(ENABLE_FULL_PRINTING) | 38 #if defined(ENABLE_FULL_PRINTING) |
41 #include "chrome/browser/printing/print_preview_message_handler.h" | 39 #include "chrome/browser/printing/print_preview_message_handler.h" |
42 #include "chrome/browser/printing/print_view_manager.h" | 40 #include "chrome/browser/printing/print_view_manager.h" |
43 #else | 41 #else |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 } | 254 } |
257 | 255 |
258 int ChromeAppDelegate::PreferredIconSize() { | 256 int ChromeAppDelegate::PreferredIconSize() { |
259 #if defined(USE_ASH) | 257 #if defined(USE_ASH) |
260 return ash::kShelfSize; | 258 return ash::kShelfSize; |
261 #else | 259 #else |
262 return extension_misc::EXTENSION_ICON_SMALL; | 260 return extension_misc::EXTENSION_ICON_SMALL; |
263 #endif | 261 #endif |
264 } | 262 } |
265 | 263 |
266 gfx::ImageSkia ChromeAppDelegate::GetAppDefaultIcon() { | |
267 return *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | |
268 IDR_APP_DEFAULT_ICON); | |
269 } | |
270 | |
271 void ChromeAppDelegate::SetWebContentsBlocked( | 264 void ChromeAppDelegate::SetWebContentsBlocked( |
272 content::WebContents* web_contents, | 265 content::WebContents* web_contents, |
273 bool blocked) { | 266 bool blocked) { |
274 // RenderViewHost may be NULL during shutdown. | 267 // RenderViewHost may be NULL during shutdown. |
275 content::RenderViewHost* host = web_contents->GetRenderViewHost(); | 268 content::RenderViewHost* host = web_contents->GetRenderViewHost(); |
276 if (host) { | 269 if (host) { |
277 host->Send(new ChromeViewMsg_SetVisuallyDeemphasized(host->GetRoutingID(), | 270 host->Send(new ChromeViewMsg_SetVisuallyDeemphasized(host->GetRoutingID(), |
278 blocked)); | 271 blocked)); |
279 } | 272 } |
280 } | 273 } |
(...skipping 12 matching lines...) Expand all Loading... |
293 const content::NotificationDetails& details) { | 286 const content::NotificationDetails& details) { |
294 switch (type) { | 287 switch (type) { |
295 case chrome::NOTIFICATION_APP_TERMINATING: | 288 case chrome::NOTIFICATION_APP_TERMINATING: |
296 if (!terminating_callback_.is_null()) | 289 if (!terminating_callback_.is_null()) |
297 terminating_callback_.Run(); | 290 terminating_callback_.Run(); |
298 break; | 291 break; |
299 default: | 292 default: |
300 NOTREACHED() << "Received unexpected notification"; | 293 NOTREACHED() << "Received unexpected notification"; |
301 } | 294 } |
302 } | 295 } |
OLD | NEW |