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

Unified Diff: chrome/browser/ui/cocoa/location_bar/search_button_decoration.mm

Issue 768413003: TEST ONLY - DO NOT SUBMIT - FOR TRYBOTS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad merge Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/location_bar/search_button_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/search_button_decoration.mm b/chrome/browser/ui/cocoa/location_bar/search_button_decoration.mm
deleted file mode 100644
index 18785c24a80f5e4f9d918d880b6e26d3d5fe1f52..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/cocoa/location_bar/search_button_decoration.mm
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "chrome/browser/ui/cocoa/location_bar/search_button_decoration.h"
-
-#import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
-#import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h"
-#include "grit/theme_resources.h"
-
-namespace {
-
-const CGFloat kInnerPadding = 16;
-const CGFloat kLeftPadding = 3;
-
-} // namespace
-
-SearchButtonDecoration::SearchButtonDecoration(LocationBarViewMac* owner)
- : ButtonDecoration(IMAGE_GRID(IDR_OMNIBOX_SEARCH_BUTTON),
- IDR_OMNIBOX_SEARCH_BUTTON_LOUPE,
- IMAGE_GRID(IDR_OMNIBOX_SEARCH_BUTTON_HOVER),
- IDR_OMNIBOX_SEARCH_BUTTON_LOUPE,
- IMAGE_GRID(IDR_OMNIBOX_SEARCH_BUTTON_PRESSED),
- IDR_OMNIBOX_SEARCH_BUTTON_LOUPE,
- kInnerPadding),
- owner_(owner) {
- DCHECK(owner_);
-}
-
-SearchButtonDecoration::~SearchButtonDecoration() {
-}
-
-CGFloat SearchButtonDecoration::GetWidthForSpace(CGFloat width) {
- CGFloat width_for_space = ButtonDecoration::GetWidthForSpace(width);
- if (width_for_space == kOmittedWidth ||
- width_for_space + kLeftPadding > width)
- return kOmittedWidth;
- return width_for_space + kLeftPadding;
-}
-
-void SearchButtonDecoration::DrawInFrame(NSRect frame, NSView* control_view) {
- frame = NSMakeRect(NSMinX(frame) + kLeftPadding,
- NSMinY(frame),
- NSWidth(frame) - kLeftPadding,
- NSHeight(frame));
- ButtonDecoration::DrawInFrame(frame, control_view);
-}
-
-bool SearchButtonDecoration::OnMousePressed(NSRect frame, NSPoint location) {
- owner_->GetOmniboxView()->model()->AcceptInput(
- owner_->GetWindowOpenDisposition(), false);
- return true;
-}
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/search_button_decoration.h ('k') | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698