| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/android/infobars/infobar_android.h" | 5 #include "chrome/browser/ui/android/infobars/infobar_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "chrome/browser/android/resource_mapper.h" | 10 #include "chrome/browser/android/resource_mapper.h" |
| 11 #include "chrome/browser/infobars/infobar_service.h" | 11 #include "chrome/browser/infobars/infobar_service.h" |
| 12 #include "components/infobars/core/infobar.h" | 12 #include "components/infobars/core/infobar.h" |
| 13 #include "components/infobars/core/infobar_delegate.h" | 13 #include "components/infobars/core/infobar_delegate.h" |
| 14 #include "jni/InfoBar_jni.h" | 14 #include "jni/InfoBar_jni.h" |
| 15 | 15 |
| 16 | 16 |
| 17 // InfoBar -------------------------------------------------------------------- | |
| 18 | |
| 19 // Static constants defined in infobar.h. We don't really use them for anything | |
| 20 // but they are required. The values are copied from the GTK implementation. | |
| 21 const int infobars::InfoBar::kSeparatorLineHeight = 1; | |
| 22 const int infobars::InfoBar::kDefaultArrowTargetHeight = 9; | |
| 23 const int infobars::InfoBar::kMaximumArrowTargetHeight = 24; | |
| 24 const int infobars::InfoBar::kDefaultArrowTargetHalfWidth = | |
| 25 kDefaultArrowTargetHeight; | |
| 26 const int infobars::InfoBar::kMaximumArrowTargetHalfWidth = 14; | |
| 27 const int infobars::InfoBar::kDefaultBarTargetHeight = 36; | |
| 28 | |
| 29 // InfoBarAndroid ------------------------------------------------------------- | 17 // InfoBarAndroid ------------------------------------------------------------- |
| 30 | 18 |
| 31 InfoBarAndroid::InfoBarAndroid(scoped_ptr<infobars::InfoBarDelegate> delegate) | 19 InfoBarAndroid::InfoBarAndroid(scoped_ptr<infobars::InfoBarDelegate> delegate) |
| 32 : infobars::InfoBar(delegate.Pass()) { | 20 : infobars::InfoBar(delegate.Pass()) { |
| 33 } | 21 } |
| 34 | 22 |
| 35 InfoBarAndroid::~InfoBarAndroid() { | 23 InfoBarAndroid::~InfoBarAndroid() { |
| 36 } | 24 } |
| 37 | 25 |
| 38 void InfoBarAndroid::ReassignJavaInfoBar(InfoBarAndroid* replacement) { | 26 void InfoBarAndroid::ReassignJavaInfoBar(InfoBarAndroid* replacement) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 int InfoBarAndroid::GetEnumeratedIconId() { | 64 int InfoBarAndroid::GetEnumeratedIconId() { |
| 77 return ResourceMapper::MapFromChromiumId(delegate()->GetIconID()); | 65 return ResourceMapper::MapFromChromiumId(delegate()->GetIconID()); |
| 78 } | 66 } |
| 79 | 67 |
| 80 | 68 |
| 81 // Native JNI methods --------------------------------------------------------- | 69 // Native JNI methods --------------------------------------------------------- |
| 82 | 70 |
| 83 bool RegisterNativeInfoBar(JNIEnv* env) { | 71 bool RegisterNativeInfoBar(JNIEnv* env) { |
| 84 return RegisterNativesImpl(env); | 72 return RegisterNativesImpl(env); |
| 85 } | 73 } |
| OLD | NEW |