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

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: Merge to head for commit 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 virtual bool GetBookmarkStarVisibility() OVERRIDE; 333 virtual bool GetBookmarkStarVisibility() OVERRIDE;
332 334
333 // Overridden from TemplateURLServiceObserver 335 // Overridden from TemplateURLServiceObserver
334 virtual void OnTemplateURLServiceChanged() OVERRIDE; 336 virtual void OnTemplateURLServiceChanged() OVERRIDE;
335 337
336 // Overridden from content::NotificationObserver 338 // Overridden from content::NotificationObserver
337 virtual void Observe(int type, 339 virtual void Observe(int type,
338 const content::NotificationSource& source, 340 const content::NotificationSource& source,
339 const content::NotificationDetails& details) OVERRIDE; 341 const content::NotificationDetails& details) OVERRIDE;
340 342
343 // Overridden from PrefObserver
344 virtual void OnPreferenceChanged(PrefServiceBase* service,
345 const std::string& pref_name) OVERRIDE;
346
341 // Returns the height of the control without the top and bottom 347 // Returns the height of the control without the top and bottom
342 // edges(i.e. the height of the edit control inside). If 348 // edges(i.e. the height of the edit control inside). If
343 // |use_preferred_size| is true this will be the preferred height, 349 // |use_preferred_size| is true this will be the preferred height,
344 // otherwise it will be the current height. 350 // otherwise it will be the current height.
345 int GetInternalHeight(bool use_preferred_size); 351 int GetInternalHeight(bool use_preferred_size);
346 352
347 // Space between items in the location bar. 353 // Space between items in the location bar.
348 static int GetItemPadding(); 354 static int GetItemPadding();
349 355
350 // Space between the edges and the items next to them. 356 // Space between the edges and the items next to them.
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 575
570 #if defined(USE_AURA) 576 #if defined(USE_AURA)
571 // Observer for a fade-in animation. 577 // Observer for a fade-in animation.
572 scoped_ptr<FadeAnimationObserver> fade_animation_observer_; 578 scoped_ptr<FadeAnimationObserver> fade_animation_observer_;
573 #endif 579 #endif
574 580
575 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); 581 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView);
576 }; 582 };
577 583
578 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 584 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper.cc ('k') | chrome/browser/ui/views/location_bar/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698