| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/idle_timer.h" | 8 #include "base/idle_timer.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 GetSelectedTabContents()->AsWebContents()->render_view_host()-> | 943 GetSelectedTabContents()->AsWebContents()->render_view_host()-> |
| 944 ShowJavaScriptConsole(); | 944 ShowJavaScriptConsole(); |
| 945 } | 945 } |
| 946 | 946 |
| 947 void Browser::OpenTaskManager() { | 947 void Browser::OpenTaskManager() { |
| 948 UserMetrics::RecordAction(L"TaskManager", profile_); | 948 UserMetrics::RecordAction(L"TaskManager", profile_); |
| 949 TaskManager::Open(); | 949 TaskManager::Open(); |
| 950 } | 950 } |
| 951 | 951 |
| 952 void Browser::OpenSelectProfileDialog() { | 952 void Browser::OpenSelectProfileDialog() { |
| 953 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 954 if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) |
| 955 return; |
| 953 UserMetrics::RecordAction(L"SelectProfile", profile_); | 956 UserMetrics::RecordAction(L"SelectProfile", profile_); |
| 954 window_->ShowSelectProfileDialog(); | 957 window_->ShowSelectProfileDialog(); |
| 955 } | 958 } |
| 956 | 959 |
| 957 void Browser::OpenNewProfileDialog() { | 960 void Browser::OpenNewProfileDialog() { |
| 958 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 961 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 959 if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) | 962 if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) |
| 960 return; | 963 return; |
| 961 UserMetrics::RecordAction(L"CreateProfile", profile_); | 964 UserMetrics::RecordAction(L"CreateProfile", profile_); |
| 962 window_->ShowNewProfileDialog(); | 965 window_->ShowNewProfileDialog(); |
| (...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2448 | 2451 |
| 2449 // We need to register the window position pref. | 2452 // We need to register the window position pref. |
| 2450 std::wstring window_pref(prefs::kBrowserWindowPlacement); | 2453 std::wstring window_pref(prefs::kBrowserWindowPlacement); |
| 2451 window_pref.append(L"_"); | 2454 window_pref.append(L"_"); |
| 2452 window_pref.append(app_name); | 2455 window_pref.append(app_name); |
| 2453 PrefService* prefs = g_browser_process->local_state(); | 2456 PrefService* prefs = g_browser_process->local_state(); |
| 2454 DCHECK(prefs); | 2457 DCHECK(prefs); |
| 2455 | 2458 |
| 2456 prefs->RegisterDictionaryPref(window_pref.c_str()); | 2459 prefs->RegisterDictionaryPref(window_pref.c_str()); |
| 2457 } | 2460 } |
| OLD | NEW |