| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 } | 594 } |
| 595 | 595 |
| 596 void BrowserView::FlashFrame(bool flash) { | 596 void BrowserView::FlashFrame(bool flash) { |
| 597 frame_->FlashFrame(flash); | 597 frame_->FlashFrame(flash); |
| 598 } | 598 } |
| 599 | 599 |
| 600 bool BrowserView::IsAlwaysOnTop() const { | 600 bool BrowserView::IsAlwaysOnTop() const { |
| 601 return false; | 601 return false; |
| 602 } | 602 } |
| 603 | 603 |
| 604 gfx::NativeWindow BrowserView::GetNativeHandle() { | 604 gfx::NativeWindow BrowserView::GetNativeWindow() { |
| 605 return GetWidget()->GetTopLevelWidget()->GetNativeWindow(); | 605 return GetWidget()->GetTopLevelWidget()->GetNativeWindow(); |
| 606 } | 606 } |
| 607 | 607 |
| 608 BrowserWindowTesting* BrowserView::GetBrowserWindowTesting() { | 608 BrowserWindowTesting* BrowserView::GetBrowserWindowTesting() { |
| 609 return this; | 609 return this; |
| 610 } | 610 } |
| 611 | 611 |
| 612 StatusBubble* BrowserView::GetStatusBubble() { | 612 StatusBubble* BrowserView::GetStatusBubble() { |
| 613 return status_bubble_.get(); | 613 return status_bubble_.get(); |
| 614 } | 614 } |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 | 1101 |
| 1102 DownloadShelf* BrowserView::GetDownloadShelf() { | 1102 DownloadShelf* BrowserView::GetDownloadShelf() { |
| 1103 if (!download_shelf_.get()) { | 1103 if (!download_shelf_.get()) { |
| 1104 download_shelf_.reset(new DownloadShelfView(browser_.get(), this)); | 1104 download_shelf_.reset(new DownloadShelfView(browser_.get(), this)); |
| 1105 download_shelf_->set_owned_by_client(); | 1105 download_shelf_->set_owned_by_client(); |
| 1106 } | 1106 } |
| 1107 return download_shelf_.get(); | 1107 return download_shelf_.get(); |
| 1108 } | 1108 } |
| 1109 | 1109 |
| 1110 void BrowserView::ConfirmBrowserCloseWithPendingDownloads() { | 1110 void BrowserView::ConfirmBrowserCloseWithPendingDownloads() { |
| 1111 DownloadInProgressDialogView::Show(browser_.get(), GetNativeHandle()); | 1111 DownloadInProgressDialogView::Show(browser_.get(), GetNativeWindow()); |
| 1112 } | 1112 } |
| 1113 | 1113 |
| 1114 void BrowserView::ShowCreateWebAppShortcutsDialog( | 1114 void BrowserView::ShowCreateWebAppShortcutsDialog( |
| 1115 TabContentsWrapper* tab_contents) { | 1115 TabContentsWrapper* tab_contents) { |
| 1116 browser::ShowCreateWebAppShortcutsDialog(GetNativeHandle(), tab_contents); | 1116 browser::ShowCreateWebAppShortcutsDialog(GetNativeWindow(), tab_contents); |
| 1117 } | 1117 } |
| 1118 | 1118 |
| 1119 void BrowserView::ShowCreateChromeAppShortcutsDialog( | 1119 void BrowserView::ShowCreateChromeAppShortcutsDialog( |
| 1120 Profile* profile, | 1120 Profile* profile, |
| 1121 const extensions::Extension* app) { | 1121 const extensions::Extension* app) { |
| 1122 browser::ShowCreateChromeAppShortcutsDialog(GetNativeHandle(), profile, app); | 1122 browser::ShowCreateChromeAppShortcutsDialog(GetNativeWindow(), profile, app); |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 void BrowserView::UserChangedTheme() { | 1125 void BrowserView::UserChangedTheme() { |
| 1126 frame_->FrameTypeChanged(); | 1126 frame_->FrameTypeChanged(); |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 int BrowserView::GetExtraRenderViewHeight() const { | 1129 int BrowserView::GetExtraRenderViewHeight() const { |
| 1130 // Currently this is only used on linux. | 1130 // Currently this is only used on linux. |
| 1131 return 0; | 1131 return 0; |
| 1132 } | 1132 } |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 // TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always | 1240 // TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always |
| 1241 // enabled in the page menu regardless of whether the command will do | 1241 // enabled in the page menu regardless of whether the command will do |
| 1242 // anything. When someone selects the menu item, we just act as if they hit | 1242 // anything. When someone selects the menu item, we just act as if they hit |
| 1243 // the keyboard shortcut for the command by sending the associated key press | 1243 // the keyboard shortcut for the command by sending the associated key press |
| 1244 // to windows. The real fix to this bug is to disable the commands when they | 1244 // to windows. The real fix to this bug is to disable the commands when they |
| 1245 // won't do anything. We'll need something like an overall clipboard command | 1245 // won't do anything. We'll need something like an overall clipboard command |
| 1246 // manager to do that. | 1246 // manager to do that. |
| 1247 void BrowserView::Cut() { | 1247 void BrowserView::Cut() { |
| 1248 ui_controls::SendKeyPress(GetNativeHandle(), ui::VKEY_X, | 1248 ui_controls::SendKeyPress(GetNativeWindow(), ui::VKEY_X, |
| 1249 true, false, false, false); | 1249 true, false, false, false); |
| 1250 } | 1250 } |
| 1251 | 1251 |
| 1252 void BrowserView::Copy() { | 1252 void BrowserView::Copy() { |
| 1253 ui_controls::SendKeyPress(GetNativeHandle(), ui::VKEY_C, | 1253 ui_controls::SendKeyPress(GetNativeWindow(), ui::VKEY_C, |
| 1254 true, false, false, false); | 1254 true, false, false, false); |
| 1255 } | 1255 } |
| 1256 | 1256 |
| 1257 void BrowserView::Paste() { | 1257 void BrowserView::Paste() { |
| 1258 ui_controls::SendKeyPress(GetNativeHandle(), ui::VKEY_V, | 1258 ui_controls::SendKeyPress(GetNativeWindow(), ui::VKEY_V, |
| 1259 true, false, false, false); | 1259 true, false, false, false); |
| 1260 } | 1260 } |
| 1261 | 1261 |
| 1262 void BrowserView::ShowInstant(TabContentsWrapper* preview) { | 1262 void BrowserView::ShowInstant(TabContentsWrapper* preview) { |
| 1263 if (!preview_container_) { | 1263 if (!preview_container_) { |
| 1264 preview_container_ = new views::WebView(browser_->profile()); | 1264 preview_container_ = new views::WebView(browser_->profile()); |
| 1265 preview_container_->set_id(VIEW_ID_TAB_CONTAINER); | 1265 preview_container_->set_id(VIEW_ID_TAB_CONTAINER); |
| 1266 } | 1266 } |
| 1267 contents_->SetPreview(preview_container_, preview->web_contents()); | 1267 contents_->SetPreview(preview_container_, preview->web_contents()); |
| 1268 preview_container_->SetWebContents(preview->web_contents()); | 1268 preview_container_->SetWebContents(preview->web_contents()); |
| (...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2426 this, | 2426 this, |
| 2427 web_contents->GetRenderViewHost(), | 2427 web_contents->GetRenderViewHost(), |
| 2428 password_generator, | 2428 password_generator, |
| 2429 browser_.get(), | 2429 browser_.get(), |
| 2430 wrapper->password_manager()); | 2430 wrapper->password_manager()); |
| 2431 | 2431 |
| 2432 views::BubbleDelegateView::CreateBubble(bubble); | 2432 views::BubbleDelegateView::CreateBubble(bubble); |
| 2433 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2433 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
| 2434 bubble->Show(); | 2434 bubble->Show(); |
| 2435 } | 2435 } |
| OLD | NEW |