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

Side by Side Diff: chrome/browser/ui/webui/options/manage_profile_handler.cc

Issue 10967003: Add desktop type context to most existing instances of FindTabbedBrowser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moving check_deps exception to specific_include_rules after chat with Kai. Created 8 years, 2 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
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/webui/options/manage_profile_handler.h" 5 #include "chrome/browser/ui/webui/options/manage_profile_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "base/value_conversions.h" 11 #include "base/value_conversions.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/prefs/pref_service.h" 14 #include "chrome/browser/prefs/pref_service.h"
15 #include "chrome/browser/profiles/gaia_info_update_service.h" 15 #include "chrome/browser/profiles/gaia_info_update_service.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/profiles/profile_info_cache.h" 17 #include "chrome/browser/profiles/profile_info_cache.h"
18 #include "chrome/browser/profiles/profile_info_util.h" 18 #include "chrome/browser/profiles/profile_info_util.h"
19 #include "chrome/browser/profiles/profile_manager.h" 19 #include "chrome/browser/profiles/profile_manager.h"
20 #include "chrome/browser/profiles/profile_metrics.h" 20 #include "chrome/browser/profiles/profile_metrics.h"
21 #include "chrome/browser/profiles/profile_shortcut_manager.h" 21 #include "chrome/browser/profiles/profile_shortcut_manager.h"
22 #include "chrome/browser/ui/browser_finder.h"
22 #include "chrome/browser/ui/webui/web_ui_util.h" 23 #include "chrome/browser/ui/webui/web_ui_util.h"
23 #include "chrome/common/chrome_notification_types.h" 24 #include "chrome/common/chrome_notification_types.h"
24 #include "chrome/common/pref_names.h" 25 #include "chrome/common/pref_names.h"
25 #include "content/public/browser/notification_service.h" 26 #include "content/public/browser/notification_service.h"
26 #include "content/public/browser/web_ui.h" 27 #include "content/public/browser/web_ui.h"
27 #include "grit/generated_resources.h" 28 #include "grit/generated_resources.h"
28 29
29 namespace options { 30 namespace options {
30 31
31 namespace { 32 namespace {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 return; 250 return;
250 251
251 ProfileMetrics::LogProfileDeleteUser(ProfileMetrics::PROFILE_DELETED); 252 ProfileMetrics::LogProfileDeleteUser(ProfileMetrics::PROFILE_DELETED);
252 253
253 const Value* file_path_value; 254 const Value* file_path_value;
254 FilePath profile_file_path; 255 FilePath profile_file_path;
255 if (!args->Get(0, &file_path_value) || 256 if (!args->Get(0, &file_path_value) ||
256 !base::GetValueAsFilePath(*file_path_value, &profile_file_path)) 257 !base::GetValueAsFilePath(*file_path_value, &profile_file_path))
257 return; 258 return;
258 259
260 Browser* browser =
261 browser::FindBrowserWithWebContents(web_ui()->GetWebContents());
262 chrome::HostDesktopType desktop_type = chrome::HOST_DESKTOP_TYPE_NATIVE;
263 if (browser)
264 desktop_type = browser->host_desktop_type();
265
259 g_browser_process->profile_manager()->ScheduleProfileForDeletion( 266 g_browser_process->profile_manager()->ScheduleProfileForDeletion(
260 profile_file_path); 267 profile_file_path, desktop_type);
261 } 268 }
262 269
263 void ManageProfileHandler::ProfileIconSelectionChanged( 270 void ManageProfileHandler::ProfileIconSelectionChanged(
264 const base::ListValue* args) { 271 const base::ListValue* args) {
265 DCHECK(args); 272 DCHECK(args);
266 273
267 const Value* file_path_value; 274 const Value* file_path_value;
268 FilePath file_path; 275 FilePath file_path;
269 if (!args->Get(0, &file_path_value) || 276 if (!args->Get(0, &file_path_value) ||
270 !base::GetValueAsFilePath(*file_path_value, &file_path)) { 277 !base::GetValueAsFilePath(*file_path_value, &file_path)) {
(...skipping 21 matching lines...) Expand all
292 string16 gaia_name = cache.GetGAIANameOfProfileAtIndex(i); 299 string16 gaia_name = cache.GetGAIANameOfProfileAtIndex(i);
293 if (gaia_name.empty()) 300 if (gaia_name.empty())
294 return; 301 return;
295 302
296 StringValue gaia_name_value(gaia_name); 303 StringValue gaia_name_value(gaia_name);
297 web_ui()->CallJavascriptFunction("ManageProfileOverlay.setProfileName", 304 web_ui()->CallJavascriptFunction("ManageProfileOverlay.setProfileName",
298 gaia_name_value); 305 gaia_name_value);
299 } 306 }
300 307
301 } // namespace options 308 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc ('k') | chrome/test/base/ui_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698