| 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 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 GtkWidget* widget = web_contents->GetContentNativeView(); | 1283 GtkWidget* widget = web_contents->GetContentNativeView(); |
| 1284 new AvatarMenuBubbleGtk(browser_.get(), widget, | 1284 new AvatarMenuBubbleGtk(browser_.get(), widget, |
| 1285 BubbleGtk::ARROW_LOCATION_TOP_LEFT, &rect); | 1285 BubbleGtk::ARROW_LOCATION_TOP_LEFT, &rect); |
| 1286 } | 1286 } |
| 1287 | 1287 |
| 1288 void BrowserWindowGtk::ShowAvatarBubbleFromAvatarButton() { | 1288 void BrowserWindowGtk::ShowAvatarBubbleFromAvatarButton() { |
| 1289 if (titlebar_->avatar_button()) | 1289 if (titlebar_->avatar_button()) |
| 1290 titlebar_->avatar_button()->ShowAvatarBubble(); | 1290 titlebar_->avatar_button()->ShowAvatarBubble(); |
| 1291 } | 1291 } |
| 1292 | 1292 |
| 1293 void BrowserWindowGtk::ShowPasswordGenerationBubble(const gfx::Rect& rect) { | 1293 void BrowserWindowGtk::ShowPasswordGenerationBubble( |
| 1294 const gfx::Rect& rect, |
| 1295 autofill::PasswordGenerator* password_generator) { |
| 1294 WebContents* web_contents = browser_->GetSelectedWebContents(); | 1296 WebContents* web_contents = browser_->GetSelectedWebContents(); |
| 1295 if (!web_contents || !web_contents->GetContentNativeView()) { | 1297 if (!web_contents || !web_contents->GetContentNativeView()) { |
| 1296 return; | 1298 return; |
| 1297 } | 1299 } |
| 1298 | 1300 |
| 1299 new PasswordGenerationBubbleGtk(rect, | 1301 new PasswordGenerationBubbleGtk(rect, |
| 1300 web_contents->GetContentNativeView(), | 1302 web_contents->GetContentNativeView(), |
| 1301 browser()->profile(), | 1303 browser()->profile(), |
| 1302 web_contents->GetRenderViewHost()); | 1304 web_contents->GetRenderViewHost(), |
| 1305 password_generator); |
| 1303 } | 1306 } |
| 1304 | 1307 |
| 1305 void BrowserWindowGtk::ConfirmBrowserCloseWithPendingDownloads() { | 1308 void BrowserWindowGtk::ConfirmBrowserCloseWithPendingDownloads() { |
| 1306 DownloadInProgressDialogGtk::Show(browser(), GetNativeHandle()); | 1309 DownloadInProgressDialogGtk::Show(browser(), GetNativeHandle()); |
| 1307 } | 1310 } |
| 1308 | 1311 |
| 1309 void BrowserWindowGtk::Observe(int type, | 1312 void BrowserWindowGtk::Observe(int type, |
| 1310 const content::NotificationSource& source, | 1313 const content::NotificationSource& source, |
| 1311 const content::NotificationDetails& details) { | 1314 const content::NotificationDetails& details) { |
| 1312 switch (type) { | 1315 switch (type) { |
| (...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2601 wm_type == ui::WM_OPENBOX || | 2604 wm_type == ui::WM_OPENBOX || |
| 2602 wm_type == ui::WM_XFWM4); | 2605 wm_type == ui::WM_XFWM4); |
| 2603 } | 2606 } |
| 2604 | 2607 |
| 2605 // static | 2608 // static |
| 2606 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2609 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| 2607 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2610 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
| 2608 browser_window_gtk->Init(); | 2611 browser_window_gtk->Init(); |
| 2609 return browser_window_gtk; | 2612 return browser_window_gtk; |
| 2610 } | 2613 } |
| OLD | NEW |