| 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 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 GetSelectedTabContents()->AsWebContents()->render_view_host()-> | 947 GetSelectedTabContents()->AsWebContents()->render_view_host()-> |
| 948 ShowJavaScriptConsole(); | 948 ShowJavaScriptConsole(); |
| 949 } | 949 } |
| 950 | 950 |
| 951 void Browser::OpenTaskManager() { | 951 void Browser::OpenTaskManager() { |
| 952 UserMetrics::RecordAction(L"TaskManager", profile_); | 952 UserMetrics::RecordAction(L"TaskManager", profile_); |
| 953 TaskManager::Open(); | 953 TaskManager::Open(); |
| 954 } | 954 } |
| 955 | 955 |
| 956 void Browser::OpenSelectProfileDialog() { | 956 void Browser::OpenSelectProfileDialog() { |
| 957 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 958 if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) |
| 959 return; |
| 957 UserMetrics::RecordAction(L"SelectProfile", profile_); | 960 UserMetrics::RecordAction(L"SelectProfile", profile_); |
| 958 window_->ShowSelectProfileDialog(); | 961 window_->ShowSelectProfileDialog(); |
| 959 } | 962 } |
| 960 | 963 |
| 961 void Browser::OpenNewProfileDialog() { | 964 void Browser::OpenNewProfileDialog() { |
| 962 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 965 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 963 if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) | 966 if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) |
| 964 return; | 967 return; |
| 965 UserMetrics::RecordAction(L"CreateProfile", profile_); | 968 UserMetrics::RecordAction(L"CreateProfile", profile_); |
| 966 window_->ShowNewProfileDialog(); | 969 window_->ShowNewProfileDialog(); |
| (...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2458 | 2461 |
| 2459 // We need to register the window position pref. | 2462 // We need to register the window position pref. |
| 2460 std::wstring window_pref(prefs::kBrowserWindowPlacement); | 2463 std::wstring window_pref(prefs::kBrowserWindowPlacement); |
| 2461 window_pref.append(L"_"); | 2464 window_pref.append(L"_"); |
| 2462 window_pref.append(app_name); | 2465 window_pref.append(app_name); |
| 2463 PrefService* prefs = g_browser_process->local_state(); | 2466 PrefService* prefs = g_browser_process->local_state(); |
| 2464 DCHECK(prefs); | 2467 DCHECK(prefs); |
| 2465 | 2468 |
| 2466 prefs->RegisterDictionaryPref(window_pref.c_str()); | 2469 prefs->RegisterDictionaryPref(window_pref.c_str()); |
| 2467 } | 2470 } |
| OLD | NEW |