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

Unified Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 7983005: Fix the issue on extension API that extension ID should be converted to app name when it is passe... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_tabs_module.cc
===================================================================
--- chrome/browser/extensions/extension_tabs_module.cc (revision 101597)
+++ chrome/browser/extensions/extension_tabs_module.cc (working copy)
@@ -30,6 +30,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/window_sizer.h"
+#include "chrome/browser/web_applications/web_app.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
@@ -495,7 +496,7 @@
Profile* window_profile = profile();
Browser::Type window_type = Browser::TYPE_TABBED;
bool focused = true;
- std::string app_name;
+ std::string extension_id;
if (args) {
// Any part of the bounds can optionally be set by the caller.
@@ -556,12 +557,12 @@
&type_str));
if (type_str == keys::kWindowTypeValuePopup) {
window_type = Browser::TYPE_POPUP;
- app_name = GetExtension()->id();
+ extension_id = GetExtension()->id();
} else if (type_str == keys::kWindowTypeValuePanel) {
if (GetExtension()->HasAPIPermission(
ExtensionAPIPermission::kExperimental)) {
window_type = Browser::TYPE_PANEL;
- app_name = GetExtension()->id();
+ extension_id = GetExtension()->id();
} else {
error_ = errors::kExperimentalFeature;
return false;
@@ -573,12 +574,13 @@
}
Browser* new_window;
- if (app_name.empty()) {
+ if (extension_id.empty()) {
new_window = Browser::CreateForType(window_type, window_profile);
new_window->window()->SetBounds(window_bounds);
} else {
new_window = Browser::CreateForApp(
- window_type, app_name,
+ window_type,
+ web_app::GenerateApplicationNameFromExtensionId(extension_id),
(window_type == Browser::TYPE_PANEL ? panel_bounds : popup_bounds),
window_profile);
}
« 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