| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 explicit DownloadInProgressConfirmDialogDelegate(Browser* browser) | 202 explicit DownloadInProgressConfirmDialogDelegate(Browser* browser) |
| 203 : browser_(browser) { | 203 : browser_(browser) { |
| 204 int download_count = browser->profile()->GetDownloadManager()-> | 204 int download_count = browser->profile()->GetDownloadManager()-> |
| 205 in_progress_count(); | 205 in_progress_count(); |
| 206 label_ = new views::Label(l10n_util::GetStringF( | 206 label_ = new views::Label(l10n_util::GetStringF( |
| 207 IDS_DOWNLOAD_REMOVE_CONFIRM_TITLE, download_count)); | 207 IDS_DOWNLOAD_REMOVE_CONFIRM_TITLE, download_count)); |
| 208 label_->SetMultiLine(true); | 208 label_->SetMultiLine(true); |
| 209 label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 209 label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
| 210 label_->set_border(views::Border::CreateEmptyBorder(10, 10, 10, 10)); | 210 label_->set_border(views::Border::CreateEmptyBorder(10, 10, 10, 10)); |
| 211 AddChildView(label_); | 211 AddChildView(label_); |
| 212 SetParentOwned(false); | |
| 213 SetLayoutManager(new views::FillLayout()); | 212 SetLayoutManager(new views::FillLayout()); |
| 214 } | 213 } |
| 214 |
| 215 ~DownloadInProgressConfirmDialogDelegate() { |
| 216 } |
| 215 | 217 |
| 216 // View implementation: | 218 // View implementation: |
| 217 virtual gfx::Size GetPreferredSize() { | 219 virtual gfx::Size GetPreferredSize() { |
| 218 const int kContentWidth = 400; | 220 const int kContentWidth = 400; |
| 219 return gfx::Size(kContentWidth, label_->GetHeightForWidth(kContentWidth)); | 221 return gfx::Size(kContentWidth, label_->GetHeightForWidth(kContentWidth)); |
| 220 } | 222 } |
| 221 | 223 |
| 222 // DialogDelegate implementation: | 224 // DialogDelegate implementation: |
| 223 virtual int GetDefaultDialogButton() const { | 225 virtual int GetDefaultDialogButton() const { |
| 224 return DIALOGBUTTON_CANCEL; | 226 return DIALOGBUTTON_CANCEL; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 236 virtual bool Accept() { | 238 virtual bool Accept() { |
| 237 browser_->InProgressDownloadResponse(true); | 239 browser_->InProgressDownloadResponse(true); |
| 238 return true; | 240 return true; |
| 239 } | 241 } |
| 240 | 242 |
| 241 virtual bool Cancel() { | 243 virtual bool Cancel() { |
| 242 browser_->InProgressDownloadResponse(false); | 244 browser_->InProgressDownloadResponse(false); |
| 243 return true; | 245 return true; |
| 244 } | 246 } |
| 245 | 247 |
| 246 virtual void DeleteDelegate() { | |
| 247 delete this; | |
| 248 } | |
| 249 | |
| 250 // WindowDelegate implementation: | 248 // WindowDelegate implementation: |
| 251 virtual bool IsModal() const { return true; } | 249 virtual bool IsModal() const { return true; } |
| 252 | 250 |
| 253 virtual views::View* GetContentsView() { | 251 virtual views::View* GetContentsView() { |
| 254 return this; | 252 return this; |
| 255 } | 253 } |
| 256 | 254 |
| 257 private: | 255 private: |
| 258 Browser* browser_; | 256 Browser* browser_; |
| 259 views::Label* label_; | 257 views::Label* label_; |
| (...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1683 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 1681 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| 1684 BrowserView* browser_view = new BrowserView(browser); | 1682 BrowserView* browser_view = new BrowserView(browser); |
| 1685 (new BrowserFrame(browser_view))->Init(); | 1683 (new BrowserFrame(browser_view))->Init(); |
| 1686 return browser_view; | 1684 return browser_view; |
| 1687 } | 1685 } |
| 1688 | 1686 |
| 1689 // static | 1687 // static |
| 1690 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { | 1688 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { |
| 1691 return new FindBarWin(static_cast<BrowserView*>(browser->window())); | 1689 return new FindBarWin(static_cast<BrowserView*>(browser->window())); |
| 1692 } | 1690 } |
| OLD | NEW |