OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/autofill/autofill_dialog.h" | 5 #include "chrome/browser/autofill/autofill_dialog.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
359 } | 359 } |
360 gboolean is_header; | 360 gboolean is_header; |
361 gboolean is_separator; | 361 gboolean is_separator; |
362 gtk_tree_model_get(model, &iter, COL_IS_HEADER, &is_header, | 362 gtk_tree_model_get(model, &iter, COL_IS_HEADER, &is_header, |
363 COL_IS_SEPARATOR, &is_separator, -1); | 363 COL_IS_SEPARATOR, &is_separator, -1); |
364 return !is_header && !is_separator; | 364 return !is_header && !is_separator; |
365 } | 365 } |
366 | 366 |
367 void AutoFillDialog::OnLinkActivated() { | 367 void AutoFillDialog::OnLinkActivated() { |
368 Browser* browser = BrowserList::GetLastActive(); | 368 Browser* browser = BrowserList::GetLastActive(); |
369 browser->OpenURL(GURL(kAutoFillLearnMoreUrl), GURL(), NEW_FOREGROUND_TAB, | 369 if (!browser || !browser->GetSelectedTabContents()) |
James Hawkins
2010/10/09 00:22:52
You DCHECK in the InfoBar code, yet check for |bro
dhollowa
2010/10/09 00:32:07
Yes. I believe so.
James Hawkins
2010/10/09 00:47:36
Under what circumstances?
dhollowa
2010/10/09 01:08:21
[Associating reply... got move to top-level someho
| |
370 PageTransition::TYPED); | 370 browser = Browser::Create(profile_); |
371 browser->OpenAutoFillHelpTabAndActivate(); | |
371 } | 372 } |
372 | 373 |
373 void AutoFillDialog::LoadAutoFillData() { | 374 void AutoFillDialog::LoadAutoFillData() { |
374 if (!personal_data_->IsDataLoaded()) { | 375 if (!personal_data_->IsDataLoaded()) { |
375 UpdateWidgetState(); | 376 UpdateWidgetState(); |
376 return; | 377 return; |
377 } | 378 } |
378 | 379 |
379 // Rebuild the underlying store. | 380 // Rebuild the underlying store. |
380 gtk_list_store_clear(list_store_); | 381 gtk_list_store_clear(list_store_); |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
659 | 660 |
660 void ShowAutoFillDialog(gfx::NativeView parent, | 661 void ShowAutoFillDialog(gfx::NativeView parent, |
661 AutoFillDialogObserver* observer, | 662 AutoFillDialogObserver* observer, |
662 Profile* profile) { | 663 Profile* profile) { |
663 DCHECK(profile); | 664 DCHECK(profile); |
664 | 665 |
665 if (!dialog) | 666 if (!dialog) |
666 dialog = new AutoFillDialog(profile, observer); | 667 dialog = new AutoFillDialog(profile, observer); |
667 dialog->Show(); | 668 dialog->Show(); |
668 } | 669 } |
OLD | NEW |