| 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 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 232 |
| 233 // Returns the position and width that the popup should be, and also the left | 233 // Returns the position and width that the popup should be, and also the left |
| 234 // edge that the results should align themselves to (which will leave some | 234 // edge that the results should align themselves to (which will leave some |
| 235 // border on the left of the popup). | 235 // border on the left of the popup). |
| 236 void GetOmniboxPopupPositioningInfo(gfx::Point* top_left_screen_coord, | 236 void GetOmniboxPopupPositioningInfo(gfx::Point* top_left_screen_coord, |
| 237 int* popup_width, | 237 int* popup_width, |
| 238 int* left_margin, | 238 int* left_margin, |
| 239 int* right_margin); | 239 int* right_margin); |
| 240 | 240 |
| 241 // LocationBar: | 241 // LocationBar: |
| 242 virtual void FocusLocation(bool select_all) OVERRIDE; | 242 virtual void FocusLocation(bool select_all) override; |
| 243 virtual void Revert() OVERRIDE; | 243 virtual void Revert() override; |
| 244 virtual OmniboxView* GetOmniboxView() OVERRIDE; | 244 virtual OmniboxView* GetOmniboxView() override; |
| 245 | 245 |
| 246 // views::View: | 246 // views::View: |
| 247 virtual bool HasFocus() const OVERRIDE; | 247 virtual bool HasFocus() const override; |
| 248 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 248 virtual void GetAccessibleState(ui::AXViewState* state) override; |
| 249 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 249 virtual gfx::Size GetPreferredSize() const override; |
| 250 virtual void Layout() OVERRIDE; | 250 virtual void Layout() override; |
| 251 | 251 |
| 252 // OmniboxEditController: | 252 // OmniboxEditController: |
| 253 virtual void Update(const content::WebContents* contents) OVERRIDE; | 253 virtual void Update(const content::WebContents* contents) override; |
| 254 virtual void ShowURL() OVERRIDE; | 254 virtual void ShowURL() override; |
| 255 virtual void EndOriginChipAnimations(bool cancel_fade) OVERRIDE; | 255 virtual void EndOriginChipAnimations(bool cancel_fade) override; |
| 256 virtual ToolbarModel* GetToolbarModel() OVERRIDE; | 256 virtual ToolbarModel* GetToolbarModel() override; |
| 257 virtual content::WebContents* GetWebContents() OVERRIDE; | 257 virtual content::WebContents* GetWebContents() override; |
| 258 | 258 |
| 259 // Thickness of the edges of the omnibox background images, in normal mode. | 259 // Thickness of the edges of the omnibox background images, in normal mode. |
| 260 static const int kNormalEdgeThickness; | 260 static const int kNormalEdgeThickness; |
| 261 // The same, but for popup mode. | 261 // The same, but for popup mode. |
| 262 static const int kPopupEdgeThickness; | 262 static const int kPopupEdgeThickness; |
| 263 // Space between items in the location bar, as well as between items and the | 263 // Space between items in the location bar, as well as between items and the |
| 264 // edges. | 264 // edges. |
| 265 static const int kItemPadding; | 265 static const int kItemPadding; |
| 266 // Amount of padding built into the standard omnibox icons. | 266 // Amount of padding built into the standard omnibox icons. |
| 267 static const int kIconInternalPadding; | 267 static const int kIconInternalPadding; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 // if it's false) should be set to in order to produce the same omnibox | 332 // if it's false) should be set to in order to produce the same omnibox |
| 333 // position. This way we can stop the old animation, set the new animation to | 333 // position. This way we can stop the old animation, set the new animation to |
| 334 // this value, and start it running, and the text will appear to reverse | 334 // this value, and start it running, and the text will appear to reverse |
| 335 // directions from its current location. | 335 // directions from its current location. |
| 336 double GetValueForAnimation(bool hide) const; | 336 double GetValueForAnimation(bool hide) const; |
| 337 | 337 |
| 338 // Resets |show_url_animation_| and the color changes it causes. | 338 // Resets |show_url_animation_| and the color changes it causes. |
| 339 void ResetShowAnimationAndColors(); | 339 void ResetShowAnimationAndColors(); |
| 340 | 340 |
| 341 // LocationBar: | 341 // LocationBar: |
| 342 virtual void ShowFirstRunBubble() OVERRIDE; | 342 virtual void ShowFirstRunBubble() override; |
| 343 virtual GURL GetDestinationURL() const OVERRIDE; | 343 virtual GURL GetDestinationURL() const override; |
| 344 virtual WindowOpenDisposition GetWindowOpenDisposition() const OVERRIDE; | 344 virtual WindowOpenDisposition GetWindowOpenDisposition() const override; |
| 345 virtual ui::PageTransition GetPageTransition() const OVERRIDE; | 345 virtual ui::PageTransition GetPageTransition() const override; |
| 346 virtual void AcceptInput() OVERRIDE; | 346 virtual void AcceptInput() override; |
| 347 virtual void FocusSearch() OVERRIDE; | 347 virtual void FocusSearch() override; |
| 348 virtual void UpdateContentSettingsIcons() OVERRIDE; | 348 virtual void UpdateContentSettingsIcons() override; |
| 349 virtual void UpdateManagePasswordsIconAndBubble() OVERRIDE; | 349 virtual void UpdateManagePasswordsIconAndBubble() override; |
| 350 virtual void UpdatePageActions() OVERRIDE; | 350 virtual void UpdatePageActions() override; |
| 351 virtual void InvalidatePageActions() OVERRIDE; | 351 virtual void InvalidatePageActions() override; |
| 352 virtual void UpdateBookmarkStarVisibility() OVERRIDE; | 352 virtual void UpdateBookmarkStarVisibility() override; |
| 353 virtual bool ShowPageActionPopup(const extensions::Extension* extension, | 353 virtual bool ShowPageActionPopup(const extensions::Extension* extension, |
| 354 bool grant_active_tab) OVERRIDE; | 354 bool grant_active_tab) override; |
| 355 virtual void UpdateOpenPDFInReaderPrompt() OVERRIDE; | 355 virtual void UpdateOpenPDFInReaderPrompt() override; |
| 356 virtual void UpdateGeneratedCreditCardView() OVERRIDE; | 356 virtual void UpdateGeneratedCreditCardView() override; |
| 357 virtual void SaveStateToContents(content::WebContents* contents) OVERRIDE; | 357 virtual void SaveStateToContents(content::WebContents* contents) override; |
| 358 virtual const OmniboxView* GetOmniboxView() const OVERRIDE; | 358 virtual const OmniboxView* GetOmniboxView() const override; |
| 359 virtual LocationBarTesting* GetLocationBarForTesting() OVERRIDE; | 359 virtual LocationBarTesting* GetLocationBarForTesting() override; |
| 360 | 360 |
| 361 // LocationBarTesting: | 361 // LocationBarTesting: |
| 362 virtual int PageActionCount() OVERRIDE; | 362 virtual int PageActionCount() override; |
| 363 virtual int PageActionVisibleCount() OVERRIDE; | 363 virtual int PageActionVisibleCount() override; |
| 364 virtual ExtensionAction* GetPageAction(size_t index) OVERRIDE; | 364 virtual ExtensionAction* GetPageAction(size_t index) override; |
| 365 virtual ExtensionAction* GetVisiblePageAction(size_t index) OVERRIDE; | 365 virtual ExtensionAction* GetVisiblePageAction(size_t index) override; |
| 366 virtual void TestPageActionPressed(size_t index) OVERRIDE; | 366 virtual void TestPageActionPressed(size_t index) override; |
| 367 virtual bool GetBookmarkStarVisibility() OVERRIDE; | 367 virtual bool GetBookmarkStarVisibility() override; |
| 368 | 368 |
| 369 // views::View: | 369 // views::View: |
| 370 virtual const char* GetClassName() const OVERRIDE; | 370 virtual const char* GetClassName() const override; |
| 371 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 371 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override; |
| 372 virtual void OnFocus() OVERRIDE; | 372 virtual void OnFocus() override; |
| 373 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 373 virtual void OnPaint(gfx::Canvas* canvas) override; |
| 374 virtual void PaintChildren(gfx::Canvas* canvas, | 374 virtual void PaintChildren(gfx::Canvas* canvas, |
| 375 const views::CullSet& cull_set) OVERRIDE; | 375 const views::CullSet& cull_set) override; |
| 376 | 376 |
| 377 // views::ButtonListener: | 377 // views::ButtonListener: |
| 378 virtual void ButtonPressed(views::Button* sender, | 378 virtual void ButtonPressed(views::Button* sender, |
| 379 const ui::Event& event) OVERRIDE; | 379 const ui::Event& event) override; |
| 380 | 380 |
| 381 // views::DragController: | 381 // views::DragController: |
| 382 virtual void WriteDragDataForView(View* sender, | 382 virtual void WriteDragDataForView(View* sender, |
| 383 const gfx::Point& press_pt, | 383 const gfx::Point& press_pt, |
| 384 OSExchangeData* data) OVERRIDE; | 384 OSExchangeData* data) override; |
| 385 virtual int GetDragOperationsForView(View* sender, | 385 virtual int GetDragOperationsForView(View* sender, |
| 386 const gfx::Point& p) OVERRIDE; | 386 const gfx::Point& p) override; |
| 387 virtual bool CanStartDragForView(View* sender, | 387 virtual bool CanStartDragForView(View* sender, |
| 388 const gfx::Point& press_pt, | 388 const gfx::Point& press_pt, |
| 389 const gfx::Point& p) OVERRIDE; | 389 const gfx::Point& p) override; |
| 390 | 390 |
| 391 // OmniboxEditController: | 391 // OmniboxEditController: |
| 392 virtual void OnChanged() OVERRIDE; | 392 virtual void OnChanged() override; |
| 393 virtual void OnSetFocus() OVERRIDE; | 393 virtual void OnSetFocus() override; |
| 394 virtual InstantController* GetInstant() OVERRIDE; | 394 virtual InstantController* GetInstant() override; |
| 395 virtual const ToolbarModel* GetToolbarModel() const OVERRIDE; | 395 virtual const ToolbarModel* GetToolbarModel() const override; |
| 396 virtual void HideURL() OVERRIDE; | 396 virtual void HideURL() override; |
| 397 | 397 |
| 398 // DropdownBarHostDelegate: | 398 // DropdownBarHostDelegate: |
| 399 virtual void SetFocusAndSelection(bool select_all) OVERRIDE; | 399 virtual void SetFocusAndSelection(bool select_all) override; |
| 400 virtual void SetAnimationOffset(int offset) OVERRIDE; | 400 virtual void SetAnimationOffset(int offset) override; |
| 401 | 401 |
| 402 // gfx::AnimationDelegate: | 402 // gfx::AnimationDelegate: |
| 403 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; | 403 virtual void AnimationProgressed(const gfx::Animation* animation) override; |
| 404 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; | 404 virtual void AnimationEnded(const gfx::Animation* animation) override; |
| 405 | 405 |
| 406 // TemplateURLServiceObserver: | 406 // TemplateURLServiceObserver: |
| 407 virtual void OnTemplateURLServiceChanged() OVERRIDE; | 407 virtual void OnTemplateURLServiceChanged() override; |
| 408 | 408 |
| 409 // SearchModelObserver: | 409 // SearchModelObserver: |
| 410 virtual void ModelChanged(const SearchModel::State& old_state, | 410 virtual void ModelChanged(const SearchModel::State& old_state, |
| 411 const SearchModel::State& new_state) OVERRIDE; | 411 const SearchModel::State& new_state) override; |
| 412 | 412 |
| 413 // The Browser this LocationBarView is in. Note that at least | 413 // The Browser this LocationBarView is in. Note that at least |
| 414 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser | 414 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser |
| 415 // window, so this may be NULL. | 415 // window, so this may be NULL. |
| 416 Browser* browser_; | 416 Browser* browser_; |
| 417 | 417 |
| 418 OmniboxViewViews* omnibox_view_; | 418 OmniboxViewViews* omnibox_view_; |
| 419 | 419 |
| 420 // Our delegate. | 420 // Our delegate. |
| 421 Delegate* delegate_; | 421 Delegate* delegate_; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 // The width is always positive. The ending width is the width of the entire | 545 // The width is always positive. The ending width is the width of the entire |
| 546 // omnibox URL. As the show animation runs, the current width gradually moves | 546 // omnibox URL. As the show animation runs, the current width gradually moves |
| 547 // from the width of the hostname to the ending value. | 547 // from the width of the hostname to the ending value. |
| 548 int current_omnibox_width_; | 548 int current_omnibox_width_; |
| 549 int ending_omnibox_width_; | 549 int ending_omnibox_width_; |
| 550 | 550 |
| 551 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 551 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
| 552 }; | 552 }; |
| 553 | 553 |
| 554 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 554 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |