| 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/gtk/browser_window_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1273 BubbleGtk::ARROW_LOCATION_TOP_LEFT, &rect); | 1273 BubbleGtk::ARROW_LOCATION_TOP_LEFT, &rect); |
| 1274 } | 1274 } |
| 1275 | 1275 |
| 1276 void BrowserWindowGtk::ShowAvatarBubbleFromAvatarButton() { | 1276 void BrowserWindowGtk::ShowAvatarBubbleFromAvatarButton() { |
| 1277 if (titlebar_->avatar_button()) | 1277 if (titlebar_->avatar_button()) |
| 1278 titlebar_->avatar_button()->ShowAvatarBubble(); | 1278 titlebar_->avatar_button()->ShowAvatarBubble(); |
| 1279 } | 1279 } |
| 1280 | 1280 |
| 1281 void BrowserWindowGtk::ShowPasswordGenerationBubble( | 1281 void BrowserWindowGtk::ShowPasswordGenerationBubble( |
| 1282 const gfx::Rect& rect, | 1282 const gfx::Rect& rect, |
| 1283 autofill::PasswordGenerator* password_generator, |
| 1283 const webkit::forms::PasswordForm& form) { | 1284 const webkit::forms::PasswordForm& form) { |
| 1284 WebContents* web_contents = browser_->GetSelectedWebContents(); | 1285 WebContents* web_contents = browser_->GetSelectedWebContents(); |
| 1285 if (!web_contents || !web_contents->GetContentNativeView()) { | 1286 if (!web_contents || !web_contents->GetContentNativeView()) { |
| 1286 return; | 1287 return; |
| 1287 } | 1288 } |
| 1288 | 1289 |
| 1289 TabContentsWrapper* tab_contents = | 1290 TabContentsWrapper* tab_contents = |
| 1290 TabContentsWrapper::GetCurrentWrapperForContents(web_contents); | 1291 TabContentsWrapper::GetCurrentWrapperForContents(web_contents); |
| 1291 if (!tab_contents) | 1292 if (!tab_contents) |
| 1292 return; | 1293 return; |
| 1293 | 1294 |
| 1294 new PasswordGenerationBubbleGtk(rect, | 1295 new PasswordGenerationBubbleGtk(rect, |
| 1295 form, | 1296 form, |
| 1296 web_contents->GetContentNativeView(), | 1297 web_contents->GetContentNativeView(), |
| 1297 browser()->profile(), | 1298 browser()->profile(), |
| 1298 web_contents->GetRenderViewHost(), | 1299 web_contents->GetRenderViewHost(), |
| 1300 password_generator, |
| 1299 tab_contents->password_manager()); | 1301 tab_contents->password_manager()); |
| 1300 } | 1302 } |
| 1301 | 1303 |
| 1302 void BrowserWindowGtk::ConfirmBrowserCloseWithPendingDownloads() { | 1304 void BrowserWindowGtk::ConfirmBrowserCloseWithPendingDownloads() { |
| 1303 DownloadInProgressDialogGtk::Show(browser(), GetNativeHandle()); | 1305 DownloadInProgressDialogGtk::Show(browser(), GetNativeHandle()); |
| 1304 } | 1306 } |
| 1305 | 1307 |
| 1306 void BrowserWindowGtk::Observe(int type, | 1308 void BrowserWindowGtk::Observe(int type, |
| 1307 const content::NotificationSource& source, | 1309 const content::NotificationSource& source, |
| 1308 const content::NotificationDetails& details) { | 1310 const content::NotificationDetails& details) { |
| (...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2598 wm_type == ui::WM_OPENBOX || | 2600 wm_type == ui::WM_OPENBOX || |
| 2599 wm_type == ui::WM_XFWM4); | 2601 wm_type == ui::WM_XFWM4); |
| 2600 } | 2602 } |
| 2601 | 2603 |
| 2602 // static | 2604 // static |
| 2603 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2605 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| 2604 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2606 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
| 2605 browser_window_gtk->Init(); | 2607 browser_window_gtk->Init(); |
| 2606 return browser_window_gtk; | 2608 return browser_window_gtk; |
| 2607 } | 2609 } |
| OLD | NEW |