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/prefs/pref_member.h" | 12 #include "base/prefs/pref_member.h" |
13 #include "chrome/browser/extensions/extension_context_menu_model.h" | 13 #include "chrome/browser/extensions/extension_context_menu_model.h" |
14 #include "chrome/browser/ssl/security_state_model.h" | 14 #include "chrome/browser/ssl/security_state_model.h" |
15 #include "chrome/browser/ui/location_bar/location_bar.h" | 15 #include "chrome/browser/ui/location_bar/location_bar.h" |
16 #include "chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.h" | 16 #include "chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.h" |
17 #include "chrome/browser/ui/search/search_model_observer.h" | |
18 #include "chrome/browser/ui/toolbar/chrome_toolbar_model.h" | 17 #include "chrome/browser/ui/toolbar/chrome_toolbar_model.h" |
19 #include "chrome/browser/ui/views/dropdown_bar_host.h" | 18 #include "chrome/browser/ui/views/dropdown_bar_host.h" |
20 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" | 19 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" |
21 #include "chrome/browser/ui/views/extensions/extension_popup.h" | 20 #include "chrome/browser/ui/views/extensions/extension_popup.h" |
22 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 21 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
23 #include "components/search_engines/template_url_service_observer.h" | 22 #include "components/search_engines/template_url_service_observer.h" |
24 #include "components/ui/zoom/zoom_event_manager_observer.h" | 23 #include "components/ui/zoom/zoom_event_manager_observer.h" |
25 #include "ui/gfx/animation/animation_delegate.h" | 24 #include "ui/gfx/animation/animation_delegate.h" |
26 #include "ui/gfx/animation/slide_animation.h" | 25 #include "ui/gfx/animation/slide_animation.h" |
27 #include "ui/gfx/font.h" | 26 #include "ui/gfx/font.h" |
28 #include "ui/gfx/geometry/rect.h" | 27 #include "ui/gfx/geometry/rect.h" |
29 #include "ui/views/controls/button/button.h" | |
30 #include "ui/views/drag_controller.h" | 28 #include "ui/views/drag_controller.h" |
31 | 29 |
32 class ActionBoxButtonView; | 30 class ActionBoxButtonView; |
33 class CommandUpdater; | 31 class CommandUpdater; |
34 class ContentSettingBubbleModelDelegate; | 32 class ContentSettingBubbleModelDelegate; |
35 class ContentSettingImageView; | 33 class ContentSettingImageView; |
36 class EVBubbleView; | 34 class EVBubbleView; |
37 class ExtensionAction; | 35 class ExtensionAction; |
38 class GURL; | 36 class GURL; |
39 class InstantController; | 37 class InstantController; |
40 class KeywordHintView; | 38 class KeywordHintView; |
41 class LocationIconView; | 39 class LocationIconView; |
42 class OpenPDFInReaderView; | 40 class OpenPDFInReaderView; |
43 class ManagePasswordsIconViews; | 41 class ManagePasswordsIconViews; |
44 class PageActionWithBadgeView; | 42 class PageActionWithBadgeView; |
45 class PageActionImageView; | 43 class PageActionImageView; |
46 class Profile; | 44 class Profile; |
47 class SelectedKeywordView; | 45 class SelectedKeywordView; |
48 class StarView; | 46 class StarView; |
49 class TemplateURLService; | 47 class TemplateURLService; |
50 class TranslateIconView; | 48 class TranslateIconView; |
51 class ZoomView; | 49 class ZoomView; |
52 | 50 |
53 namespace autofill { | 51 namespace autofill { |
54 class SaveCardIconView; | 52 class SaveCardIconView; |
55 } | 53 } |
56 | 54 |
57 namespace views { | 55 namespace views { |
58 class BubbleDelegateView; | 56 class BubbleDelegateView; |
59 class ImageButton; | |
60 class ImageView; | |
61 class Label; | 57 class Label; |
62 class Widget; | 58 class Widget; |
63 } | 59 } |
64 | 60 |
65 ///////////////////////////////////////////////////////////////////////////// | 61 ///////////////////////////////////////////////////////////////////////////// |
66 // | 62 // |
67 // LocationBarView class | 63 // LocationBarView class |
68 // | 64 // |
69 // The LocationBarView class is a View subclass that paints the background | 65 // The LocationBarView class is a View subclass that paints the background |
70 // of the URL bar strip and contains its content. | 66 // of the URL bar strip and contains its content. |
71 // | 67 // |
72 ///////////////////////////////////////////////////////////////////////////// | 68 ///////////////////////////////////////////////////////////////////////////// |
73 class LocationBarView : public LocationBar, | 69 class LocationBarView : public LocationBar, |
74 public LocationBarTesting, | 70 public LocationBarTesting, |
75 public views::View, | 71 public views::View, |
76 public views::ButtonListener, | |
77 public views::DragController, | 72 public views::DragController, |
78 public gfx::AnimationDelegate, | 73 public gfx::AnimationDelegate, |
79 public ChromeOmniboxEditController, | 74 public ChromeOmniboxEditController, |
80 public DropdownBarHostDelegate, | 75 public DropdownBarHostDelegate, |
81 public TemplateURLServiceObserver, | 76 public TemplateURLServiceObserver, |
82 public SearchModelObserver, | |
83 public ui_zoom::ZoomEventManagerObserver { | 77 public ui_zoom::ZoomEventManagerObserver { |
84 public: | 78 public: |
85 // The location bar view's class name. | 79 // The location bar view's class name. |
86 static const char kViewClassName[]; | 80 static const char kViewClassName[]; |
87 | 81 |
88 // Returns the offset used during dropdown animation. | 82 // Returns the offset used during dropdown animation. |
89 int dropdown_animation_offset() const { return dropdown_animation_offset_; } | 83 int dropdown_animation_offset() const { return dropdown_animation_offset_; } |
90 | 84 |
91 class Delegate { | 85 class Delegate { |
92 public: | 86 public: |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 void TestPageActionPressed(size_t index) override; | 360 void TestPageActionPressed(size_t index) override; |
367 bool GetBookmarkStarVisibility() override; | 361 bool GetBookmarkStarVisibility() override; |
368 | 362 |
369 // views::View: | 363 // views::View: |
370 const char* GetClassName() const override; | 364 const char* GetClassName() const override; |
371 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; | 365 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; |
372 void OnFocus() override; | 366 void OnFocus() override; |
373 void OnPaint(gfx::Canvas* canvas) override; | 367 void OnPaint(gfx::Canvas* canvas) override; |
374 void PaintChildren(const ui::PaintContext& context) override; | 368 void PaintChildren(const ui::PaintContext& context) override; |
375 | 369 |
376 // views::ButtonListener: | |
377 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | |
378 | |
379 // views::DragController: | 370 // views::DragController: |
380 void WriteDragDataForView(View* sender, | 371 void WriteDragDataForView(View* sender, |
381 const gfx::Point& press_pt, | 372 const gfx::Point& press_pt, |
382 OSExchangeData* data) override; | 373 OSExchangeData* data) override; |
383 int GetDragOperationsForView(View* sender, const gfx::Point& p) override; | 374 int GetDragOperationsForView(View* sender, const gfx::Point& p) override; |
384 bool CanStartDragForView(View* sender, | 375 bool CanStartDragForView(View* sender, |
385 const gfx::Point& press_pt, | 376 const gfx::Point& press_pt, |
386 const gfx::Point& p) override; | 377 const gfx::Point& p) override; |
387 | 378 |
388 // gfx::AnimationDelegate: | 379 // gfx::AnimationDelegate: |
389 void AnimationProgressed(const gfx::Animation* animation) override; | 380 void AnimationProgressed(const gfx::Animation* animation) override; |
390 void AnimationEnded(const gfx::Animation* animation) override; | 381 void AnimationEnded(const gfx::Animation* animation) override; |
391 | 382 |
392 // ChromeOmniboxEditController: | 383 // ChromeOmniboxEditController: |
393 void OnChanged() override; | 384 void OnChanged() override; |
394 void OnSetFocus() override; | 385 void OnSetFocus() override; |
395 const ToolbarModel* GetToolbarModel() const override; | 386 const ToolbarModel* GetToolbarModel() const override; |
396 | 387 |
397 // DropdownBarHostDelegate: | 388 // DropdownBarHostDelegate: |
398 void SetFocusAndSelection(bool select_all) override; | 389 void SetFocusAndSelection(bool select_all) override; |
399 void SetAnimationOffset(int offset) override; | 390 void SetAnimationOffset(int offset) override; |
400 | 391 |
401 // TemplateURLServiceObserver: | 392 // TemplateURLServiceObserver: |
402 void OnTemplateURLServiceChanged() override; | 393 void OnTemplateURLServiceChanged() override; |
403 | 394 |
404 // SearchModelObserver: | |
405 void ModelChanged(const SearchModel::State& old_state, | |
406 const SearchModel::State& new_state) override; | |
407 | |
408 // The Browser this LocationBarView is in. Note that at least | 395 // The Browser this LocationBarView is in. Note that at least |
409 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser | 396 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser |
410 // window, so this may be NULL. | 397 // window, so this may be NULL. |
411 Browser* browser_; | 398 Browser* browser_; |
412 | 399 |
413 OmniboxViewViews* omnibox_view_; | 400 OmniboxViewViews* omnibox_view_; |
414 | 401 |
415 // Our delegate. | 402 // Our delegate. |
416 Delegate* delegate_; | 403 Delegate* delegate_; |
417 | 404 |
(...skipping 21 matching lines...) Expand all Loading... |
439 // Shown if the user has selected a keyword. | 426 // Shown if the user has selected a keyword. |
440 SelectedKeywordView* selected_keyword_view_; | 427 SelectedKeywordView* selected_keyword_view_; |
441 | 428 |
442 // View responsible for showing suggested text. This is NULL when there is no | 429 // View responsible for showing suggested text. This is NULL when there is no |
443 // suggested text. | 430 // suggested text. |
444 views::Label* suggested_text_view_; | 431 views::Label* suggested_text_view_; |
445 | 432 |
446 // Shown if the selected url has a corresponding keyword. | 433 // Shown if the selected url has a corresponding keyword. |
447 KeywordHintView* keyword_hint_view_; | 434 KeywordHintView* keyword_hint_view_; |
448 | 435 |
449 // The voice search icon. | |
450 views::ImageButton* mic_search_view_; | |
451 | |
452 // The content setting views. | 436 // The content setting views. |
453 ContentSettingViews content_setting_views_; | 437 ContentSettingViews content_setting_views_; |
454 | 438 |
455 // The zoom icon. | 439 // The zoom icon. |
456 ZoomView* zoom_view_; | 440 ZoomView* zoom_view_; |
457 | 441 |
458 // The icon to open a PDF in Reader. | 442 // The icon to open a PDF in Reader. |
459 OpenPDFInReaderView* open_pdf_in_reader_view_; | 443 OpenPDFInReaderView* open_pdf_in_reader_view_; |
460 | 444 |
461 // The manage passwords icon. | 445 // The manage passwords icon. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 int dropdown_animation_offset_; | 482 int dropdown_animation_offset_; |
499 | 483 |
500 // This is a debug state variable that stores if the WebContents was null | 484 // This is a debug state variable that stores if the WebContents was null |
501 // during the last RefreshPageAction. | 485 // during the last RefreshPageAction. |
502 bool web_contents_null_at_last_refresh_; | 486 bool web_contents_null_at_last_refresh_; |
503 | 487 |
504 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 488 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
505 }; | 489 }; |
506 | 490 |
507 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 491 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
OLD | NEW |