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

Side by Side Diff: chrome/browser/ui/app_list/app_list_view_delegate.cc

Issue 492643002: AppListViewDelegate: Moved TODO to the correct line. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/app_list/app_list_view_delegate.h" 5 #include "chrome/browser/ui/app_list/app_list_view_delegate.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "apps/custom_launcher_page_contents.h" 9 #include "apps/custom_launcher_page_contents.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // First, check the command line. 114 // First, check the command line.
115 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 115 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
116 if (app_list::switches::IsExperimentalAppListEnabled() && 116 if (app_list::switches::IsExperimentalAppListEnabled() &&
117 command_line->HasSwitch(switches::kCustomLauncherPage)) { 117 command_line->HasSwitch(switches::kCustomLauncherPage)) {
118 GURL custom_launcher_page_url( 118 GURL custom_launcher_page_url(
119 command_line->GetSwitchValueASCII(switches::kCustomLauncherPage)); 119 command_line->GetSwitchValueASCII(switches::kCustomLauncherPage));
120 120
121 if (custom_launcher_page_url.SchemeIs(extensions::kExtensionScheme)) { 121 if (custom_launcher_page_url.SchemeIs(extensions::kExtensionScheme)) {
122 urls->push_back(custom_launcher_page_url); 122 urls->push_back(custom_launcher_page_url);
123 } else { 123 } else {
124 // TODO(mgiuca): Add a proper manifest parser to catch this error properly
125 // and display it on the extensions page.
126 LOG(ERROR) << "Invalid custom launcher page URL: " 124 LOG(ERROR) << "Invalid custom launcher page URL: "
127 << custom_launcher_page_url.possibly_invalid_spec(); 125 << custom_launcher_page_url.possibly_invalid_spec();
128 } 126 }
129 } 127 }
130 128
131 // Search the list of installed extensions for ones with 'launcher_page'. 129 // Search the list of installed extensions for ones with 'launcher_page'.
132 extensions::ExtensionRegistry* extension_registry = 130 extensions::ExtensionRegistry* extension_registry =
133 extensions::ExtensionRegistry::Get(browser_context); 131 extensions::ExtensionRegistry::Get(browser_context);
134 const extensions::ExtensionSet& enabled_extensions = 132 const extensions::ExtensionSet& enabled_extensions =
135 extension_registry->enabled_extensions(); 133 extension_registry->enabled_extensions();
136 for (extensions::ExtensionSet::const_iterator it = enabled_extensions.begin(); 134 for (extensions::ExtensionSet::const_iterator it = enabled_extensions.begin();
137 it != enabled_extensions.end(); 135 it != enabled_extensions.end();
138 ++it) { 136 ++it) {
139 const extensions::Extension* extension = it->get(); 137 const extensions::Extension* extension = it->get();
140 const extensions::Manifest* manifest = extension->manifest(); 138 const extensions::Manifest* manifest = extension->manifest();
141 if (!manifest->HasKey(extensions::manifest_keys::kLauncherPage)) 139 if (!manifest->HasKey(extensions::manifest_keys::kLauncherPage))
142 continue; 140 continue;
143 std::string launcher_page_page; 141 std::string launcher_page_page;
144 if (!manifest->GetString(extensions::manifest_keys::kLauncherPagePage, 142 if (!manifest->GetString(extensions::manifest_keys::kLauncherPagePage,
145 &launcher_page_page)) { 143 &launcher_page_page)) {
144 // TODO(mgiuca): Add a proper manifest parser to catch this error properly
145 // and display it on the extensions page.
146 LOG(ERROR) << "Extension " << extension->id() << ": " 146 LOG(ERROR) << "Extension " << extension->id() << ": "
147 << extensions::manifest_keys::kLauncherPage 147 << extensions::manifest_keys::kLauncherPage
148 << " has no 'page' attribute; will be ignored."; 148 << " has no 'page' attribute; will be ignored.";
149 continue; 149 continue;
150 } 150 }
151 urls->push_back(extension->GetResourceURL(launcher_page_page)); 151 urls->push_back(extension->GetResourceURL(launcher_page_page));
152 } 152 }
153 } 153 }
154 154
155 } // namespace 155 } // namespace
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 582
583 void AppListViewDelegate::AddObserver( 583 void AppListViewDelegate::AddObserver(
584 app_list::AppListViewDelegateObserver* observer) { 584 app_list::AppListViewDelegateObserver* observer) {
585 observers_.AddObserver(observer); 585 observers_.AddObserver(observer);
586 } 586 }
587 587
588 void AppListViewDelegate::RemoveObserver( 588 void AppListViewDelegate::RemoveObserver(
589 app_list::AppListViewDelegateObserver* observer) { 589 app_list::AppListViewDelegateObserver* observer) {
590 observers_.RemoveObserver(observer); 590 observers_.RemoveObserver(observer);
591 } 591 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698