OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/change_picture_options_handle
r.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/change_picture_options_handle
r.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/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 if (!select_file_dialog_.get()) | 135 if (!select_file_dialog_.get()) |
136 select_file_dialog_ = SelectFileDialog::Create(this); | 136 select_file_dialog_ = SelectFileDialog::Create(this); |
137 | 137 |
138 FilePath downloads_path; | 138 FilePath downloads_path; |
139 if (!PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &downloads_path)) { | 139 if (!PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &downloads_path)) { |
140 NOTREACHED(); | 140 NOTREACHED(); |
141 return; | 141 return; |
142 } | 142 } |
143 | 143 |
144 // Static so we initialize it only once. | 144 // Static so we initialize it only once. |
145 static SelectFileDialog::FileTypeInfo file_type_info = | 145 CR_DEFINE_STATIC_LOCAL(SelectFileDialog::FileTypeInfo, file_type_info, |
146 GetUserImageFileTypeInfo(); | 146 (GetUserImageFileTypeInfo())); |
147 | 147 |
148 select_file_dialog_->SelectFile( | 148 select_file_dialog_->SelectFile( |
149 SelectFileDialog::SELECT_OPEN_FILE, | 149 SelectFileDialog::SELECT_OPEN_FILE, |
150 l10n_util::GetStringUTF16(IDS_DOWNLOAD_TITLE), | 150 l10n_util::GetStringUTF16(IDS_DOWNLOAD_TITLE), |
151 downloads_path, | 151 downloads_path, |
152 &file_type_info, | 152 &file_type_info, |
153 0, | 153 0, |
154 FILE_PATH_LITERAL(""), | 154 FILE_PATH_LITERAL(""), |
155 web_ui_->tab_contents(), | 155 web_ui_->tab_contents(), |
156 GetBrowserWindow(), | 156 GetBrowserWindow(), |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 326 |
327 gfx::NativeWindow ChangePictureOptionsHandler::GetBrowserWindow() const { | 327 gfx::NativeWindow ChangePictureOptionsHandler::GetBrowserWindow() const { |
328 Browser* browser = | 328 Browser* browser = |
329 BrowserList::FindBrowserWithProfile(Profile::FromWebUI(web_ui_)); | 329 BrowserList::FindBrowserWithProfile(Profile::FromWebUI(web_ui_)); |
330 if (!browser) | 330 if (!browser) |
331 return NULL; | 331 return NULL; |
332 return browser->window()->GetNativeHandle(); | 332 return browser->window()->GetNativeHandle(); |
333 } | 333 } |
334 | 334 |
335 } // namespace chromeos | 335 } // namespace chromeos |
OLD | NEW |