summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-10 19:35:52 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-10 19:35:52 +0000
commit81c2122f16c82b52c19b474775d2a15aa065e77a (patch)
treebeee93270b997c49f83ba0233ac1dd12cebaf3a8 /chrome/browser/views
parent8fbab00264861b95a99a8232ba75e0994c46c185 (diff)
downloadchromium_src-81c2122f16c82b52c19b474775d2a15aa065e77a.zip
chromium_src-81c2122f16c82b52c19b474775d2a15aa065e77a.tar.gz
chromium_src-81c2122f16c82b52c19b474775d2a15aa065e77a.tar.bz2
First pass at splitting the AutocompleteEdit into Model and View. This was noticeably harder than with the Popup and I'm not at all sure I've made the right decisions :(. The View code is about 3x larger than the model.
BUG=1343512 Review URL: http://codereview.chromium.org/1872 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2004 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/location_bar_view.cc18
-rw-r--r--chrome/browser/views/location_bar_view.h14
2 files changed, 16 insertions, 16 deletions
diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc
index e9c0837..ce9da67 100644
--- a/chrome/browser/views/location_bar_view.cc
+++ b/chrome/browser/views/location_bar_view.cc
@@ -125,10 +125,10 @@ void LocationBarView::Init() {
// URL edit field.
ChromeViews::ViewContainer* vc = GetViewContainer();
DCHECK(vc) << "LocationBarView::Init - vc is NULL!";
- location_entry_.reset(new AutocompleteEdit(font_, this, model_, this,
- vc->GetHWND(),
- profile_, controller_,
- popup_window_mode_));
+ location_entry_.reset(new AutocompleteEditView(font_, this, model_, this,
+ vc->GetHWND(),
+ profile_, controller_,
+ popup_window_mode_));
// View container for URL edit field.
location_entry_view_ = new ChromeViews::HWNDView;
@@ -168,7 +168,7 @@ void LocationBarView::Init() {
info_label_.SetParentOwned(false);
// Notify us when any ancestor is resized. In this case we want to tell the
- // AutocompleteEdit to close its popup.
+ // AutocompleteEditView to close its popup.
SetNotifyWhenVisibleBoundsInRootChanges(true);
// Initialize the location entry. We do this to avoid a black flash which is
@@ -197,7 +197,7 @@ void LocationBarView::SetProfile(Profile* profile) {
DCHECK(profile);
if (profile_ != profile) {
profile_ = profile;
- location_entry_->SetProfile(profile);
+ location_entry_->model()->SetProfile(profile);
selected_keyword_view_.set_profile(profile);
keyword_hint_view_.set_profile(profile);
security_image_view_.set_profile(profile);
@@ -463,11 +463,11 @@ bool LocationBarView::NeedsResize(View* view, int text_width, int max_width) {
}
bool LocationBarView::AdjustHints(int text_width, int max_width) {
- const std::wstring keyword(location_entry_->keyword());
- const bool is_keyword_hint(location_entry_->is_keyword_hint());
+ const std::wstring keyword(location_entry_->model()->keyword());
+ const bool is_keyword_hint(location_entry_->model()->is_keyword_hint());
const bool show_selected_keyword = !keyword.empty() && !is_keyword_hint;
const bool show_keyword_hint = !keyword.empty() && is_keyword_hint;
- bool show_search_hint(location_entry_->show_search_hint());
+ bool show_search_hint(location_entry_->model()->show_search_hint());
DCHECK(keyword.empty() || !show_search_hint);
if (show_search_hint) {
diff --git a/chrome/browser/views/location_bar_view.h b/chrome/browser/views/location_bar_view.h
index 3631ac8..f02c24d 100644
--- a/chrome/browser/views/location_bar_view.h
+++ b/chrome/browser/views/location_bar_view.h
@@ -31,7 +31,7 @@ class Profile;
//
/////////////////////////////////////////////////////////////////////////////
class LocationBarView : public ChromeViews::View,
- public AutocompleteEdit::Controller {
+ public AutocompleteEditController {
public:
class Delegate {
@@ -80,8 +80,8 @@ class LocationBarView : public ChromeViews::View,
// Overridden from View so we can use <tab> to go into keyword search mode.
virtual bool CanProcessTabKeyEvents();
- // Called when any ancestor changes its size, asks the AutocompleteEdit to
- // close its popup.
+ // Called when any ancestor changes its size, asks the AutocompleteEditModel
+ // to close its popup.
virtual void VisibleBoundsInRootChanged();
// Event Handlers
@@ -90,7 +90,7 @@ class LocationBarView : public ChromeViews::View,
virtual void OnMouseReleased(const ChromeViews::MouseEvent& event,
bool canceled);
- // AutocompleteEdit::Controller
+ // AutocompleteEditController
virtual void OnAutocompleteAccept(const std::wstring& url,
WindowOpenDisposition disposition,
PageTransition::Type transition,
@@ -105,7 +105,7 @@ class LocationBarView : public ChromeViews::View,
// Returns the MSAA role
bool GetAccessibleRole(VARIANT* role);
- AutocompleteEdit* location_entry() {
+ AutocompleteEditView* location_entry() {
return location_entry_.get();
}
@@ -126,7 +126,7 @@ class LocationBarView : public ChromeViews::View,
void ShowFirstRunBubble();
// Overridden from View.
- virtual bool OverrideAccelerator(const ChromeViews::Accelerator& accelerator) ;
+ virtual bool OverrideAccelerator(const ChromeViews::Accelerator& accelerator);
static const int kTextVertMargin;
static const COLORREF kBackgroundColorByLevel[];
@@ -341,7 +341,7 @@ class LocationBarView : public ChromeViews::View,
Profile* profile_;
// The Autocomplete Edit field.
- scoped_ptr<AutocompleteEdit> location_entry_;
+ scoped_ptr<AutocompleteEditView> location_entry_;
// The command controller for this View.
CommandController* controller_;