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

Side by Side Diff: chrome/browser/cocoa/location_bar_view_mac.mm

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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #import "chrome/browser/cocoa/location_bar_view_mac.h" 5 #import "chrome/browser/cocoa/location_bar_view_mac.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "chrome/app/chrome_dll_resource.h" 8 #include "chrome/app/chrome_dll_resource.h"
9 #include "chrome/browser/alternate_nav_url_fetcher.h" 9 #include "chrome/browser/alternate_nav_url_fetcher.h"
10 #import "chrome/browser/app_controller_mac.h" 10 #import "chrome/browser/app_controller_mac.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 void LocationBarViewMac::FocusLocation() { 50 void LocationBarViewMac::FocusLocation() {
51 edit_view_->FocusLocation(); 51 edit_view_->FocusLocation();
52 } 52 }
53 53
54 void LocationBarViewMac::SaveStateToContents(TabContents* contents) { 54 void LocationBarViewMac::SaveStateToContents(TabContents* contents) {
55 // TODO(shess): Why SaveStateToContents vs SaveStateToTab? 55 // TODO(shess): Why SaveStateToContents vs SaveStateToTab?
56 edit_view_->SaveStateToTab(contents); 56 edit_view_->SaveStateToTab(contents);
57 } 57 }
58 58
59 void LocationBarViewMac::Update(const TabContents* contents,
60 bool should_restore_state) {
61 // AutocompleteEditView restores state if the tab is non-NULL.
62 edit_view_->Update(should_restore_state ? contents : NULL);
63 }
64
59 void LocationBarViewMac::OnAutocompleteAccept(const GURL& url, 65 void LocationBarViewMac::OnAutocompleteAccept(const GURL& url,
60 WindowOpenDisposition disposition, 66 WindowOpenDisposition disposition,
61 PageTransition::Type transition, 67 PageTransition::Type transition,
62 const GURL& alternate_nav_url) { 68 const GURL& alternate_nav_url) {
63 if (!url.is_valid()) 69 if (!url.is_valid())
64 return; 70 return;
65 71
66 location_input_ = UTF8ToWide(url.spec()); 72 location_input_ = UTF8ToWide(url.spec());
67 disposition_ = disposition; 73 disposition_ = disposition;
68 transition_ = transition; 74 transition_ = transition;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 111 }
106 112
107 std::wstring LocationBarViewMac::GetTitle() const { 113 std::wstring LocationBarViewMac::GetTitle() const {
108 NOTIMPLEMENTED(); 114 NOTIMPLEMENTED();
109 return std::wstring(); 115 return std::wstring();
110 } 116 }
111 117
112 void LocationBarViewMac::Revert() { 118 void LocationBarViewMac::Revert() {
113 NOTIMPLEMENTED(); 119 NOTIMPLEMENTED();
114 } 120 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698