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

Side by Side Diff: chrome/browser/ui/views/browser_actions_container.cc

Issue 6334101: Removal of chrome.experimental.popup set of APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser_actions_container.h" 5 #include "chrome/browser/ui/views/browser_actions_container.h"
6 6
7 #include "base/stl_util-inl.h" 7 #include "base/stl_util-inl.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/browser_window.h" 10 #include "chrome/browser/browser_window.h"
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 gfx::Point origin; 509 gfx::Point origin;
510 View::ConvertPointToScreen(reference_view, &origin); 510 View::ConvertPointToScreen(reference_view, &origin);
511 gfx::Rect rect = reference_view->bounds(); 511 gfx::Rect rect = reference_view->bounds();
512 rect.set_origin(origin); 512 rect.set_origin(origin);
513 513
514 gfx::NativeWindow frame_window = browser_->window()->GetNativeHandle(); 514 gfx::NativeWindow frame_window = browser_->window()->GetNativeHandle();
515 BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ? 515 BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ?
516 BubbleBorder::TOP_LEFT : BubbleBorder::TOP_RIGHT; 516 BubbleBorder::TOP_LEFT : BubbleBorder::TOP_RIGHT;
517 517
518 popup_ = ExtensionPopup::Show(button->GetPopupUrl(), browser_, 518 popup_ = ExtensionPopup::Show(button->GetPopupUrl(), browser_,
519 browser_->profile(), frame_window, rect, arrow_location, true, 519 browser_->profile(), frame_window, rect, arrow_location,
520 inspect_with_devtools, ExtensionPopup::BUBBLE_CHROME, this); 520 inspect_with_devtools, this);
521 popup_button_ = button; 521 popup_button_ = button;
522 popup_button_->SetButtonPushed(); 522 popup_button_->SetButtonPushed();
523 } 523 }
524 524
525 gfx::Size BrowserActionsContainer::GetPreferredSize() { 525 gfx::Size BrowserActionsContainer::GetPreferredSize() {
526 if (browser_action_views_.empty()) 526 if (browser_action_views_.empty())
527 return gfx::Size(ToolbarView::kStandardSpacing, 0); 527 return gfx::Size(ToolbarView::kStandardSpacing, 0);
528 528
529 // We calculate the size of the view by taking the current width and 529 // We calculate the size of the view by taking the current width and
530 // subtracting resize_amount_ (the latter represents how far the user is 530 // subtracting resize_amount_ (the latter represents how far the user is
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 AnimationEnded(resize_animation_.get()); 1097 AnimationEnded(resize_animation_.get());
1098 } 1098 }
1099 } 1099 }
1100 1100
1101 bool BrowserActionsContainer::ShouldDisplayBrowserAction( 1101 bool BrowserActionsContainer::ShouldDisplayBrowserAction(
1102 const Extension* extension) { 1102 const Extension* extension) {
1103 // Only display incognito-enabled extensions while in incognito mode. 1103 // Only display incognito-enabled extensions while in incognito mode.
1104 return (!profile_->IsOffTheRecord() || 1104 return (!profile_->IsOffTheRecord() ||
1105 profile_->GetExtensionService()->IsIncognitoEnabled(extension)); 1105 profile_->GetExtensionService()->IsIncognitoEnabled(extension));
1106 } 1106 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698