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

Side by Side Diff: chrome/common/extensions/extension.cc

Issue 2078021: First pass at experimental omnibox API. There are plenty of rough edges and (Closed)
Patch Set: no prefer_keyword Created 10 years, 7 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
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 chrome_url_overrides_[page] = GetResourceURL(val); 1449 chrome_url_overrides_[page] = GetResourceURL(val);
1450 } 1450 }
1451 1451
1452 // An extension may override at most one page. 1452 // An extension may override at most one page.
1453 if (overrides->size() > 1) { 1453 if (overrides->size() > 1) {
1454 *error = errors::kMultipleOverrides; 1454 *error = errors::kMultipleOverrides;
1455 return false; 1455 return false;
1456 } 1456 }
1457 } 1457 }
1458 1458
1459 if (source.HasKey(keys::kOmniboxKeyword)) {
1460 if (!source.GetString(keys::kOmniboxKeyword, &omnibox_keyword_) ||
1461 omnibox_keyword_.empty()) {
1462 *error = errors::kInvalidOmniboxKeyword;
1463 return false;
1464 }
1465 if (!HasApiPermission(Extension::kExperimentalPermission)) {
1466 *error = errors::kOmniboxExperimental;
1467 return false;
1468 }
1469 }
1470
1459 if (!CheckAppsAreEnabled(manifest_value_.get(), error) || 1471 if (!CheckAppsAreEnabled(manifest_value_.get(), error) ||
1460 !LoadWebContentEnabled(manifest_value_.get(), error) || 1472 !LoadWebContentEnabled(manifest_value_.get(), error) ||
1461 !LoadWebOrigin(manifest_value_.get(), error) || 1473 !LoadWebOrigin(manifest_value_.get(), error) ||
1462 !LoadWebPaths(manifest_value_.get(), error) || 1474 !LoadWebPaths(manifest_value_.get(), error) ||
1463 !LoadLaunchURL(manifest_value_.get(), error) || 1475 !LoadLaunchURL(manifest_value_.get(), error) ||
1464 !LoadLaunchContainer(manifest_value_.get(), error) || 1476 !LoadLaunchContainer(manifest_value_.get(), error) ||
1465 !LoadLaunchFullscreen(manifest_value_.get(), error)) { 1477 !LoadLaunchFullscreen(manifest_value_.get(), error)) {
1466 return false; 1478 return false;
1467 } 1479 }
1468 1480
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1698 } else { 1710 } else {
1699 return false; 1711 return false;
1700 } 1712 }
1701 } else { 1713 } else {
1702 return true; 1714 return true;
1703 } 1715 }
1704 } 1716 }
1705 } 1717 }
1706 return false; 1718 return false;
1707 } 1719 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698