| OLD | NEW | 
|---|
| 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 #ifndef CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 
| 6 #define CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 
| 7 | 7 | 
| 8 #include <string> | 8 #include <string> | 
| 9 #include <vector> | 9 #include <vector> | 
| 10 | 10 | 
| 11 #include "app/gfx/font.h" | 11 #include "app/gfx/font.h" | 
| 12 #include "base/gfx/rect.h" | 12 #include "base/gfx/rect.h" | 
| 13 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 13 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 
| 14 #include "chrome/browser/image_loading_tracker.h" | 14 #include "chrome/browser/image_loading_tracker.h" | 
| 15 #include "chrome/browser/location_bar.h" | 15 #include "chrome/browser/location_bar.h" | 
| 16 #include "chrome/browser/tab_contents/tab_contents.h" | 16 #include "chrome/browser/tab_contents/tab_contents.h" | 
| 17 #include "chrome/browser/toolbar_model.h" | 17 #include "chrome/browser/toolbar_model.h" | 
| 18 #include "chrome/browser/views/info_bubble.h" | 18 #include "chrome/browser/views/info_bubble.h" | 
| 19 #include "views/controls/image_view.h" | 19 #include "views/controls/image_view.h" | 
| 20 #include "views/controls/label.h" | 20 #include "views/controls/label.h" | 
| 21 #include "views/controls/native/native_view_host.h" | 21 #include "views/controls/native/native_view_host.h" | 
| 22 #include "views/painter.h" | 22 #include "views/painter.h" | 
| 23 | 23 | 
| 24 #if defined(OS_WIN) | 24 #if defined(OS_WIN) | 
| 25 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h" | 25 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h" | 
| 26 #else | 26 #else | 
| 27 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" | 27 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" | 
| 28 #endif | 28 #endif | 
| 29 | 29 | 
| 30 class AutocompletePopupPositioner; | 30 class BubblePositioner; | 
| 31 class CommandUpdater; | 31 class CommandUpdater; | 
| 32 class GURL; | 32 class GURL; | 
| 33 class PageAction; | 33 class PageAction; | 
| 34 class Profile; | 34 class Profile; | 
| 35 | 35 | 
| 36 ///////////////////////////////////////////////////////////////////////////// | 36 ///////////////////////////////////////////////////////////////////////////// | 
| 37 // | 37 // | 
| 38 // LocationBarView class | 38 // LocationBarView class | 
| 39 // | 39 // | 
| 40 //   The LocationBarView class is a View subclass that paints the background | 40 //   The LocationBarView class is a View subclass that paints the background | 
| (...skipping 25 matching lines...) Expand all  Loading... | 
| 66     SECURITY_INFO_BUBBLE_TEXT, | 66     SECURITY_INFO_BUBBLE_TEXT, | 
| 67     SCHEME_STRIKEOUT, | 67     SCHEME_STRIKEOUT, | 
| 68     NUM_KINDS | 68     NUM_KINDS | 
| 69   }; | 69   }; | 
| 70 | 70 | 
| 71   LocationBarView(Profile* profile, | 71   LocationBarView(Profile* profile, | 
| 72                   CommandUpdater* command_updater, | 72                   CommandUpdater* command_updater, | 
| 73                   ToolbarModel* model, | 73                   ToolbarModel* model, | 
| 74                   Delegate* delegate, | 74                   Delegate* delegate, | 
| 75                   bool popup_window_mode, | 75                   bool popup_window_mode, | 
| 76                   AutocompletePopupPositioner* popup_positioner); | 76                   const BubblePositioner* bubble_positioner); | 
| 77   virtual ~LocationBarView(); | 77   virtual ~LocationBarView(); | 
| 78 | 78 | 
| 79   void Init(); | 79   void Init(); | 
| 80 | 80 | 
| 81   // Returns whether this instance has been initialized by callin Init. Init can | 81   // Returns whether this instance has been initialized by callin Init. Init can | 
| 82   // only be called when the receiving instance is attached to a view container. | 82   // only be called when the receiving instance is attached to a view container. | 
| 83   bool IsInitialized() const; | 83   bool IsInitialized() const; | 
| 84 | 84 | 
| 85   // Returns the appropriate color for the desired kind, based on the user's | 85   // Returns the appropriate color for the desired kind, based on the user's | 
| 86   // system theme. | 86   // system theme. | 
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 332     ToolbarModel* model_; | 332     ToolbarModel* model_; | 
| 333 | 333 | 
| 334     DISALLOW_COPY_AND_ASSIGN(SecurityImageView); | 334     DISALLOW_COPY_AND_ASSIGN(SecurityImageView); | 
| 335   }; | 335   }; | 
| 336 | 336 | 
| 337   // PageActionImageView is used to display the icon for a given PageAction | 337   // PageActionImageView is used to display the icon for a given PageAction | 
| 338   // and notify the extension when the icon is clicked. | 338   // and notify the extension when the icon is clicked. | 
| 339   class PageActionImageView : public LocationBarImageView, | 339   class PageActionImageView : public LocationBarImageView, | 
| 340                               public ImageLoadingTracker::Observer { | 340                               public ImageLoadingTracker::Observer { | 
| 341    public: | 341    public: | 
| 342     PageActionImageView( | 342     PageActionImageView(LocationBarView* owner, | 
| 343         LocationBarView* owner, Profile* profile, | 343                         Profile* profile, | 
| 344         const PageAction* page_action); | 344                         const PageAction* page_action); | 
| 345     virtual ~PageActionImageView(); | 345     virtual ~PageActionImageView(); | 
| 346 | 346 | 
| 347     // Overridden from view for the mouse hovering. | 347     // Overridden from view for the mouse hovering. | 
| 348     virtual bool OnMousePressed(const views::MouseEvent& event); | 348     virtual bool OnMousePressed(const views::MouseEvent& event); | 
| 349 | 349 | 
| 350     // Overridden from LocationBarImageView. | 350     // Overridden from LocationBarImageView. | 
| 351     virtual void ShowInfoBubble(); | 351     virtual void ShowInfoBubble(); | 
| 352 | 352 | 
| 353     // Overridden from ImageLoadingTracker. | 353     // Overridden from ImageLoadingTracker. | 
| 354     virtual void OnImageLoaded(SkBitmap* image, size_t index); | 354     virtual void OnImageLoaded(SkBitmap* image, size_t index); | 
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 511   // A label displayed after the lock icon to show some extra information. | 511   // A label displayed after the lock icon to show some extra information. | 
| 512   views::Label info_label_; | 512   views::Label info_label_; | 
| 513 | 513 | 
| 514   // When true, the location bar view is read only and also is has a slightly | 514   // When true, the location bar view is read only and also is has a slightly | 
| 515   // different presentation (font size / color). This is used for popups. | 515   // different presentation (font size / color). This is used for popups. | 
| 516   bool popup_window_mode_; | 516   bool popup_window_mode_; | 
| 517 | 517 | 
| 518   // Used schedule a task for the first run info bubble. | 518   // Used schedule a task for the first run info bubble. | 
| 519   ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; | 519   ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; | 
| 520 | 520 | 
| 521   // The positioner that places the autocomplete popup. | 521   // The positioner that places the omnibox and info bubbles. | 
| 522   AutocompletePopupPositioner* popup_positioner_; | 522   const BubblePositioner* bubble_positioner_; | 
| 523 | 523 | 
| 524   // Storage of string needed for accessibility. | 524   // Storage of string needed for accessibility. | 
| 525   std::wstring accessible_name_; | 525   std::wstring accessible_name_; | 
| 526 | 526 | 
| 527   DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 527   DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 
| 528 }; | 528 }; | 
| 529 | 529 | 
| 530 #endif  // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 530 #endif  // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 
| OLD | NEW | 
|---|