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

Side by Side Diff: chrome/browser/views/frame/browser_view.cc

Issue 212051: Download in progress dialog:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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
« no previous file with comments | « chrome/browser/gtk/download_in_progress_dialog_gtk.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/views/frame/browser_view.h" 5 #include "chrome/browser/views/frame/browser_view.h"
6 6
7 #include "app/drag_drop_types.h" 7 #include "app/drag_drop_types.h"
8 #include "app/gfx/canvas.h" 8 #include "app/gfx/canvas.h"
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/os_exchange_data.h" 10 #include "app/os_exchange_data.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 DISALLOW_COPY_AND_ASSIGN(ResizeCorner); 245 DISALLOW_COPY_AND_ASSIGN(ResizeCorner);
246 }; 246 };
247 247
248 //////////////////////////////////////////////////////////////////////////////// 248 ////////////////////////////////////////////////////////////////////////////////
249 // DownloadInProgressConfirmDialogDelegate 249 // DownloadInProgressConfirmDialogDelegate
250 250
251 class DownloadInProgressConfirmDialogDelegate : public views::DialogDelegate, 251 class DownloadInProgressConfirmDialogDelegate : public views::DialogDelegate,
252 public views::View { 252 public views::View {
253 public: 253 public:
254 explicit DownloadInProgressConfirmDialogDelegate(Browser* browser) 254 explicit DownloadInProgressConfirmDialogDelegate(Browser* browser)
255 : browser_(browser) { 255 : browser_(browser),
256 product_name_(l10n_util::GetString(IDS_PRODUCT_NAME)) {
256 int download_count = browser->profile()->GetDownloadManager()-> 257 int download_count = browser->profile()->GetDownloadManager()->
257 in_progress_count(); 258 in_progress_count();
258 259
259 std::wstring warning_text; 260 std::wstring warning_text;
260 std::wstring explanation_text; 261 std::wstring explanation_text;
261 if (download_count == 1) { 262 if (download_count == 1) {
262 warning_text = 263 warning_text =
263 l10n_util::GetString(IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_WARNING); 264 l10n_util::GetStringF(IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_WARNING,
265 product_name_);
264 explanation_text = 266 explanation_text =
265 l10n_util::GetString(IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_EXPLANATION); 267 l10n_util::GetStringF(IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_EXPLANATION,
268 product_name_);
266 ok_button_text_ = l10n_util::GetString( 269 ok_button_text_ = l10n_util::GetString(
267 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_OK_BUTTON_LABEL); 270 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_OK_BUTTON_LABEL);
268 cancel_button_text_ = l10n_util::GetString( 271 cancel_button_text_ = l10n_util::GetString(
269 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL); 272 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL);
270 } else { 273 } else {
271 warning_text = 274 warning_text =
272 l10n_util::GetStringF(IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_WARNING, 275 l10n_util::GetStringF(IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_WARNING,
273 download_count); 276 product_name_, IntToString16(download_count));
274 explanation_text = 277 explanation_text =
275 l10n_util::GetString( 278 l10n_util::GetStringF(
276 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_EXPLANATION); 279 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_EXPLANATION, product_name_);
277 ok_button_text_ = l10n_util::GetString( 280 ok_button_text_ = l10n_util::GetString(
278 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_OK_BUTTON_LABEL); 281 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_OK_BUTTON_LABEL);
279 cancel_button_text_ = l10n_util::GetString( 282 cancel_button_text_ = l10n_util::GetString(
280 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL); 283 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL);
281 } 284 }
282 285
283 // There are two lines of text: the bold warning label and the text 286 // There are two lines of text: the bold warning label and the text
284 // explanation label. 287 // explanation label.
285 GridLayout* layout = new GridLayout(this); 288 GridLayout* layout = new GridLayout(this);
286 SetLayoutManager(layout); 289 SetLayoutManager(layout);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 } 346 }
344 347
345 // WindowDelegate implementation: 348 // WindowDelegate implementation:
346 virtual bool IsModal() const { return true; } 349 virtual bool IsModal() const { return true; }
347 350
348 virtual views::View* GetContentsView() { 351 virtual views::View* GetContentsView() {
349 return this; 352 return this;
350 } 353 }
351 354
352 virtual std::wstring GetWindowTitle() const { 355 virtual std::wstring GetWindowTitle() const {
353 return l10n_util::GetString(IDS_PRODUCT_NAME); 356 return product_name_;
354 } 357 }
355 358
356 private: 359 private:
357 Browser* browser_; 360 Browser* browser_;
358 views::Label* warning_; 361 views::Label* warning_;
359 views::Label* explanation_; 362 views::Label* explanation_;
360 363
361 std::wstring ok_button_text_; 364 std::wstring ok_button_text_;
362 std::wstring cancel_button_text_; 365 std::wstring cancel_button_text_;
363 366
367 std::wstring product_name_;
368
364 DISALLOW_COPY_AND_ASSIGN(DownloadInProgressConfirmDialogDelegate); 369 DISALLOW_COPY_AND_ASSIGN(DownloadInProgressConfirmDialogDelegate);
365 }; 370 };
366 371
367 /////////////////////////////////////////////////////////////////////////////// 372 ///////////////////////////////////////////////////////////////////////////////
368 // BrowserView, public: 373 // BrowserView, public:
369 374
370 // static 375 // static
371 void BrowserView::SetShowState(int state) { 376 void BrowserView::SetShowState(int state) {
372 explicit_show_state = state; 377 explicit_show_state = state;
373 } 378 }
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after
2163 2168
2164 // static 2169 // static
2165 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2170 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2166 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2171 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2167 } 2172 }
2168 2173
2169 // static 2174 // static
2170 void BrowserList::AllBrowsersClosed() { 2175 void BrowserList::AllBrowsersClosed() {
2171 views::Window::CloseAllSecondaryWindows(); 2176 views::Window::CloseAllSecondaryWindows();
2172 } 2177 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/download_in_progress_dialog_gtk.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698