Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: chrome/browser/browser.cc

Issue 114017: Use Chrome facilities for omnibox state save and restore on Mac. (Closed)
Patch Set: Wordsmithing. Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/browser.h" 5 #include "chrome/browser/browser.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/idle_timer.h" 9 #include "base/idle_timer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 TabContents* new_contents, 1579 TabContents* new_contents,
1580 int index, 1580 int index,
1581 bool user_gesture) { 1581 bool user_gesture) {
1582 DCHECK(old_contents != new_contents); 1582 DCHECK(old_contents != new_contents);
1583 1583
1584 // If we have any update pending, do it now. 1584 // If we have any update pending, do it now.
1585 if (!chrome_updater_factory_.empty() && old_contents) 1585 if (!chrome_updater_factory_.empty() && old_contents)
1586 ProcessPendingUIUpdates(); 1586 ProcessPendingUIUpdates();
1587 1587
1588 if (old_contents) { 1588 if (old_contents) {
1589 #if defined(OS_WIN)
1590 // Save what the user's currently typing, so it can be restored when we 1589 // Save what the user's currently typing, so it can be restored when we
1591 // switch back to this tab. 1590 // switch back to this tab.
1592 window_->GetLocationBar()->SaveStateToContents(old_contents); 1591 window_->GetLocationBar()->SaveStateToContents(old_contents);
1593 #else
1594 NOTIMPLEMENTED();
1595 #endif
1596 } 1592 }
1597 1593
1598 // Propagate the profile to the location bar. 1594 // Propagate the profile to the location bar.
1599 UpdateToolbar(true); 1595 UpdateToolbar(true);
1600 1596
1601 // Update stop/go state. 1597 // Update stop/go state.
1602 UpdateStopGoState(new_contents->is_loading(), true); 1598 UpdateStopGoState(new_contents->is_loading(), true);
1603 1599
1604 // Update commands to reflect current state. 1600 // Update commands to reflect current state.
1605 UpdateCommandsForTabState(); 1601 UpdateCommandsForTabState();
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
2616 2612
2617 // We need to register the window position pref. 2613 // We need to register the window position pref.
2618 std::wstring window_pref(prefs::kBrowserWindowPlacement); 2614 std::wstring window_pref(prefs::kBrowserWindowPlacement);
2619 window_pref.append(L"_"); 2615 window_pref.append(L"_");
2620 window_pref.append(app_name); 2616 window_pref.append(app_name);
2621 PrefService* prefs = g_browser_process->local_state(); 2617 PrefService* prefs = g_browser_process->local_state();
2622 DCHECK(prefs); 2618 DCHECK(prefs);
2623 2619
2624 prefs->RegisterDictionaryPref(window_pref.c_str()); 2620 prefs->RegisterDictionaryPref(window_pref.c_str());
2625 } 2621 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698