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

Side by Side Diff: extensions/browser/app_window/app_window.cc

Issue 586853004: Remove AppDelegate::GetAppDefaultIcon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@not-impl
Patch Set: (app-icon) rebase Created 6 years, 3 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
OLDNEW
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 "extensions/browser/app_window/app_window.h" 5 #include "extensions/browser/app_window/app_window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 21 matching lines...) Expand all
32 #include "extensions/browser/extension_system.h" 32 #include "extensions/browser/extension_system.h"
33 #include "extensions/browser/extensions_browser_client.h" 33 #include "extensions/browser/extensions_browser_client.h"
34 #include "extensions/browser/process_manager.h" 34 #include "extensions/browser/process_manager.h"
35 #include "extensions/browser/suggest_permission_util.h" 35 #include "extensions/browser/suggest_permission_util.h"
36 #include "extensions/browser/view_type_utils.h" 36 #include "extensions/browser/view_type_utils.h"
37 #include "extensions/common/draggable_region.h" 37 #include "extensions/common/draggable_region.h"
38 #include "extensions/common/extension.h" 38 #include "extensions/common/extension.h"
39 #include "extensions/common/manifest_handlers/icons_handler.h" 39 #include "extensions/common/manifest_handlers/icons_handler.h"
40 #include "extensions/common/permissions/permissions_data.h" 40 #include "extensions/common/permissions/permissions_data.h"
41 #include "extensions/common/switches.h" 41 #include "extensions/common/switches.h"
42 #include "extensions/grit/extensions_browser_resources.h"
tapted 2014/09/22 00:02:05 I wonder if we should remove the `browser` bit..
42 #include "third_party/skia/include/core/SkRegion.h" 43 #include "third_party/skia/include/core/SkRegion.h"
44 #include "ui/base/resource/resource_bundle.h"
43 #include "ui/gfx/screen.h" 45 #include "ui/gfx/screen.h"
44 46
45 #if !defined(OS_MACOSX) 47 #if !defined(OS_MACOSX)
46 #include "base/prefs/pref_service.h" 48 #include "base/prefs/pref_service.h"
47 #include "extensions/browser/pref_names.h" 49 #include "extensions/browser/pref_names.h"
48 #endif 50 #endif
49 51
50 using content::BrowserContext; 52 using content::BrowserContext;
51 using content::ConsoleMessageLevel; 53 using content::ConsoleMessageLevel;
52 using content::WebContents; 54 using content::WebContents;
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 } 794 }
793 795
794 void AppWindow::UpdateExtensionAppIcon() { 796 void AppWindow::UpdateExtensionAppIcon() {
795 // Avoid using any previous app icons were being downloaded. 797 // Avoid using any previous app icons were being downloaded.
796 image_loader_ptr_factory_.InvalidateWeakPtrs(); 798 image_loader_ptr_factory_.InvalidateWeakPtrs();
797 799
798 const Extension* extension = GetExtension(); 800 const Extension* extension = GetExtension();
799 if (!extension) 801 if (!extension)
800 return; 802 return;
801 803
804 gfx::ImageSkia app_default_icon =
805 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
806 IDR_APP_DEFAULT_ICON);
807
802 app_icon_image_.reset(new IconImage(browser_context(), 808 app_icon_image_.reset(new IconImage(browser_context(),
803 extension, 809 extension,
804 IconsInfo::GetIcons(extension), 810 IconsInfo::GetIcons(extension),
805 app_delegate_->PreferredIconSize(), 811 app_delegate_->PreferredIconSize(),
806 app_delegate_->GetAppDefaultIcon(), 812 app_default_icon,
807 this)); 813 this));
808 814
809 // Triggers actual image loading with 1x resources. The 2x resource will 815 // Triggers actual image loading with 1x resources. The 2x resource will
810 // be handled by IconImage class when requested. 816 // be handled by IconImage class when requested.
811 app_icon_image_->image_skia().GetRepresentation(1.0f); 817 app_icon_image_->image_skia().GetRepresentation(1.0f);
812 } 818 }
813 819
814 void AppWindow::SetNativeWindowFullscreen() { 820 void AppWindow::SetNativeWindowFullscreen() {
815 native_app_window_->SetFullscreen(fullscreen_types_); 821 native_app_window_->SetFullscreen(fullscreen_types_);
816 822
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 region.bounds.x(), 1072 region.bounds.x(),
1067 region.bounds.y(), 1073 region.bounds.y(),
1068 region.bounds.right(), 1074 region.bounds.right(),
1069 region.bounds.bottom(), 1075 region.bounds.bottom(),
1070 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 1076 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
1071 } 1077 }
1072 return sk_region; 1078 return sk_region;
1073 } 1079 }
1074 1080
1075 } // namespace extensions 1081 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698