Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/memory/weak_ptr.h" | |
| 12 #include "base/prefs/pref_member.h" | 13 #include "base/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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 ///////////////////////////////////////////////////////////////////////////// | 70 ///////////////////////////////////////////////////////////////////////////// |
| 70 class LocationBarView : public LocationBar, | 71 class LocationBarView : public LocationBar, |
| 71 public LocationBarTesting, | 72 public LocationBarTesting, |
| 72 public views::View, | 73 public views::View, |
| 73 public views::ButtonListener, | 74 public views::ButtonListener, |
| 74 public views::DragController, | 75 public views::DragController, |
| 75 public OmniboxEditController, | 76 public OmniboxEditController, |
| 76 public DropdownBarHostDelegate, | 77 public DropdownBarHostDelegate, |
| 77 public TemplateURLServiceObserver, | 78 public TemplateURLServiceObserver, |
| 78 public content::NotificationObserver, | 79 public content::NotificationObserver, |
| 79 public SearchModelObserver { | 80 public SearchModelObserver, |
| 81 public base::SupportsWeakPtr<LocationBarView> { | |
|
msw
2013/09/03 21:06:57
I'd suggest using a WeakPtrFactory instead of Supp
dmazzoni
2013/09/04 06:48:04
Sure. Switched to WeakPtrFactory.
| |
| 80 public: | 82 public: |
| 81 // The location bar view's class name. | 83 // The location bar view's class name. |
| 82 static const char kViewClassName[]; | 84 static const char kViewClassName[]; |
| 83 | 85 |
| 84 // DropdownBarHostDelegate: | 86 // DropdownBarHostDelegate: |
| 85 virtual void SetFocusAndSelection(bool select_all) OVERRIDE; | 87 virtual void SetFocusAndSelection(bool select_all) OVERRIDE; |
| 86 virtual void SetAnimationOffset(int offset) OVERRIDE; | 88 virtual void SetAnimationOffset(int offset) OVERRIDE; |
| 87 | 89 |
| 88 // Returns the offset used while animating. | 90 // Returns the offset used while animating. |
| 89 int animation_offset() const { return animation_offset_; } | 91 int animation_offset() const { return animation_offset_; } |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 415 // Returns true if the suggest text is valid. | 417 // Returns true if the suggest text is valid. |
| 416 bool HasValidSuggestText() const; | 418 bool HasValidSuggestText() const; |
| 417 | 419 |
| 418 // Helper to show the first run info bubble. | 420 // Helper to show the first run info bubble. |
| 419 void ShowFirstRunBubbleInternal(); | 421 void ShowFirstRunBubbleInternal(); |
| 420 | 422 |
| 421 // Draw backgrounds and borders for page actions. Must be called | 423 // Draw backgrounds and borders for page actions. Must be called |
| 422 // after layout, so the |page_action_views_| have their bounds. | 424 // after layout, so the |page_action_views_| have their bounds. |
| 423 void PaintPageActionBackgrounds(gfx::Canvas* canvas); | 425 void PaintPageActionBackgrounds(gfx::Canvas* canvas); |
| 424 | 426 |
| 427 // Handles a request to change the value of this text field from software | |
| 428 // using an accessibility API (typically automation software, screen readers | |
| 429 // don't normally use this). Sets the value and clears the selection. | |
| 430 void AccessibilitySetValue(const string16& new_value); | |
| 431 | |
| 425 // The Browser this LocationBarView is in. Note that at least | 432 // The Browser this LocationBarView is in. Note that at least |
| 426 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser | 433 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser |
| 427 // window, so this may be NULL. | 434 // window, so this may be NULL. |
| 428 Browser* browser_; | 435 Browser* browser_; |
| 429 | 436 |
| 430 // The Autocomplete Edit field. | 437 // The Autocomplete Edit field. |
| 431 scoped_ptr<OmniboxView> location_entry_; | 438 scoped_ptr<OmniboxView> location_entry_; |
| 432 | 439 |
| 433 // The profile which corresponds to this View. | 440 // The profile which corresponds to this View. |
| 434 Profile* profile_; | 441 Profile* profile_; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 531 // in the right location. | 538 // in the right location. |
| 532 int animation_offset_; | 539 int animation_offset_; |
| 533 | 540 |
| 534 // Used to register for notifications received by NotificationObserver. | 541 // Used to register for notifications received by NotificationObserver. |
| 535 content::NotificationRegistrar registrar_; | 542 content::NotificationRegistrar registrar_; |
| 536 | 543 |
| 537 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 544 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
| 538 }; | 545 }; |
| 539 | 546 |
| 540 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 547 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |