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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_message_bubble_view.cc

Issue 653933003: Resubmit: Rename BrowserActionView to ToolbarActionView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "chrome/browser/ui/views/extensions/extension_message_bubble_view.h" 5 #include "chrome/browser/ui/views/extensions/extension_message_bubble_view.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" 10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h"
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 MaybeObserve(); 473 MaybeObserve();
474 else 474 else
475 ShowHighlightingBubble(); 475 ShowHighlightingBubble();
476 } 476 }
477 477
478 void ExtensionMessageBubbleFactory::ShowHighlightingBubble() { 478 void ExtensionMessageBubbleFactory::ShowHighlightingBubble() {
479 DCHECK_EQ(stage_, STAGE_HIGHLIGHTED); 479 DCHECK_EQ(stage_, STAGE_HIGHLIGHTED);
480 stage_ = STAGE_COMPLETE; 480 stage_ = STAGE_COMPLETE;
481 481
482 views::View* reference_view = NULL; 482 views::View* reference_view = NULL;
483 if (container_->num_browser_actions() > 0u) 483 if (container_->num_toolbar_actions() > 0u)
484 reference_view = container_->GetBrowserActionViewAt(0); 484 reference_view = container_->GetToolbarActionViewAt(0);
485 if (reference_view && reference_view->visible()) 485 if (reference_view && reference_view->visible())
486 anchor_view_ = reference_view; 486 anchor_view_ = reference_view;
487 487
488 ExtensionMessageBubbleController* weak_controller = controller_.get(); 488 ExtensionMessageBubbleController* weak_controller = controller_.get();
489 ExtensionMessageBubbleView* bubble_delegate = 489 ExtensionMessageBubbleView* bubble_delegate =
490 new ExtensionMessageBubbleView( 490 new ExtensionMessageBubbleView(
491 anchor_view_, 491 anchor_view_,
492 views::BubbleBorder::TOP_RIGHT, 492 views::BubbleBorder::TOP_RIGHT,
493 scoped_ptr<ExtensionMessageBubbleController>( 493 scoped_ptr<ExtensionMessageBubbleController>(
494 controller_.release())); 494 controller_.release()));
495 views::BubbleDelegateView::CreateBubble(bubble_delegate); 495 views::BubbleDelegateView::CreateBubble(bubble_delegate);
496 weak_controller->Show(bubble_delegate); 496 weak_controller->Show(bubble_delegate);
497 497
498 Finish(); 498 Finish();
499 } 499 }
500 500
501 void ExtensionMessageBubbleFactory::Finish() { 501 void ExtensionMessageBubbleFactory::Finish() {
502 MaybeStopObserving(); 502 MaybeStopObserving();
503 controller_.reset(); 503 controller_.reset();
504 anchor_view_ = NULL; 504 anchor_view_ = NULL;
505 container_ = NULL; 505 container_ = NULL;
506 } 506 }
507 507
508 } // namespace extensions 508 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698