| 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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 #if defined(OS_WIN) || defined(OS_LINUX) | 936 #if defined(OS_WIN) || defined(OS_LINUX) |
| 937 void Browser::OpenFile() { | 937 void Browser::OpenFile() { |
| 938 UserMetrics::RecordAction(L"OpenFile", profile_); | 938 UserMetrics::RecordAction(L"OpenFile", profile_); |
| 939 if (!select_file_dialog_.get()) | 939 if (!select_file_dialog_.get()) |
| 940 select_file_dialog_ = SelectFileDialog::Create(this); | 940 select_file_dialog_ = SelectFileDialog::Create(this); |
| 941 | 941 |
| 942 // TODO(beng): figure out how to juggle this. | 942 // TODO(beng): figure out how to juggle this. |
| 943 gfx::NativeWindow parent_window = window_->GetNativeHandle(); | 943 gfx::NativeWindow parent_window = window_->GetNativeHandle(); |
| 944 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_OPEN_FILE, | 944 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_OPEN_FILE, |
| 945 std::wstring(), std::wstring(), | 945 std::wstring(), std::wstring(), |
| 946 std::wstring(), std::wstring(), | 946 std::wstring(), 0, std::wstring(), |
| 947 parent_window, NULL); | 947 parent_window, NULL); |
| 948 } | 948 } |
| 949 #endif | 949 #endif |
| 950 | 950 |
| 951 #if defined(OS_WIN) | 951 #if defined(OS_WIN) |
| 952 void Browser::OpenCreateShortcutsDialog() { | 952 void Browser::OpenCreateShortcutsDialog() { |
| 953 UserMetrics::RecordAction(L"CreateShortcut", profile_); | 953 UserMetrics::RecordAction(L"CreateShortcut", profile_); |
| 954 GetSelectedTabContents()->AsWebContents()->CreateShortcut(); | 954 GetSelectedTabContents()->AsWebContents()->CreateShortcut(); |
| 955 } | 955 } |
| 956 | 956 |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1921 window_->SetFocusToLocationBar(); | 1921 window_->SetFocusToLocationBar(); |
| 1922 } | 1922 } |
| 1923 | 1923 |
| 1924 void Browser::RenderWidgetShowing() { | 1924 void Browser::RenderWidgetShowing() { |
| 1925 window_->DisableInactiveFrame(); | 1925 window_->DisableInactiveFrame(); |
| 1926 } | 1926 } |
| 1927 | 1927 |
| 1928 /////////////////////////////////////////////////////////////////////////////// | 1928 /////////////////////////////////////////////////////////////////////////////// |
| 1929 // Browser, SelectFileDialog::Listener implementation: | 1929 // Browser, SelectFileDialog::Listener implementation: |
| 1930 | 1930 |
| 1931 void Browser::FileSelected(const std::wstring& path, void* params) { | 1931 void Browser::FileSelected(const std::wstring& path, int index, void* params) { |
| 1932 GURL file_url = net::FilePathToFileURL(path); | 1932 GURL file_url = net::FilePathToFileURL(path); |
| 1933 if (!file_url.is_empty()) | 1933 if (!file_url.is_empty()) |
| 1934 OpenURL(file_url, GURL(), CURRENT_TAB, PageTransition::TYPED); | 1934 OpenURL(file_url, GURL(), CURRENT_TAB, PageTransition::TYPED); |
| 1935 } | 1935 } |
| 1936 | 1936 |
| 1937 | 1937 |
| 1938 /////////////////////////////////////////////////////////////////////////////// | 1938 /////////////////////////////////////////////////////////////////////////////// |
| 1939 // Browser, NotificationObserver implementation: | 1939 // Browser, NotificationObserver implementation: |
| 1940 | 1940 |
| 1941 void Browser::Observe(NotificationType type, | 1941 void Browser::Observe(NotificationType type, |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2509 | 2509 |
| 2510 // We need to register the window position pref. | 2510 // We need to register the window position pref. |
| 2511 std::wstring window_pref(prefs::kBrowserWindowPlacement); | 2511 std::wstring window_pref(prefs::kBrowserWindowPlacement); |
| 2512 window_pref.append(L"_"); | 2512 window_pref.append(L"_"); |
| 2513 window_pref.append(app_name); | 2513 window_pref.append(app_name); |
| 2514 PrefService* prefs = g_browser_process->local_state(); | 2514 PrefService* prefs = g_browser_process->local_state(); |
| 2515 DCHECK(prefs); | 2515 DCHECK(prefs); |
| 2516 | 2516 |
| 2517 prefs->RegisterDictionaryPref(window_pref.c_str()); | 2517 prefs->RegisterDictionaryPref(window_pref.c_str()); |
| 2518 } | 2518 } |
| OLD | NEW |