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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.h

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/prefs/public/pref_observer.h"
12 #include "chrome/browser/api/prefs/pref_member.h" 13 #include "chrome/browser/api/prefs/pref_member.h"
13 #include "chrome/browser/extensions/extension_context_menu_model.h" 14 #include "chrome/browser/extensions/extension_context_menu_model.h"
14 #include "chrome/browser/search_engines/template_url_service_observer.h" 15 #include "chrome/browser/search_engines/template_url_service_observer.h"
15 #include "chrome/browser/ui/omnibox/location_bar.h" 16 #include "chrome/browser/ui/omnibox/location_bar.h"
16 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" 17 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h"
17 #include "chrome/browser/ui/search/search_model_observer.h" 18 #include "chrome/browser/ui/search/search_model_observer.h"
18 #include "chrome/browser/ui/toolbar/toolbar_model.h" 19 #include "chrome/browser/ui/toolbar/toolbar_model.h"
19 #include "chrome/browser/ui/views/dropdown_bar_host.h" 20 #include "chrome/browser/ui/views/dropdown_bar_host.h"
20 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" 21 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h"
21 #include "chrome/browser/ui/views/extensions/extension_popup.h" 22 #include "chrome/browser/ui/views/extensions/extension_popup.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // 73 //
73 ///////////////////////////////////////////////////////////////////////////// 74 /////////////////////////////////////////////////////////////////////////////
74 class LocationBarView : public LocationBar, 75 class LocationBarView : public LocationBar,
75 public LocationBarTesting, 76 public LocationBarTesting,
76 public views::View, 77 public views::View,
77 public views::DragController, 78 public views::DragController,
78 public OmniboxEditController, 79 public OmniboxEditController,
79 public DropdownBarHostDelegate, 80 public DropdownBarHostDelegate,
80 public chrome::search::SearchModelObserver, 81 public chrome::search::SearchModelObserver,
81 public TemplateURLServiceObserver, 82 public TemplateURLServiceObserver,
82 public content::NotificationObserver { 83 public content::NotificationObserver,
84 public PrefObserver {
83 public: 85 public:
84 // The location bar view's class name. 86 // The location bar view's class name.
85 static const char kViewClassName[]; 87 static const char kViewClassName[];
86 88
87 // DropdownBarHostDelegate 89 // DropdownBarHostDelegate
88 virtual void SetFocusAndSelection(bool select_all) OVERRIDE; 90 virtual void SetFocusAndSelection(bool select_all) OVERRIDE;
89 virtual void SetAnimationOffset(int offset) OVERRIDE; 91 virtual void SetAnimationOffset(int offset) OVERRIDE;
90 92
91 // chrome::search::SearchModelObserver: 93 // chrome::search::SearchModelObserver:
92 virtual void ModeChanged(const chrome::search::Mode& old_mode, 94 virtual void ModeChanged(const chrome::search::Mode& old_mode,
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 virtual bool GetBookmarkStarVisibility() OVERRIDE; 334 virtual bool GetBookmarkStarVisibility() OVERRIDE;
333 335
334 // Overridden from TemplateURLServiceObserver 336 // Overridden from TemplateURLServiceObserver
335 virtual void OnTemplateURLServiceChanged() OVERRIDE; 337 virtual void OnTemplateURLServiceChanged() OVERRIDE;
336 338
337 // Overridden from content::NotificationObserver 339 // Overridden from content::NotificationObserver
338 virtual void Observe(int type, 340 virtual void Observe(int type,
339 const content::NotificationSource& source, 341 const content::NotificationSource& source,
340 const content::NotificationDetails& details) OVERRIDE; 342 const content::NotificationDetails& details) OVERRIDE;
341 343
344 // Overridden from PrefObserver
345 virtual void OnPreferenceChanged(PrefServiceBase* service,
346 const std::string& pref_name) OVERRIDE;
347
342 // Returns the height of the control without the top and bottom 348 // Returns the height of the control without the top and bottom
343 // edges(i.e. the height of the edit control inside). If 349 // edges(i.e. the height of the edit control inside). If
344 // |use_preferred_size| is true this will be the preferred height, 350 // |use_preferred_size| is true this will be the preferred height,
345 // otherwise it will be the current height. 351 // otherwise it will be the current height.
346 int GetInternalHeight(bool use_preferred_size); 352 int GetInternalHeight(bool use_preferred_size);
347 353
348 // Space between items in the location bar. 354 // Space between items in the location bar.
349 static int GetItemPadding(); 355 static int GetItemPadding();
350 356
351 // Space between the edges and the items next to them. 357 // Space between the edges and the items next to them.
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 580
575 #if defined(USE_AURA) 581 #if defined(USE_AURA)
576 // Observer for a fade-in animation. 582 // Observer for a fade-in animation.
577 scoped_ptr<FadeAnimationObserver> fade_animation_observer_; 583 scoped_ptr<FadeAnimationObserver> fade_animation_observer_;
578 #endif 584 #endif
579 585
580 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); 586 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView);
581 }; 587 };
582 588
583 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 589 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698