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(const gfx::Rect& rect, |
| 1294 int max_length) { |
1294 WebContents* web_contents = browser_->GetSelectedWebContents(); | 1295 WebContents* web_contents = browser_->GetSelectedWebContents(); |
1295 if (!web_contents || !web_contents->GetContentNativeView()) { | 1296 if (!web_contents || !web_contents->GetContentNativeView()) { |
1296 return; | 1297 return; |
1297 } | 1298 } |
1298 | 1299 |
1299 new PasswordGenerationBubbleGtk(rect, | 1300 new PasswordGenerationBubbleGtk(rect, |
| 1301 max_length, |
1300 web_contents->GetContentNativeView(), | 1302 web_contents->GetContentNativeView(), |
1301 browser()->profile(), | 1303 browser()->profile(), |
1302 web_contents->GetRenderViewHost()); | 1304 web_contents->GetRenderViewHost()); |
1303 } | 1305 } |
1304 | 1306 |
1305 void BrowserWindowGtk::ConfirmBrowserCloseWithPendingDownloads() { | 1307 void BrowserWindowGtk::ConfirmBrowserCloseWithPendingDownloads() { |
1306 DownloadInProgressDialogGtk::Show(browser(), GetNativeHandle()); | 1308 DownloadInProgressDialogGtk::Show(browser(), GetNativeHandle()); |
1307 } | 1309 } |
1308 | 1310 |
1309 void BrowserWindowGtk::Observe(int type, | 1311 void BrowserWindowGtk::Observe(int type, |
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2601 wm_type == ui::WM_OPENBOX || | 2603 wm_type == ui::WM_OPENBOX || |
2602 wm_type == ui::WM_XFWM4); | 2604 wm_type == ui::WM_XFWM4); |
2603 } | 2605 } |
2604 | 2606 |
2605 // static | 2607 // static |
2606 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2608 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
2607 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2609 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
2608 browser_window_gtk->Init(); | 2610 browser_window_gtk->Init(); |
2609 return browser_window_gtk; | 2611 return browser_window_gtk; |
2610 } | 2612 } |
OLD | NEW |