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

Side by Side Diff: chrome/browser/ui/chrome_pages.cc

Issue 484033003: Open embedded extension options from the extension action context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix some bugs 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
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/chrome_pages.h" 5 #include "chrome/browser/ui/chrome_pages.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 if (!extension_to_highlight.empty()) { 153 if (!extension_to_highlight.empty()) {
154 GURL::Replacements replacements; 154 GURL::Replacements replacements;
155 std::string query("id="); 155 std::string query("id=");
156 query += extension_to_highlight; 156 query += extension_to_highlight;
157 replacements.SetQueryStr(query); 157 replacements.SetQueryStr(query);
158 params.url = params.url.ReplaceComponents(replacements); 158 params.url = params.url.ReplaceComponents(replacements);
159 } 159 }
160 ShowSingletonTabOverwritingNTP(browser, params); 160 ShowSingletonTabOverwritingNTP(browser, params);
161 } 161 }
162 162
163 void ShowExtensionOptions(Browser* browser,
164 const std::string& extension_id) {
165 NavigateParams params(
166 GetSingletonTabNavigateParams(browser, GURL(kChromeUIExtensionsURL)));
167 params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE;
168 if (!extension_id.empty()) {
169 GURL::Replacements replacements;
170 std::string query("options=");
171 query += extension_id;
172 replacements.SetQueryStr(query);
173 params.url = params.url.ReplaceComponents(replacements);
174 }
175 ShowSingletonTabOverwritingNTP(browser, params);
176 }
177
163 void ShowConflicts(Browser* browser) { 178 void ShowConflicts(Browser* browser) {
164 #if defined(OS_WIN) 179 #if defined(OS_WIN)
165 EnumerateModulesModel* model = EnumerateModulesModel::GetInstance(); 180 EnumerateModulesModel* model = EnumerateModulesModel::GetInstance();
166 if (model->modules_to_notify_about() > 0) { 181 if (model->modules_to_notify_about() > 0) {
167 GURL help_center_url = model->GetFirstNotableConflict(); 182 GURL help_center_url = model->GetFirstNotableConflict();
168 if (help_center_url.is_valid()) { 183 if (help_center_url.is_valid()) {
169 ShowSingletonTab(browser, help_center_url); 184 ShowSingletonTab(browser, help_center_url);
170 model->AcknowledgeConflictNotification(); 185 model->AcknowledgeConflictNotification();
171 return; 186 return;
172 } 187 }
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 original_profile, chrome::HOST_DESKTOP_TYPE_NATIVE)); 338 original_profile, chrome::HOST_DESKTOP_TYPE_NATIVE));
324 browser = displayer->browser(); 339 browser = displayer->browser();
325 } 340 }
326 341
327 NavigateToSingletonTab(browser, GURL(signin::GetPromoURL(source, false))); 342 NavigateToSingletonTab(browser, GURL(signin::GetPromoURL(source, false)));
328 DCHECK_GT(browser->tab_strip_model()->count(), 0); 343 DCHECK_GT(browser->tab_strip_model()->count(), 0);
329 } 344 }
330 } 345 }
331 346
332 } // namespace chrome 347 } // namespace chrome
OLDNEW
« chrome/browser/extensions/extension_context_menu_model.cc ('K') | « chrome/browser/ui/chrome_pages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698